NCBI C++ ToolKit
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: cds_fix.hpp 93572 2021-04-30 13:48:31Z stakhovv $
2  * ===========================================================================
3  *
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Colleen Bollin
27  */
30 #ifndef _CDS_FIX_H_
31 #define _CDS_FIX_H_
33 #include <corelib/ncbistd.hpp>
35 #include <objmgr/scope.hpp>
36 #include <objmgr/scope.hpp>
47 NCBI_XOBJEDIT_EXPORT bool SetTranslExcept(objects::CSeq_feat& cds, const string& comment, bool strict, bool extend, objects::CScope& scope);
60 NCBI_XOBJEDIT_EXPORT CRef<objects::CSeq_id> GetNewProtId(objects::CBioseq_Handle bsh, int &offset, string& id_label, bool general_only);
62 NCBI_XOBJEDIT_EXPORT string GetIdHashOrValue(const string &base, int offset);
65 // these methods are being moved to ncbi::feature namespace
66 // please modify your usage of them
72 {
73 public:
74  enum ECdsFrame {
76  eBest, // choose the frame that produces the longest sequence of aas before a stop codon is produced
77  eMatch, // choose the frame that matches the protein sequence if it can find one
80  eThree
81  };
84  static bool s_SetCDSFrame(CSeq_feat& cds, ECdsFrame frame_type, CScope& scope);
85  static CCdregion::TFrame s_FindMatchingFrame(const CSeq_feat& cds, CScope& scope);
86  static ECdsFrame s_GetFrameFromName(const string& name);
87 };
95 #endif
User-defined methods of the data storage class.
bool AddTerminalCodeBreak(CSeq_feat &cds, CScope &scope)
Definition: cds_fix.cpp:162
bool ExtendCDSToStopCodon(CSeq_feat &cds, CScope &scope)
ExtendCDSToStopCodon A function to extend a CDS location to the first in-frame stop codon in the prot...
Definition: cds_fix.cpp:835
CRef< CSeq_loc > GetLastCodonLoc(const CSeq_feat &cds, CScope &scope)
Definition: cds_fix.cpp:138
void ExtendStop(CSeq_loc &loc, TSeqPos len, CScope &scope)
Definition: cds_fix.cpp:197
bool AdjustProteinFeaturePartialsToMatchCDS(CSeq_feat &new_prot, const CSeq_feat &cds)
AdjustProteinFeaturePartialsToMatchCDS A function to change an existing MolInfo to match a coding reg...
Definition: cds_fix.cpp:398
bool SetTranslExcept(objects::CSeq_feat &cds, const string &comment, bool strict, bool extend, objects::CScope &scope)
CRef< CSeq_feat > MakemRNAforCDS(const CSeq_feat &cds, CScope &scope)
MakemRNAforCDS A function to create a CSeq_feat that represents the appropriate mRNA for a given CDS.
Definition: cds_fix.cpp:525
void AdjustCDSFrameForStartChange(CCdregion &cds, int change)
Definition: cds_fix.cpp:961
bool TruncateCDSAtStop(CSeq_feat &cds, CScope &scope)
TruncateCDSAtStop A function to truncate a CDS location after the first stop codon in the protein tra...
Definition: cds_fix.cpp:786
CRef< objects::CSeq_id > GetNewProtId(objects::CBioseq_Handle bsh, int &offset, string &id_label, bool general_only)
bool DoesCodingRegionHaveTerminalCodeBreak(const objects::CCdregion &cdr)
CRef< objects::CSeq_id > GetNewLocalProtId(const string &id_base, CScope &scope, int &offset)
Definition: cds_fix.cpp:1146
vector< CRef< objects::CSeq_id > > GetNewProtIdFromExistingProt(objects::CBioseq_Handle bsh, int &offset, string &id_label)
bool IsGeneralIdProtPresent(objects::CSeq_entry_Handle tse)
CRef< CGenetic_code > GetGeneticCodeForBioseq(CBioseq_Handle bh)
GetGeneticCodeForBioseq A function to construct the appropriate CGenetic_code object to use when cons...
Definition: cds_fix.cpp:707
bool DemoteCDSToNucSeq(objects::CSeq_feat_Handle &orig_feat)
string GetIdHashOrValue(const string &base, int offset)
Definition: cds_fix.cpp:1133
CBioseq_Handle –.
CCdregion –.
Definition: Cdregion.hpp:66
CConstRef –.
Definition: ncbiobj.hpp:1266
CRef –.
Definition: ncbiobj.hpp:618
CScope –.
Definition: scope.hpp:92
CSeq_entry_Handle –.
CSeq_feat_Handle –.
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
Include a standard set of the NCBI C++ Toolkit most basic headers.
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
NCBI_XOBJEDIT_EXPORT bool AdjustForCDSPartials(const CSeq_feat &cds, CSeq_entry_Handle seh)
AdjustForCDSPartials A function to make all of the necessary related changes to a Seq-entry after the...
Definition: feature.cpp:4115
NCBI_XOBJEDIT_EXPORT bool AdjustProteinMolInfoToMatchCDS(CMolInfo &molinfo, const CSeq_feat &cds)
AdjustProteinMolInfoToMatchCDS A function to change an existing MolInfo to match a coding region.
Definition: feature.cpp:4024
NCBI_XOBJEDIT_EXPORT CConstRef< CSeq_feat > GetmRNAforCDS(const CSeq_feat &cds, CScope &scope)
GetmRNAforCDS A function to find a CSeq_feat representing the appropriate mRNA for a given CDS.
Definition: sequence.cpp:1261
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
Definition: ncbi_export.h:1291
int len
Definition: fix_pub.hpp:45
int offset
Definition: replacements.h:160
#define const
Definition: zconf.h:230
Modified on Tue Feb 27 05:50:39 2024 by rev. 669887