NCBI C++ ToolKit
Classes
sequence.hpp File Reference
#include <corelib/ncbistd.hpp>
#include <serial/serial.hpp>
#include <serial/objistr.hpp>
#include <serial/objostr.hpp>
#include <objects/seqfeat/SeqFeatData.hpp>
#include <objects/seqfeat/Cdregion.hpp>
#include <objects/seqloc/Na_strand.hpp>
#include <objects/seqloc/Seq_interval.hpp>
#include <objects/seqloc/Seq_loc.hpp>
#include <util/strsearch.hpp>
#include <objects/seq/seq_id_mapper.hpp>
#include <util/range_coll.hpp>
#include <objmgr/feat_ci.hpp>
#include <objmgr/bioseq_ci.hpp>
#include <objmgr/scope.hpp>
#include <objmgr/util/seq_loc_util.hpp>
#include <objmgr/util/create_defline.hpp>
+ Include dependency graph for sequence.hpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

class  CGetOverlappingFeaturesPlugin
 
class  CSeqIdFromHandleException
 
class  CFastaOstream
 FASTA-format output; see also ReadFasta in <objtools/readers/fasta.hpp> More...
 
struct  CFastaOstream::SGapModText
 This indicates the text of the modifiers of a gap. More...
 
class  CCdregion_translate
 Public interface for coding region translation function Uses CTrans_table in <objects/seqfeat/Genetic_code_table.hpp> for rapid translation from a given genetic code, allowing all of the iupac nucleotide ambiguity characters. More...
 
class  CSeqTranslator
 
struct  SRelLoc
 Location relative to a base Seq-loc: one (usually) or more ranges of offsets. More...
 
class  CSeqSearch
 ============================================================================// Sequence Search // ============================================================================// More...
 
class  CSeqSearch::CPatternInfo
 Holds information associated with a pattern, such as the name of the restriction enzyme, location of cut site etc. More...
 
class  CSeqSearch::IClient
 Client interface: ================== A class that uses the SeqSearch facility should implement the Client interface and register itself with the search utility to be notified of matches detection. More...
 
class  CSequenceAmbigTrimmer
 This trims ambiguous bases from the start and/or end of sequences, using customizable rules. More...
 
struct  CSequenceAmbigTrimmer::STrimRule
 For example, if bases_to_check is 10 and max_bases_allowed_to_be_ambig is 5, then on each iteration we check the 10 terminal bases and trim off those 10 if there are more than 5 ambiguous bases there. More...
 
struct  CSequenceAmbigTrimmer::SAmbigCount
 This holds the output of x_CountAmbigInRange. More...
 
class  CBioseqGaps_CI
 This iterates over the runs of Ns of each sequence. More...
 
struct  CBioseqGaps_CI::Params
 The params that control the behavior of CBioseqGaps_CI. More...
 
struct  CBioseqGaps_CI::SCurrentGapInfo
 This indicates the state of the iterator right now. More...
 

Functions

FindLatestSequence

Walk the replace history to find the latest revision of a sequence

CConstRef< CSeq_idFindLatestSequence (const CSeq_id &id, CScope &scope)
 Given a seq-id check its replace history and try to find the latest revision. More...
 
CSeq_id_Handle FindLatestSequence (const CSeq_id_Handle &idh, CScope &scope)
 
CConstRef< CSeq_idFindLatestSequence (const CSeq_id &id, CScope &scope, const CTime &tlim)
 Check replace history up to the specified date. More...
 
CSeq_id_Handle FindLatestSequence (const CSeq_id_Handle &idh, CScope &scope, const CTime &tlim)
 
Sequences

Searching for bioseqs etc.

const CBioseqGetNucleotideParent (const CBioseq &product, CScope *scope)
 Get the encoding nucleotide sequnce of a protein. More...
 
CBioseq_Handle GetNucleotideParent (const CBioseq_Handle &product)
 
CBioseq_Handle GetParentForPart (const CBioseq_Handle &part)
 Get the parent bioseq for a part of a segmented bioseq. More...
 
const COrg_refGetOrg_ref (const CBioseq_Handle &handle)
 Return the org-ref associated with a given sequence. More...
 
const COrg_refGetOrg_refOrNull (const CBioseq_Handle &handle)
 Return the pointer to org-ref associated with a given sequence or null if there is no org-ref associated with the sequence. More...
 
TTaxId GetTaxId (const CBioseq_Handle &handle)
 return the tax-id associated with a given sequence. More...
 
const CMolInfoGetMolInfo (const CBioseq &bioseq)
 Retrieve the MolInfo object for a given bioseq handle. More...
 
const CMolInfoGetMolInfo (const CBioseq_Handle &handle)
 
const CBioSourceGetBioSource (const CBioseq &bioseq)
 Retrieve the BioSource object for a given bioseq handle. More...
 
const CBioSourceGetBioSource (const CBioseq_Handle &handle)
 
CBioseq_Handle GetBioseqFromSeqLoc (const CSeq_loc &loc, CScope &scope, CScope::EGetBioseqFlag flag=CScope::eGetBioseq_Loaded)
 Retrieve the Bioseq Handle from a location. More...
 
string GetProteinName (const CBioseq_Handle &seq)
 Return protein name from corresponding Prot-ref feature. More...
 
CConstRef< CSeq_featGetSourceFeatForProduct (const CBioseq_Handle &bsh)
 
TTaxId GetTaxIdForProduct (const CBioseq_Handle &bsh)
 
void GetOrg_refForProduct (const CBioseq_Handle &bsh, const COrg_ref *)
 
const COrg_refGetOrg_refForBioseq (const CBioseq_Handle &bsh)
 Find an Org-ref for the given Bioseq: If it's a protein then look on the source feature of the product. More...
 
const CBioSourceGetBioSourceForBioseq (const CBioseq_Handle &bsh)
 Find a BioSource for the given Bioseq: If it's a protein then look for the source feature of the product. More...
 
void ReverseComplement (CSeq_inst &seq, CScope *scope)
 Reverse complement a Bioseq in place. More...
 

SeqIdConv

Conversions between seq-id types

enum  EAccessionVersion { eWithAccessionVersion , eWithoutAccessionVersion }
 
enum  EGetIdFlags {
  eGetId_ForceGi = 0x0000 , eGetId_ForceAcc = 0x0001 , eGetId_Best = 0x0002 , eGetId_HandleDefault = 0x0003 ,
  eGetId_Seq_id_Score = 0x0004 , eGetId_Seq_id_BestRank = 0x0005 , eGetId_Seq_id_WorstRank = 0x0006 , eGetId_Seq_id_FastaAARank = 0x0007 ,
  eGetId_Seq_id_FastaNARank = 0x0008 , eGetId_Canonical = eGetId_Seq_id_BestRank , eGetId_TypeMask = 0x00FF , eGetId_VerifyId = 0x0100 ,
  eGetId_ThrowOnError = 0x0200 , eGetId_Default = eGetId_Best | eGetId_ThrowOnError
}
 Retrieve a particular seq-id from a given bioseq handle. More...
 
typedef int EGetIdType
 
TGi GetGiForAccession (const string &acc, CScope &scope, EGetIdType flags=0)
 Given an accession string retrieve the GI id. More...
 
string GetAccessionForGi (TGi gi, CScope &scope, EAccessionVersion use_version=eWithAccessionVersion, EGetIdType flags=0)
 Retrieve the accession for a given GI. More...
 
TGi GetGiForId (const objects::CSeq_id &id, CScope &scope, EGetIdType flags=0)
 Given a Seq-id retrieve the corresponding GI. More...
 
string GetAccessionForId (const objects::CSeq_id &id, CScope &scope, EAccessionVersion use_version=eWithAccessionVersion, EGetIdType flags=0)
 Retrieve the accession string for a Seq-id. More...
 
CSeq_id_Handle GetId (const CBioseq_Handle &handle, EGetIdType type=eGetId_Default)
 Return a selected ID type for a given bioseq handle. More...
 
CSeq_id_Handle GetId (const CSeq_id &id, CScope &scope, EGetIdType type=eGetId_Default)
 Return a selected ID type for a seq-id. More...
 
CSeq_id_Handle GetId (const CSeq_id_Handle &id, CScope &scope, EGetIdType type=eGetId_Default)
 Return a selected ID type for a seq-id handle. More...
 
CSeq_id_Handle GetId (const CBioseq::TId &id, EGetIdType type=eGetId_Default)
 Return a selected ID type from a set of Seq-ids Arguments (except 'id') and behavior is the same as of GetId(const CSeq_id& id, ...). More...
 
CSeq_id_Handle GetId (const CBioseq &seq, EGetIdType type=eGetId_Default)
 Return a selected ID type from a Bioseq Arguments (except 'seq') and behavior is the same as of GetId(const CBioseq_Handle& seq, ...). More...
 

GetTitle

Get sequence's title (used in various flat-file formats.) Deprecated in favor of CDeflineGenerator.

enum  EGetTitleFlags { fGetTitle_Reconstruct = 0x1 , fGetTitle_Organism = 0x2 , fGetTitle_AllProteins = 0x4 , fGetTitle_NoExpensive = 0x8 }
 This function is here rather than in CBioseq because it may need to inspect other sequences. More...
 
typedef int TGetTitleFlags
 
NCBI_XOBJUTIL_EXPORT string GetTitle (const CBioseq_Handle &hnd, TGetTitleFlags flags=0)
 
NCBI_XOBJUTIL_EXPORT bool GetTitle (const CBioseq &seq, string *title_ptr, TGetTitleFlags flags=0)
 

Source and Product

Mapping locations through features

enum  ES2PFlags { fS2P_NoMerge = 0x1 , fS2P_AllowTer = 0x2 }
 
enum  EP2SFlags { fP2S_Extend = 0x1 }
 
typedef int TS2PFlags
 
typedef int TP2SFlags
 
CRef< CSeq_locSourceToProduct (const CSeq_feat &feat, const CSeq_loc &source_loc, TS2PFlags flags=0, CScope *scope=0, int *frame=0)
 
CRef< CSeq_locProductToSource (const CSeq_feat &feat, const CSeq_loc &prod_loc, TP2SFlags flags=0, CScope *scope=0)
 

Overlapping

Searching for features

enum  EBestFeatOpts {
  fBestFeat_StrictMatch = 0x01 , fBestFeat_NoExpensive = 0x02 , fBestFeat_FavorLonger = 0x04 , fBestFeat_IgnoreStrand = 0x08 ,
  fBestFeat_Defaults = 0
}
 
enum  ETransSplicing { eTransSplicing_No = 0 , eTransSplicing_Yes , eTransSplicing_Auto }
 Convenience functions for popular overlapping types. More...
 
typedef int TBestFeatOpts
 
typedef pair< Int8, CConstRef< CSeq_feat > > TFeatScore
 Storage for features and scores. More...
 
typedef vector< TFeatScoreTFeatScores
 
void GetOverlappingFeatures (const CSeq_loc &loc, CSeqFeatData::E_Choice feat_type, CSeqFeatData::ESubtype feat_subtype, EOverlapType overlap_type, TFeatScores &feats, CScope &scope, const TBestFeatOpts opts=0, CGetOverlappingFeaturesPlugin *plugin=NULL)
 Find all features overlapping the location. More...
 
CConstRef< CSeq_featGetBestOverlappingFeat (const CSeq_loc &loc, CSeqFeatData::E_Choice feat_type, EOverlapType overlap_type, CScope &scope, TBestFeatOpts opts=fBestFeat_Defaults, CGetOverlappingFeaturesPlugin *plugin=NULL)
 See the note above on 'overlap_type' meaning. More...
 
CConstRef< CSeq_featGetBestOverlappingFeat (const CSeq_loc &loc, CSeqFeatData::ESubtype feat_type, EOverlapType overlap_type, CScope &scope, TBestFeatOpts opts=fBestFeat_Defaults, CGetOverlappingFeaturesPlugin *plugin=NULL)
 See the note above on 'overlap_type' meaning. More...
 
CConstRef< CSeq_featGetBestGeneForMrna (const CSeq_feat &mrna_feat, CScope &scope, TBestFeatOpts opts=fBestFeat_Defaults, CGetOverlappingFeaturesPlugin *plugin=NULL)
 
CConstRef< CSeq_featGetBestGeneForCds (const CSeq_feat &cds_feat, CScope &scope, TBestFeatOpts opts=fBestFeat_Defaults, CGetOverlappingFeaturesPlugin *plugin=NULL)
 
CConstRef< CSeq_featGetBestMrnaForCds (const CSeq_feat &cds_feat, CScope &scope, TBestFeatOpts opts=fBestFeat_Defaults, CGetOverlappingFeaturesPlugin *plugin=NULL)
 
CConstRef< CSeq_featGetBestCdsForMrna (const CSeq_feat &mrna_feat, CScope &scope, TBestFeatOpts opts=fBestFeat_Defaults, CGetOverlappingFeaturesPlugin *plugin=NULL)
 
void GetMrnasForGene (const CSeq_feat &gene_feat, CScope &scope, list< CConstRef< CSeq_feat > > &mrna_feats, TBestFeatOpts opts=fBestFeat_Defaults, CGetOverlappingFeaturesPlugin *plugin=NULL)
 
void GetCdssForGene (const CSeq_feat &gene_feat, CScope &scope, list< CConstRef< CSeq_feat > > &cds_feats, TBestFeatOpts opts=fBestFeat_Defaults, CGetOverlappingFeaturesPlugin *plugin=NULL)
 
CConstRef< CSeq_featGetBestGeneForMrna (const CSeq_feat &mrna_feat, const CTSE_Handle &tse, TBestFeatOpts opts=fBestFeat_Defaults, CGetOverlappingFeaturesPlugin *plugin=NULL)
 
CConstRef< CSeq_featGetBestGeneForCds (const CSeq_feat &cds_feat, const CTSE_Handle &tse, TBestFeatOpts opts=fBestFeat_Defaults, CGetOverlappingFeaturesPlugin *plugin=NULL)
 
CConstRef< CSeq_featGetBestMrnaForCds (const CSeq_feat &cds_feat, const CTSE_Handle &tse, TBestFeatOpts opts=fBestFeat_Defaults, CGetOverlappingFeaturesPlugin *plugin=NULL)
 
CConstRef< CSeq_featGetBestCdsForMrna (const CSeq_feat &mrna_feat, const CTSE_Handle &tse, TBestFeatOpts opts=fBestFeat_Defaults, CGetOverlappingFeaturesPlugin *plugin=NULL)
 
void GetMrnasForGene (const CSeq_feat &gene_feat, const CTSE_Handle &tse, list< CConstRef< CSeq_feat > > &mrna_feats, TBestFeatOpts opts=fBestFeat_Defaults, CGetOverlappingFeaturesPlugin *plugin=NULL)
 
void GetCdssForGene (const CSeq_feat &gene_feat, const CTSE_Handle &tse, list< CConstRef< CSeq_feat > > &cds_feats, TBestFeatOpts opts=fBestFeat_Defaults, CGetOverlappingFeaturesPlugin *plugin=NULL)
 
CConstRef< CSeq_featGetBestOverlappingFeat (const CSeq_feat &feat, CSeqFeatData::E_Choice feat_type, sequence::EOverlapType overlap_type, CScope &scope, TBestFeatOpts opts=fBestFeat_Defaults, CGetOverlappingFeaturesPlugin *plugin=NULL)
 
CConstRef< CSeq_featGetBestOverlappingFeat (const CSeq_feat &feat, CSeqFeatData::ESubtype feat_type, sequence::EOverlapType overlap_type, CScope &scope, TBestFeatOpts opts=fBestFeat_Defaults, CGetOverlappingFeaturesPlugin *plugin=NULL)
 
CConstRef< CSeq_featGetmRNAforCDS (const CSeq_feat &cds, CScope &scope)
 GetmRNAforCDS A function to find a CSeq_feat representing the appropriate mRNA for a given CDS. More...
 
CConstRef< CSeq_featGetBestOverlapForSNP (const CSeq_feat &snp_feat, CSeqFeatData::E_Choice type, CScope &scope, bool search_both_strands=true)
 Get the best overlapping feature for a SNP (variation) feature. More...
 
CConstRef< CSeq_featGetBestOverlapForSNP (const CSeq_feat &snp_feat, CSeqFeatData::ESubtype subtype, CScope &scope, bool search_both_strands=true)
 Get the best overlapping feature for a SNP (variation) More...
 
CConstRef< CSeq_featGetOverlappingGene (const CSeq_loc &loc, CScope &scope, ETransSplicing eTransSplicing=eTransSplicing_Auto)
 
CConstRef< CSeq_featGetGeneForFeature (const CSeq_feat &feat, CScope &scope)
 Finds gene for feature, but obeys SeqFeatXref directives. More...
 
bool IsPseudo (const CSeq_feat &feat, CScope &scope)
 Determines whether given feature is pseudo, using gene associated with feature if necessary Checks to see if a feature is pseudo. More...
 
CConstRef< CSeq_featGetOverlappingmRNA (const CSeq_loc &loc, CScope &scope)
 
CConstRef< CSeq_featGetOverlappingCDS (const CSeq_loc &loc, CScope &scope)
 
CConstRef< CSeq_featGetOverlappingPub (const CSeq_loc &loc, CScope &scope)
 
CConstRef< CSeq_featGetOverlappingSource (const CSeq_loc &loc, CScope &scope)
 
CConstRef< CSeq_featGetOverlappingOperon (const CSeq_loc &loc, CScope &scope)
 
const CSeq_featGetCDSForProduct (const CBioseq &product, CScope *scope)
 Get the encoding CDS feature of a given protein sequence. More...
 
const CSeq_featGetCDSForProduct (const CBioseq_Handle &product)
 
CMappedFeat GetMappedCDSForProduct (const CBioseq_Handle &product)
 
const CSeq_featGetPROTForProduct (const CBioseq &product, CScope *scope)
 Get the mature peptide feature of a protein. More...
 
const CSeq_featGetPROTForProduct (const CBioseq_Handle &product)
 
const CSeq_featGetmRNAForProduct (const CBioseq &product, CScope *scope)
 Get the encoding mRNA feature of a given mRNA (cDNA) bioseq. More...
 
const CSeq_featGetmRNAForProduct (const CBioseq_Handle &product)
 
CMappedFeat GetMappedmRNAForProduct (const CBioseq_Handle &product)
 
Modified on Thu Dec 07 10:10:09 2023 by modify_doxy.py rev. 669887