NCBI C++ ToolKit
Classes | Static Public Member Functions | Private Types | Static Private Member Functions | List of all members
CGeneFinder Class Reference

Search Toolkit Book for CGeneFinder

#include <objtools/format/items/gene_finder.hpp>

Classes

class  CGeneSearchPlugin
 

Static Public Member Functions

static void GetAssociatedGeneInfo (const CSeq_feat_Handle &in_feat, CBioseqContext &ctx, const CConstRef< CSeq_loc > &feat_loc, CConstRef< CGene_ref > &out_suppression_check_gene_ref, const CGene_ref *&out_g_ref, CConstRef< CSeq_feat > &out_s_feat, const CSeq_feat_Handle &in_parent_feat)
 Find the gene associated with the given feature. More...
 
static CSeq_feat_Handle ResolveGeneXref (const CGene_ref *xref_g_ref, const CSeq_entry_Handle &top_level_seq_entry)
 This does plain, simple resolution of a CGene_ref to its gene. More...
 

Private Types

enum  FGeneSearchLocOpt { fGeneSearchLocOpt_RemoveFar = 1 << 0 }
 
typedef int TGeneSearchLocOpt
 

Static Private Member Functions

static CConstRef< CGene_refGetSuppressionCheckGeneRef (const CSeq_feat_Handle &feat)
 
static bool CanUseExtremesToFindGene (CBioseqContext &ctx, const CSeq_loc &location)
 
static CConstRef< CSeq_featGetFeatViaSubsetThenExtremesIfPossible (CBioseqContext &ctx, CSeqFeatData::E_Choice feat_type, CSeqFeatData::ESubtype feat_subtype, const CSeq_loc &location, CSeqFeatData::E_Choice sought_type, const CGene_ref *filtering_gene_xref)
 
static CConstRef< CSeq_featGetFeatViaSubsetThenExtremesIfPossible_Helper (CBioseqContext &ctx, CScope *scope, const CSeq_loc &location, CSeqFeatData::E_Choice sought_type, const CGene_ref *filtering_gene_xref)
 
static CConstRef< CSeq_featGetFeatViaSubsetThenExtremesIfPossible_Helper_subset (CBioseqContext &ctx, CScope *scope, const CSeq_loc &location, CSeqFeatData::E_Choice sought_type, const CGene_ref *filtering_gene_xref)
 
static CConstRef< CSeq_featGetFeatViaSubsetThenExtremesIfPossible_Helper_extremes (CBioseqContext &ctx, CScope *scope, const CSeq_loc &location, CSeqFeatData::E_Choice sought_type, const CGene_ref *filtering_gene_xref)
 
static CConstRef< CSeq_featResolveGeneObjectId (CBioseqContext &ctx, const CSeq_feat_Handle &feat, int recursion_depth=0)
 
static bool GeneMatchesXref (const CGene_ref *other_ref, const CGene_ref *xref)
 
static bool BadSeqLocSortOrderCStyle (CBioseq_Handle &bioseq_handle, const CSeq_loc &location)
 
static ENa_strand GeneSearchNormalizeLoc (CBioseq_Handle top_bioseq_handle, CRef< CSeq_loc > &loc, const TSeqPos circular_length, TGeneSearchLocOpt opt=0)
 
static bool IsMixedStrand (CBioseq_Handle bioseq_handle, const CSeq_loc &loc)
 

Detailed Description

Definition at line 52 of file gene_finder.hpp.

Member Typedef Documentation

◆ TGeneSearchLocOpt

Definition at line 206 of file gene_finder.hpp.

Member Enumeration Documentation

◆ FGeneSearchLocOpt

Enumerator
fGeneSearchLocOpt_RemoveFar 

Definition at line 203 of file gene_finder.hpp.

Member Function Documentation

◆ BadSeqLocSortOrderCStyle()

bool CGeneFinder::BadSeqLocSortOrderCStyle ( CBioseq_Handle bioseq_handle,
const CSeq_loc location 
)
staticprivate

◆ CanUseExtremesToFindGene()

bool CGeneFinder::CanUseExtremesToFindGene ( CBioseqContext ctx,
const CSeq_loc location 
)
staticprivate

◆ GeneMatchesXref()

bool CGeneFinder::GeneMatchesXref ( const CGene_ref other_ref,
const CGene_ref xref 
)
staticprivate

◆ GeneSearchNormalizeLoc()

ENa_strand CGeneFinder::GeneSearchNormalizeLoc ( CBioseq_Handle  top_bioseq_handle,
CRef< CSeq_loc > &  loc,
const TSeqPos  circular_length,
TGeneSearchLocOpt  opt = 0 
)
staticprivate

◆ GetAssociatedGeneInfo()

void CGeneFinder::GetAssociatedGeneInfo ( const CSeq_feat_Handle in_feat,
CBioseqContext ctx,
const CConstRef< CSeq_loc > &  feat_loc,
CConstRef< CGene_ref > &  out_suppression_check_gene_ref,
const CGene_ref *&  out_g_ref,
CConstRef< CSeq_feat > &  out_s_feat,
const CSeq_feat_Handle in_parent_feat 
)
static

Find the gene associated with the given feature.

@in_feat The handle to the feature for which we are seeking the gene.

Parameters
ctxThis holds contextual information on the bioseq that the feature is located on. @feat_loc This is the location of the feature which is used for gene-finding purposes. It is occasionally different from in_feat.GetLocation() due to CDS-mapping and such. @out_suppression_check_gene_ref This holds the first suppressed CGene_ref on the feature. If none are suppressed, it holds the last CGene_ref on in_feat. @out_g_ref This holds the CGene_ref referring to the gene of in_feat. @out_s_feat If found, this holds the CSeq_feat of the gene belonging to in_feat. @in_parent_feat If the feature has no parent, just supply an empty CSeq_feat_Handle.

Definition at line 269 of file gene_finder.cpp.

References Compare(), ctx, CSeqFeatData_Base::e_Cdregion, CSeqFeatData_Base::e_Gene, eGetId_Canonical, eSame, CSeqFeatData::eSubtype_bond, CSeqFeatData::eSubtype_cdregion, CSeqFeatData::eSubtype_mat_peptide_aa, CSeqFeatData::eSubtype_preprotein, CSeqFeatData::eSubtype_primer_bind, CSeqFeatData::eSubtype_propeptide_aa, CSeqFeatData::eSubtype_region, CSeqFeatData::eSubtype_sig_peptide_aa, CSeqFeatData::eSubtype_site, CSeqFeatData::eSubtype_transit_peptide_aa, fCompareOverlapping, GeneMatchesXref(), CSeq_feat_Base::GetData(), CSeq_feat_Handle::GetData(), CSeq_feat_Handle::GetFeatSubtype(), CSeq_feat_Handle::GetFeatType(), GetFeatViaSubsetThenExtremesIfPossible(), CSeqFeatData_Base::GetGene(), CSeq_feat_Handle::GetGeneXref(), GetId(), GetIdHandle(), CGene_ref::GetLabel(), CSeq_feat_Base::GetLocation(), CMappedFeat::GetLocation(), CSeq_feat_Handle::GetLocation(), GetMappedCDSForProduct(), CSeq_feat_Handle::GetSeq_feat(), CSeqFeatData::GetSubtype(), GetSuppressionCheckGeneRef(), CSeqFeatData_Base::IsCdregion(), IsSameBioseq(), CGene_ref::IsSuppressed(), NULL, CConstRef< C, Locker >::ReleaseOrNull(), CConstRef< C, Locker >::Reset(), ResolveGeneObjectId(), and ResolveGeneXref().

Referenced by CFeatureItem::x_AddQuals(), and CFeatureItem::x_AddQualsIdx().

◆ GetFeatViaSubsetThenExtremesIfPossible()

CConstRef< CSeq_feat > CGeneFinder::GetFeatViaSubsetThenExtremesIfPossible ( CBioseqContext ctx,
CSeqFeatData::E_Choice  feat_type,
CSeqFeatData::ESubtype  feat_subtype,
const CSeq_loc location,
CSeqFeatData::E_Choice  sought_type,
const CGene_ref filtering_gene_xref 
)
staticprivate

◆ GetFeatViaSubsetThenExtremesIfPossible_Helper()

CConstRef< CSeq_feat > CGeneFinder::GetFeatViaSubsetThenExtremesIfPossible_Helper ( CBioseqContext ctx,
CScope scope,
const CSeq_loc location,
CSeqFeatData::E_Choice  sought_type,
const CGene_ref filtering_gene_xref 
)
staticprivate

◆ GetFeatViaSubsetThenExtremesIfPossible_Helper_extremes()

CConstRef< CSeq_feat > CGeneFinder::GetFeatViaSubsetThenExtremesIfPossible_Helper_extremes ( CBioseqContext ctx,
CScope scope,
const CSeq_loc location,
CSeqFeatData::E_Choice  sought_type,
const CGene_ref filtering_gene_xref 
)
staticprivate

◆ GetFeatViaSubsetThenExtremesIfPossible_Helper_subset()

CConstRef< CSeq_feat > CGeneFinder::GetFeatViaSubsetThenExtremesIfPossible_Helper_subset ( CBioseqContext ctx,
CScope scope,
const CSeq_loc location,
CSeqFeatData::E_Choice  sought_type,
const CGene_ref filtering_gene_xref 
)
staticprivate

◆ GetSuppressionCheckGeneRef()

CConstRef< CGene_ref > CGeneFinder::GetSuppressionCheckGeneRef ( const CSeq_feat_Handle feat)
staticprivate

◆ IsMixedStrand()

bool CGeneFinder::IsMixedStrand ( CBioseq_Handle  bioseq_handle,
const CSeq_loc loc 
)
staticprivate

◆ ResolveGeneObjectId()

CConstRef< CSeq_feat > CGeneFinder::ResolveGeneObjectId ( CBioseqContext ctx,
const CSeq_feat_Handle feat,
int  recursion_depth = 0 
)
staticprivate

◆ ResolveGeneXref()

CSeq_feat_Handle CGeneFinder::ResolveGeneXref ( const CGene_ref xref_g_ref,
const CSeq_entry_Handle top_level_seq_entry 
)
static

This does plain, simple resolution of a CGene_ref to its gene.

for example, this might be used to do gene-resolution for certain non-Genbank records. @xref_g_ref The CGene_ref we're resolving. @top_level_seq_entry This is the Seq-entry under which we look for the gene that xref_g_ref points to.

Returns
The CSeq_feat_Handle of the gene that xref_g_ref refers to, or an empty CSeq_feat_Handle if none found.

Definition at line 462 of file gene_finder.cpp.

References _ASSERT, set< Key, Compare >::end(), CSeqMap::fFindAny, set< Key, Compare >::find(), CTSE_Handle::GetGenesByRef(), CTSE_Handle::GetGenesWithLocus(), GetLength(), CSeq_feat_Handle::GetLocation(), CGene_ref_Base::GetLocus(), CGene_ref_Base::GetLocus_tag(), CSeq_entry_Handle::GetScope(), CSeq_entry_Handle::GetTSE_Handle(), set< Key, Compare >::insert(), CGene_ref_Base::IsSetLocus(), CGene_ref_Base::IsSetLocus_tag(), kMax_Auto, NON_CONST_ITERATE, and NULL.

Referenced by GetAssociatedGeneInfo(), and CFeatureItem::x_AddQuals().


The documentation for this class was generated from the following files:
Modified on Tue Dec 05 02:10:52 2023 by modify_doxy.py rev. 669887