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 CAtomicCounter TCounter
 Counter type is CAtomiCounter. More...
 
typedef TCounter::TValue 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_NORETURN void ThrowNullPointerException (void)
 Define method to throw null pointer exception. More...
 
static NCBI_NORETURN 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

Definition at line 504 of file compare_feats.hpp.

Member Enumeration Documentation

Enumerator
fSelectBest 
fMergeExons 
fDifferentGenesOnly 
fCreateSentinelGenes 
fSameTypeOnly 

Definition at line 496 of file compare_feats.hpp.

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 ( 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

TComparisonOptions CCompareSeqRegions::GetOptions ( void  ) const
inline

Definition at line 561 of file compare_feats.hpp.

References m_comp_options.

Referenced by CXcompareAnnotsApplication::x_ProcessComparison().

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().

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, f(), fCompareOverlapping, fFGL_Both, CSeq_loc::fMerge_All, CSeq_loc::fMerge_SingleRange, fSelectBest, CSeq_loc::GetLabel(), GetLabel(), GetLength(), CSeq_feat_Base::GetLocation(), CSeq_loc_Base::IsEmpty(), CSeq_loc_Base::IsNull(), ITERATE, 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().

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().

int CCompareSeqRegions::s_GetGeneId ( const CSeq_feat feat)
static
void CCompareSeqRegions::SelectMatches ( vector< CRef< CCompareFeats > > &  v)
TComparisonOptions& CCompareSeqRegions::SetOptions ( void  )
inline
void CCompareSeqRegions::x_GetPutativeMatches ( vector< CRef< CCompareFeats > > &  v,
CConstRef< CSeq_feat q_feat 
)
private
CConstRef< CSeq_loc > CCompareSeqRegions::x_GetSelfLoc ( const CSeq_loc loc,
CScope scope,
bool  merge_single_range 
)
private

Member Data Documentation

bool CCompareSeqRegions::m_already_processed_unmatched_targets
private

Definition at line 592 of file compare_feats.hpp.

TComparisonOptions CCompareSeqRegions::m_comp_options
private

Definition at line 586 of file compare_feats.hpp.

Referenced by GetOptions(), and SetOptions().

CConstRef<CSeq_loc> CCompareSeqRegions::m_loc_q
private

Definition at line 577 of file compare_feats.hpp.

Referenced by GetQueryLoc().

CFeat_CI CCompareSeqRegions::m_loc_q_ci
private

Definition at line 588 of file compare_feats.hpp.

Referenced by Rewind().

CRef<ILocMapper> CCompareSeqRegions::m_mapper
private

Definition at line 580 of file compare_feats.hpp.

CScope* CCompareSeqRegions::m_scope_q
private

Definition at line 578 of file compare_feats.hpp.

Referenced by CCompareSeqRegions().

CScope* CCompareSeqRegions::m_scope_t
private

Definition at line 579 of file compare_feats.hpp.

Referenced by CCompareSeqRegions().

EScoreMethod CCompareSeqRegions::m_score_method
private

Definition at line 587 of file compare_feats.hpp.

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

Definition at line 589 of file compare_feats.hpp.

Referenced by CCompareSeqRegions(), and Rewind().

const SAnnotSelector& CCompareSeqRegions::m_selector_q
private

Definition at line 581 of file compare_feats.hpp.

const SAnnotSelector& CCompareSeqRegions::m_selector_t
private

Definition at line 582 of file compare_feats.hpp.

CRef<CSeq_loc_Mapper> CCompareSeqRegions::m_self_mapper_q
private

Definition at line 584 of file compare_feats.hpp.

Referenced by CCompareSeqRegions().

CRef<CSeq_loc_Mapper> CCompareSeqRegions::m_self_mapper_t
private

Definition at line 585 of file compare_feats.hpp.

Referenced by CCompareSeqRegions().

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 Fri Sep 22 15:42:09 2017 by modify_doxy.py rev. 546573