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

Search Toolkit Book for CCompareSeqRegions

Compare multiple feature annotations on the specified seq_locs. More...

#include <algo/sequence/compare_feats.hpp>

+ Inheritance diagram for CCompareSeqRegions:
+ Collaboration diagram for CCompareSeqRegions:

Public Types

enum  EScoreMethod { eScore_SymmetricPctOverlap , eScore_Feat1PctOverlap , eScore_Feat2PctOverlap }
 
enum  EComparisonOptions {
  fSelectBest = (1<<0) , fMergeExons = (1<<1) , fDifferentGenesOnly = (1<<2) , fCreateSentinelGenes = (1<<3) ,
  fSameTypeOnly = (1<<4)
}
 
typedef int TComparisonOptions
 
- Public Types inherited from CObject
enum  EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern }
 Control filling of newly allocated memory. More...
 
typedef CObjectCounterLocker TLockerType
 Default locker type for CRef. More...
 
typedef atomic< Uint8TCounter
 Counter type is CAtomiCounter. More...
 
typedef Uint8 TCount
 Alias for value type of counter. More...
 

Public Member Functions

 CCompareSeqRegions (const CSeq_loc &query_loc, CScope *q_scope, CScope *t_scope, ILocMapper &mapper, const SAnnotSelector &q_sel, const SAnnotSelector &t_sel, const CSeq_id &target_id, TComparisonOptions options=fSelectBest|fMergeExons, EScoreMethod score_method=eScore_SymmetricPctOverlap)
 
void Rewind ()
 
TComparisonOptionsSetOptions ()
 
TComparisonOptions GetOptions () const
 
const CSeq_locGetQueryLoc () const
 
bool NextComparisonGroup (vector< CRef< CCompareFeats > > &v)
 Return the next group of comparisons on the region (return true iff found any) A group is a set of features on the query region where each feature overlaps at least one other feature in the group. More...
 
void SelectMatches (vector< CRef< CCompareFeats > > &v)
 
- Public Member Functions inherited from CObject
 CObject (void)
 Constructor. More...
 
 CObject (const CObject &src)
 Copy constructor. More...
 
virtual ~CObject (void)
 Destructor. More...
 
CObjectoperator= (const CObject &src) THROWS_NONE
 Assignment operator. More...
 
bool CanBeDeleted (void) const THROWS_NONE
 Check if object can be deleted. More...
 
bool IsAllocatedInPool (void) const THROWS_NONE
 Check if object is allocated in memory pool (not system heap) More...
 
bool Referenced (void) const THROWS_NONE
 Check if object is referenced. More...
 
bool ReferencedOnlyOnce (void) const THROWS_NONE
 Check if object is referenced only once. More...
 
void AddReference (void) const
 Add reference to object. More...
 
void RemoveReference (void) const
 Remove reference to object. More...
 
void ReleaseReference (void) const
 Remove reference without deleting object. More...
 
virtual void DoNotDeleteThisObject (void)
 Mark this object as not allocated in heap – do not delete this object. More...
 
virtual void DoDeleteThisObject (void)
 Mark this object as allocated in heap – object can be deleted. More...
 
void * operator new (size_t size)
 Define new operator for memory allocation. More...
 
void * operator new[] (size_t size)
 Define new[] operator for 'array' memory allocation. More...
 
void operator delete (void *ptr)
 Define delete operator for memory deallocation. More...
 
void operator delete[] (void *ptr)
 Define delete[] operator for memory deallocation. More...
 
void * operator new (size_t size, void *place)
 Define new operator. More...
 
void operator delete (void *ptr, void *place)
 Define delete operator. More...
 
void * operator new (size_t size, CObjectMemoryPool *place)
 Define new operator using memory pool. More...
 
void operator delete (void *ptr, CObjectMemoryPool *place)
 Define delete operator. More...
 
virtual void DebugDump (CDebugDumpContext ddc, unsigned int depth) const
 Define method for dumping debug information. More...
 
- Public Member Functions inherited from CDebugDumpable
 CDebugDumpable (void)
 
virtual ~CDebugDumpable (void)
 
void DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const
 
void DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const
 
void DumpToConsole (void) const
 

Static Public Member Functions

static int s_GetGeneId (const CSeq_feat &feat)
 
- Static Public Member Functions inherited from CObject
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (void)
 Define method to throw null pointer exception. More...
 
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (const type_info &type)
 
static EAllocFillMode GetAllocFillMode (void)
 
static void SetAllocFillMode (EAllocFillMode mode)
 
static void SetAllocFillMode (const string &value)
 Set mode from configuration parameter value. More...
 
- Static Public Member Functions inherited from CDebugDumpable
static void EnableDebugDump (bool on)
 

Private Member Functions

void x_GetPutativeMatches (vector< CRef< CCompareFeats > > &v, CConstRef< CSeq_feat > q_feat)
 
CConstRef< CSeq_locx_GetSelfLoc (const CSeq_loc &loc, CScope *scope, bool merge_single_range)
 

Private Attributes

CConstRef< CSeq_locm_loc_q
 
CScopem_scope_q
 
CScopem_scope_t
 
CRef< ILocMapperm_mapper
 
const SAnnotSelectorm_selector_q
 
const SAnnotSelectorm_selector_t
 
CConstRef< CSeq_idm_target_id
 
CRef< CSeq_loc_Mapperm_self_mapper_q
 
CRef< CSeq_loc_Mapperm_self_mapper_t
 
TComparisonOptions m_comp_options
 
EScoreMethod m_score_method
 
CFeat_CI m_loc_q_ci
 
std::set< std::stringm_seen_targets
 
bool m_already_processed_unmatched_targets
 

Additional Inherited Members

- Static Public Attributes inherited from CObject
static const TCount eCounterBitsCanBeDeleted = 1 << 0
 Define possible object states. More...
 
static const TCount eCounterBitsInPlainHeap = 1 << 1
 Heap signature was found. More...
 
static const TCount eCounterBitsPlaceMask
 Mask for 'in heap' state flags. More...
 
static const int eCounterStep = 1 << 2
 Skip over the "in heap" bits. More...
 
static const TCount eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2)
 Minimal value for valid objects (reference counter is zero) Must be a single bit value. More...
 
static const TCount eCounterStateMask
 Valid object, and object in heap. More...
 
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
 

Detailed Description

Compare multiple feature annotations on the specified seq_locs.

Definition at line 487 of file compare_feats.hpp.

Member Typedef Documentation

◆ TComparisonOptions

Definition at line 504 of file compare_feats.hpp.

Member Enumeration Documentation

◆ EComparisonOptions

Enumerator
fSelectBest 
fMergeExons 
fDifferentGenesOnly 
fCreateSentinelGenes 
fSameTypeOnly 

Definition at line 496 of file compare_feats.hpp.

◆ EScoreMethod

Enumerator
eScore_SymmetricPctOverlap 

length of overlap / (sum of lengths - overlaps)

eScore_Feat1PctOverlap 

length of overlap / (length of 1st feat)

eScore_Feat2PctOverlap 

length of overlap / (length of 2nd feat)

Definition at line 490 of file compare_feats.hpp.

Constructor & Destructor Documentation

◆ CCompareSeqRegions()

CCompareSeqRegions::CCompareSeqRegions ( const CSeq_loc query_loc,
CScope q_scope,
CScope t_scope,
ILocMapper mapper,
const SAnnotSelector q_sel,
const SAnnotSelector t_sel,
const CSeq_id target_id,
TComparisonOptions  options = fSelectBest|fMergeExons,
EScoreMethod  score_method = eScore_SymmetricPctOverlap 
)
inline

Member Function Documentation

◆ GetOptions()

TComparisonOptions CCompareSeqRegions::GetOptions ( void  ) const
inline

Definition at line 561 of file compare_feats.hpp.

References m_comp_options.

Referenced by CXcompareAnnotsApplication::x_ProcessComparison().

◆ GetQueryLoc()

const CSeq_loc& CCompareSeqRegions::GetQueryLoc ( ) const
inline

Definition at line 563 of file compare_feats.hpp.

References m_loc_q.

Referenced by CXcompareAnnotsApplication::x_ProcessComparison().

◆ NextComparisonGroup()

bool CCompareSeqRegions::NextComparisonGroup ( vector< CRef< CCompareFeats > > &  vComparisons)

Return the next group of comparisons on the region (return true iff found any) A group is a set of features on the query region where each feature overlaps at least one other feature in the group.

(normally related gene, introns, exons, mRNAs and CDSes). Comparison for each feature contains best match from the other sequence and their relationship. (may be more than one best) If cannot find matching (overlapping) feature of the same type on the target, choose the one(s) of the semantically closest type. TODO: need to report features on target unaccounted for in the reported comparisons

Definition at line 731 of file compare_feats.cpp.

References _TRACE, CSeq_loc::Add(), Compare(), dummy, CSeq_loc_Base::e_not_set, eNoOverlap, fCompareOverlapping, fFGL_Both, CSeq_loc::fMerge_All, CSeq_loc::fMerge_SingleRange, fSelectBest, GetLabel(), CSeq_loc::GetLabel(), GetLength(), CSeq_feat_Base::GetLocation(), CSeq_loc_Base::IsEmpty(), CSeq_loc_Base::IsNull(), ITERATE, label, CCompareSeq_locs::m_scope_t, Seq_loc_Add(), Seq_loc_Subtract(), CSeq_loc::SetMix(), CSeq_loc::SetNull(), SAnnotSelector::SetOverlapIntervals(), and CSeq_loc_Base::Which().

Referenced by CXcompareAnnotsApplication::x_ProcessComparison().

◆ Rewind()

void CCompareSeqRegions::Rewind ( )
inline

Definition at line 555 of file compare_feats.hpp.

References m_loc_q_ci, m_seen_targets, and CFeat_CI::Rewind().

◆ s_GetGeneId()

int CCompareSeqRegions::s_GetGeneId ( const CSeq_feat feat)
static

◆ SelectMatches()

void CCompareSeqRegions::SelectMatches ( vector< CRef< CCompareFeats > > &  v)

◆ SetOptions()

TComparisonOptions& CCompareSeqRegions::SetOptions ( void  )
inline

Definition at line 560 of file compare_feats.hpp.

References m_comp_options.

◆ x_GetPutativeMatches()

void CCompareSeqRegions::x_GetPutativeMatches ( vector< CRef< CCompareFeats > > &  v,
CConstRef< CSeq_feat q_feat 
)
private

◆ x_GetSelfLoc()

CConstRef< CSeq_loc > CCompareSeqRegions::x_GetSelfLoc ( const CSeq_loc loc,
CScope scope,
bool  merge_single_range 
)
private

Member Data Documentation

◆ m_already_processed_unmatched_targets

bool CCompareSeqRegions::m_already_processed_unmatched_targets
private

Definition at line 592 of file compare_feats.hpp.

◆ m_comp_options

TComparisonOptions CCompareSeqRegions::m_comp_options
private

Definition at line 586 of file compare_feats.hpp.

Referenced by GetOptions(), and SetOptions().

◆ m_loc_q

CConstRef<CSeq_loc> CCompareSeqRegions::m_loc_q
private

Definition at line 577 of file compare_feats.hpp.

Referenced by GetQueryLoc().

◆ m_loc_q_ci

CFeat_CI CCompareSeqRegions::m_loc_q_ci
private

Definition at line 588 of file compare_feats.hpp.

Referenced by Rewind().

◆ m_mapper

CRef<ILocMapper> CCompareSeqRegions::m_mapper
private

Definition at line 580 of file compare_feats.hpp.

◆ m_scope_q

CScope* CCompareSeqRegions::m_scope_q
private

Definition at line 578 of file compare_feats.hpp.

Referenced by CCompareSeqRegions().

◆ m_scope_t

CScope* CCompareSeqRegions::m_scope_t
private

Definition at line 579 of file compare_feats.hpp.

Referenced by CCompareSeqRegions().

◆ m_score_method

EScoreMethod CCompareSeqRegions::m_score_method
private

Definition at line 587 of file compare_feats.hpp.

◆ m_seen_targets

std::set<std::string> CCompareSeqRegions::m_seen_targets
private

Definition at line 589 of file compare_feats.hpp.

Referenced by CCompareSeqRegions(), and Rewind().

◆ m_selector_q

const SAnnotSelector& CCompareSeqRegions::m_selector_q
private

Definition at line 581 of file compare_feats.hpp.

◆ m_selector_t

const SAnnotSelector& CCompareSeqRegions::m_selector_t
private

Definition at line 582 of file compare_feats.hpp.

◆ m_self_mapper_q

CRef<CSeq_loc_Mapper> CCompareSeqRegions::m_self_mapper_q
private

Definition at line 584 of file compare_feats.hpp.

Referenced by CCompareSeqRegions().

◆ m_self_mapper_t

CRef<CSeq_loc_Mapper> CCompareSeqRegions::m_self_mapper_t
private

Definition at line 585 of file compare_feats.hpp.

Referenced by CCompareSeqRegions().

◆ m_target_id

CConstRef<CSeq_id> CCompareSeqRegions::m_target_id
private

Definition at line 583 of file compare_feats.hpp.


The documentation for this class was generated from the following files:
Modified on Sat Dec 02 09:22:50 2023 by modify_doxy.py rev. 669887