NCBI C++ ToolKit
|
Search Toolkit Book for CCompareSeqRegions
Compare multiple feature annotations on the specified seq_locs. More...
#include <algo/sequence/compare_feats.hpp>
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 |
![]() | |
enum | EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern } |
Control filling of newly allocated memory. More... | |
typedef CObjectCounterLocker | TLockerType |
Default locker type for CRef. More... | |
typedef atomic< Uint8 > | TCounter |
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 () |
TComparisonOptions & | SetOptions () |
TComparisonOptions | GetOptions () const |
const CSeq_loc & | GetQueryLoc () 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) |
![]() | |
CObject (void) | |
Constructor. More... | |
CObject (const CObject &src) | |
Copy constructor. More... | |
virtual | ~CObject (void) |
Destructor. More... | |
CObject & | operator= (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... | |
![]() | |
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 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 void | EnableDebugDump (bool on) |
Private Member Functions | |
void | x_GetPutativeMatches (vector< CRef< CCompareFeats > > &v, CConstRef< CSeq_feat > q_feat) |
CConstRef< CSeq_loc > | x_GetSelfLoc (const CSeq_loc &loc, CScope *scope, bool merge_single_range) |
Additional Inherited Members | |
![]() | |
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... | |
![]() | |
virtual void | DeleteThis (void) |
Virtual method "deleting" this object. More... | |
Compare multiple feature annotations on the specified seq_locs.
Definition at line 487 of file compare_feats.hpp.
Definition at line 504 of file compare_feats.hpp.
Enumerator | |
---|---|
fSelectBest | |
fMergeExons | |
fDifferentGenesOnly | |
fCreateSentinelGenes | |
fSameTypeOnly |
Definition at line 496 of file compare_feats.hpp.
Definition at line 490 of file compare_feats.hpp.
|
inline |
Definition at line 507 of file compare_feats.hpp.
References CSeq_id::Assign(), GetId(), m_scope_q, m_scope_t, m_seen_targets, m_self_mapper_q, m_self_mapper_t, CRef< C, Locker >::Reset(), and CSeq_loc::SetInt().
|
inline |
Definition at line 561 of file compare_feats.hpp.
References m_comp_options.
Referenced by CXcompareAnnotsApplication::x_ProcessComparison().
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, 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().
|
inline |
Definition at line 555 of file compare_feats.hpp.
References m_loc_q_ci, m_seen_targets, and CFeat_CI::Rewind().
Definition at line 661 of file compare_feats.cpp.
References CSeq_feat_Base::CanGetData(), CSeq_id::eContent, CSeq_feat_Base::GetData(), CGene_ref_Base::GetDb(), CSeq_feat_Base::GetDbxref(), CSeqFeatData_Base::GetGene(), CSeq_id::GetLabel(), CGene_ref_Base::GetLocus(), CSeq_feat_Base::GetProduct(), CSeq_loc_Base::GetWhole(), CSeqFeatData_Base::IsGene(), CSeqFeatData_Base::IsRna(), CSeq_feat_Base::IsSetDbxref(), ITERATE, label, NStr::Split(), and NStr::StringToInt().
Referenced by CXcompareAnnotsApplication::x_ProcessComparison().
void CCompareSeqRegions::SelectMatches | ( | vector< CRef< CCompareFeats > > & | v | ) |
Definition at line 1035 of file compare_feats.cpp.
References set< Key, Compare >::end(), ERR_POST, fFGL_Both, set< Key, Compare >::find(), GetLabel(), i, Info(), set< Key, Compare >::insert(), CRef< C, Locker >::IsNull(), CConstRef< C, Locker >::IsNull(), and ITERATE.
|
inline |
Definition at line 560 of file compare_feats.hpp.
References m_comp_options.
|
private |
Definition at line 856 of file compare_feats.cpp.
References _ASSERT, ERR_POST, CSeqFeatData::eSubtype_gene, fDifferentGenesOnly, fFGL_Both, CSeq_loc::fMerge_SingleRange, fSameTypeOnly, CSeq_feat_Base::GetData(), GetLabel(), CSeq_loc::GetLabel(), CSeq_feat_Base::GetLocation(), CSeqFeatData::GetSubtype(), Info(), CRef< C, Locker >::IsNull(), CConstRef< C, Locker >::IsNull(), CCompareSeq_locs::m_scope_t, MSerial_AsnText, NcbiCerr, Seq_loc_Merge(), and CSeqFeatData_Base::Which().
|
private |
Definition at line 943 of file compare_feats.cpp.
References CSeq_loc::fMerge_SingleRange, CRef< C, Locker >::IsNull(), IsOneBioseq(), CSeq_loc_Mapper_Base::Map(), and Seq_loc_Merge().
|
private |
Definition at line 592 of file compare_feats.hpp.
|
private |
Definition at line 586 of file compare_feats.hpp.
Referenced by GetOptions(), and SetOptions().
Definition at line 577 of file compare_feats.hpp.
Referenced by GetQueryLoc().
|
private |
Definition at line 588 of file compare_feats.hpp.
Referenced by Rewind().
|
private |
Definition at line 580 of file compare_feats.hpp.
|
private |
Definition at line 578 of file compare_feats.hpp.
Referenced by CCompareSeqRegions().
|
private |
Definition at line 579 of file compare_feats.hpp.
Referenced by CCompareSeqRegions().
|
private |
Definition at line 587 of file compare_feats.hpp.
|
private |
Definition at line 589 of file compare_feats.hpp.
Referenced by CCompareSeqRegions(), and Rewind().
|
private |
Definition at line 581 of file compare_feats.hpp.
|
private |
Definition at line 582 of file compare_feats.hpp.
|
private |
Definition at line 584 of file compare_feats.hpp.
Referenced by CCompareSeqRegions().
|
private |
Definition at line 585 of file compare_feats.hpp.
Referenced by CCompareSeqRegions().
Definition at line 583 of file compare_feats.hpp.