NCBI C++ ToolKit
|
Search Toolkit Book for CAlnStats
Helper class which collects seq-align statistics: seq-ids participating in alignments and rows, potential anchors etc. More...
#include <objtools/alnmgr/aln_stats.hpp>
Public Types | |
typedef _TAlnIdVec | TAlnIdVec |
Container with one entry per seq-align using the same indexing as m_AlnVec. More... | |
typedef _TAlnIdVec::TAlnVec | TAlnVec |
Vector of original seq-aligns. More... | |
typedef _TAlnIdVec::TIdVec | TIdVec |
Vector of ids used in all alignments. More... | |
typedef vector< size_t > | TIdxVec |
Vector of indexes in TIdVec. More... | |
typedef map< TAlnSeqIdIRef, TIdxVec, SAlnSeqIdIRefComp > | TIdMap |
Each id mapped to a vector of indexes in TIdVec. More... | |
typedef int | TDim |
typedef vector< TDim > | TRowVec |
Vector, describing how a single id participates in all alignments from TAlnVec. More... | |
typedef vector< TRowVec > | TRowVecVec |
One entry per id (in sync with TIdVec). More... | |
typedef bm::bvector | TBitVec |
Bitmap where each bit indicates an alignment from TAlnVec. More... | |
typedef vector< TBitVec > | TBitVecVec |
One entry per id (in sync with TIdVec). More... | |
![]() | |
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 | |
CAlnStats (const TAlnIdVec &aln_id_vec) | |
Constructor. More... | |
size_t | GetAlnCount (void) const |
How many alignments do we have? More... | |
const TAlnVec & | GetAlnVec (void) const |
Access the underlying vector of alignments. More... | |
TDim | GetDimForAln (size_t aln_idx) const |
What is the dimension of an alignment? More... | |
const TIdVec & | GetSeqIdsForAln (size_t aln_idx) const |
Access the vector of seq-ids of a particular alignment. More... | |
const TIdVec & | GetSeqIdsForAln (const CSeq_align &aln) const |
Access the vector of seq-ids of a particular alignment. More... | |
const TIdVec & | GetAlignedIds (const TAlnSeqIdIRef &id) const |
Get a set of ids that are aligned to a particular id. More... | |
const TRowVecVec & | GetRowVecVec (void) const |
Get vector describing ids usage in each alignment. More... | |
const TIdMap & | GetIdMap (void) const |
Get map of ids to there indexes in TIdVec. More... | |
const TIdVec & | GetIdVec (void) const |
Get vector of all ids from all alignments. More... | |
bool | IsCanonicalQueryAnchored (void) const |
Canonical Query-Anchored: all alignments have 2 or 3 rows and exactly 2 sequences (A and B), A is present on all alignments on row 1, B on rows 2 (and possibly 3). More... | |
bool | IsCanonicalMultiple (void) const |
Canonical Multiple: Single alignment with multiple sequences. More... | |
bool | CanBeAnchored (void) const |
Check if there are any ids which can be used as anchors for the whole set of alignments. More... | |
const TIdMap & | GetAnchorIdMap (void) const |
Get map of potential anchor ids. More... | |
const TIdVec & | GetAnchorIdVec (void) const |
Get vector of potential anchor ids. More... | |
const TIdxVec & | GetAnchorIdxVec (void) const |
Get vector of id indexes (from IdVec) for potential anchors. More... | |
![]() | |
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 |
Private Types | |
typedef map< TAlnSeqIdIRef, TIdVec > | TAlignedIdsMap |
Private Member Functions | |
size_t | x_AddId (const TAlnSeqIdIRef &id, size_t aln_i, size_t row_i) |
void | x_IdentifyPotentialAnchors (void) const |
Additional Inherited Members | |
![]() | |
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) |
![]() | |
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... | |
Helper class which collects seq-align statistics: seq-ids participating in alignments and rows, potential anchors etc.
The class is used to create anchored alignments.
Definition at line 56 of file aln_stats.hpp.
|
private |
Definition at line 380 of file aln_stats.hpp.
Container with one entry per seq-align using the same indexing as m_AlnVec.
Each element is a vector of ids referenced by the seq-align. See CAlnIdMap for an example of the container implementation.
Definition at line 63 of file aln_stats.hpp.
Vector of original seq-aligns.
Definition at line 66 of file aln_stats.hpp.
typedef bm::bvector CAlnStats< _TAlnIdVec >::TBitVec |
Bitmap where each bit indicates an alignment from TAlnVec.
Definition at line 90 of file aln_stats.hpp.
typedef vector<TBitVec> CAlnStats< _TAlnIdVec >::TBitVecVec |
One entry per id (in sync with TIdVec).
Each entry is a bitmap - one bit per alignment, indicating if the id is participating in this alignment.
Definition at line 95 of file aln_stats.hpp.
Definition at line 78 of file aln_stats.hpp.
typedef map<TAlnSeqIdIRef, TIdxVec, SAlnSeqIdIRefComp> CAlnStats< _TAlnIdVec >::TIdMap |
Each id mapped to a vector of indexes in TIdVec.
Definition at line 76 of file aln_stats.hpp.
Vector of ids used in all alignments.
Some ids may be included several times in case of self-aligned sequences.
Definition at line 70 of file aln_stats.hpp.
Vector of indexes in TIdVec.
Definition at line 73 of file aln_stats.hpp.
Vector, describing how a single id participates in all alignments from TAlnVec.
Each element contains row index for the id or -1 if the id is not present in the alignment.
Definition at line 83 of file aln_stats.hpp.
typedef vector<TRowVec> CAlnStats< _TAlnIdVec >::TRowVecVec |
One entry per id (in sync with TIdVec).
Each entry describes how a single id participates in all alignments (see TRowVec).
Definition at line 87 of file aln_stats.hpp.
|
inline |
Constructor.
aln_id_vec | An instance of CAlnIdMap<> containing the alignments to be indexed. |
Definition at line 101 of file aln_stats.hpp.
References _ASSERT, Empty(), map_checker< Container >::end(), first(), map_checker< Container >::insert(), int, map_checker< Container >::lower_bound(), CAlnStats< _TAlnIdVec >::m_AlnCount, CAlnStats< _TAlnIdVec >::m_AlnIdVec, CAlnStats< _TAlnIdVec >::m_AlnVec, CAlnStats< _TAlnIdVec >::m_BitVecVec, CAlnStats< _TAlnIdVec >::m_IdMap, CAlnStats< _TAlnIdVec >::m_RowVecVec, CAlnStats< _TAlnIdVec >::x_AddId(), and CAlnStats< _TAlnIdVec >::x_IdentifyPotentialAnchors().
Check if there are any ids which can be used as anchors for the whole set of alignments.
Definition at line 284 of file aln_stats.hpp.
References CAlnStats< _TAlnIdVec >::m_CanBeAnchored, and CAlnStats< _TAlnIdVec >::x_IdentifyPotentialAnchors().
Referenced by CAlnSpanVertModel::CAlnSpanVertModel(), operator<<(), and CAlnBuildApp::Run().
|
inline |
Get a set of ids that are aligned to a particular id.
Definition at line 178 of file aln_stats.hpp.
References map_checker< Container >::end(), map_checker< Container >::find(), CAlnStats< _TAlnIdVec >::m_AlignedIdsMap, CAlnStats< _TAlnIdVec >::m_AlnCount, CAlnStats< _TAlnIdVec >::m_BitVecVec, CAlnStats< _TAlnIdVec >::m_IdMap, CAlnStats< _TAlnIdVec >::m_IdVec, NCBI_THROW, and bm::bvector< Alloc >::resize().
Referenced by CAlnBuildApp::Run().
|
inline |
How many alignments do we have?
Definition at line 146 of file aln_stats.hpp.
References CAlnStats< _TAlnIdVec >::m_AlnCount.
Referenced by BuildAlignDataSource(), CAlnStats< _TAlnIdVec >::GetDimForAln(), CAlnStats< _TAlnIdVec >::GetSeqIdsForAln(), CAlnStats< _TAlnIdVec >::IsCanonicalMultiple(), and operator<<().
Access the underlying vector of alignments.
Definition at line 152 of file aln_stats.hpp.
References CAlnStats< _TAlnIdVec >::m_AlnVec.
|
inline |
Get map of potential anchor ids.
NOTE: each is is mapped to vector of indexes in IdVec, not AnchorIdVec.
Definition at line 294 of file aln_stats.hpp.
References CAlnStats< _TAlnIdVec >::m_AnchorIdMap, CAlnStats< _TAlnIdVec >::m_CanBeAnchored, and CAlnStats< _TAlnIdVec >::x_IdentifyPotentialAnchors().
Referenced by operator<<().
|
inline |
Get vector of potential anchor ids.
Definition at line 303 of file aln_stats.hpp.
References CAlnStats< _TAlnIdVec >::m_AnchorIdVec, CAlnStats< _TAlnIdVec >::m_CanBeAnchored, and CAlnStats< _TAlnIdVec >::x_IdentifyPotentialAnchors().
Referenced by operator<<(), and CAlnTestApp::Run().
|
inline |
Get vector of id indexes (from IdVec) for potential anchors.
Definition at line 312 of file aln_stats.hpp.
References CAlnStats< _TAlnIdVec >::m_AnchorIdxVec, CAlnStats< _TAlnIdVec >::m_CanBeAnchored, and CAlnStats< _TAlnIdVec >::x_IdentifyPotentialAnchors().
Referenced by operator<<(), and CAlnBuildApp::Run().
|
inline |
What is the dimension of an alignment?
Definition at line 158 of file aln_stats.hpp.
References _ASSERT, CAlnStats< _TAlnIdVec >::GetAlnCount(), CAlnStats< _TAlnIdVec >::m_AlnIdVec, and ncbi::grid::netcache::search::fields::size.
Referenced by operator<<().
Get map of ids to there indexes in TIdVec.
Definition at line 234 of file aln_stats.hpp.
References CAlnStats< _TAlnIdVec >::m_IdMap.
Referenced by operator<<().
Get vector of all ids from all alignments.
Definition at line 241 of file aln_stats.hpp.
References CAlnStats< _TAlnIdVec >::m_IdVec.
Referenced by operator<<(), CAlnBuildApp::Run(), CAlignCleanup::x_Cleanup_AnchoredAln(), and CMergeAlignmentsJob::x_CreateProjectItems().
|
inline |
Get vector describing ids usage in each alignment.
Definition at line 227 of file aln_stats.hpp.
References CAlnStats< _TAlnIdVec >::m_RowVecVec.
|
inline |
Access the vector of seq-ids of a particular alignment.
Definition at line 172 of file aln_stats.hpp.
References CAlnStats< _TAlnIdVec >::m_AlnIdVec.
|
inline |
Access the vector of seq-ids of a particular alignment.
Definition at line 165 of file aln_stats.hpp.
References _ASSERT, CAlnStats< _TAlnIdVec >::GetAlnCount(), and CAlnStats< _TAlnIdVec >::m_AlnIdVec.
Referenced by operator<<().
Canonical Multiple: Single alignment with multiple sequences.
Definition at line 277 of file aln_stats.hpp.
References CAlnStats< _TAlnIdVec >::GetAlnCount(), and CAlnStats< _TAlnIdVec >::IsCanonicalQueryAnchored().
Referenced by operator<<().
|
inline |
Canonical Query-Anchored: all alignments have 2 or 3 rows and exactly 2 sequences (A and B), A is present on all alignments on row 1, B on rows 2 (and possibly 3).
B can be present on 2 rows only if they represent different strands.
Definition at line 250 of file aln_stats.hpp.
References count, CAlnStats< _TAlnIdVec >::m_AlnCount, CAlnStats< _TAlnIdVec >::m_BitVecVec, and CAlnStats< _TAlnIdVec >::m_IdVec.
Referenced by CAlnStats< _TAlnIdVec >::IsCanonicalMultiple(), and operator<<().
|
inlineprivate |
Definition at line 321 of file aln_stats.hpp.
References _ASSERT, int, CAlnStats< _TAlnIdVec >::m_AlnCount, CAlnStats< _TAlnIdVec >::m_BitVecVec, CAlnStats< _TAlnIdVec >::m_IdVec, CAlnStats< _TAlnIdVec >::m_RowVecVec, and bm::bvector< Alloc >::resize().
Referenced by CAlnStats< _TAlnIdVec >::CAlnStats().
|
inlineprivate |
Definition at line 341 of file aln_stats.hpp.
References _ASSERT, count, map_checker< Container >::empty(), map_checker< Container >::end(), first(), map_checker< Container >::insert(), map_checker< Container >::lower_bound(), CAlnStats< _TAlnIdVec >::m_AlnCount, CAlnStats< _TAlnIdVec >::m_AnchorIdMap, CAlnStats< _TAlnIdVec >::m_AnchorIdVec, CAlnStats< _TAlnIdVec >::m_AnchorIdxVec, CAlnStats< _TAlnIdVec >::m_BitVecVec, CAlnStats< _TAlnIdVec >::m_CanBeAnchored, and CAlnStats< _TAlnIdVec >::m_IdVec.
Referenced by CAlnStats< _TAlnIdVec >::CAlnStats(), CAlnStats< _TAlnIdVec >::CanBeAnchored(), CAlnStats< _TAlnIdVec >::GetAnchorIdMap(), CAlnStats< _TAlnIdVec >::GetAnchorIdVec(), and CAlnStats< _TAlnIdVec >::GetAnchorIdxVec().
|
mutableprivate |
Definition at line 381 of file aln_stats.hpp.
Referenced by CAlnStats< _TAlnIdVec >::GetAlignedIds().
|
private |
Definition at line 372 of file aln_stats.hpp.
Referenced by CAlnStats< _TAlnIdVec >::CAlnStats(), CAlnStats< _TAlnIdVec >::GetAlignedIds(), CAlnStats< _TAlnIdVec >::GetAlnCount(), CAlnStats< _TAlnIdVec >::IsCanonicalQueryAnchored(), CAlnStats< _TAlnIdVec >::x_AddId(), and CAlnStats< _TAlnIdVec >::x_IdentifyPotentialAnchors().
Definition at line 370 of file aln_stats.hpp.
Referenced by CAlnStats< _TAlnIdVec >::CAlnStats(), CAlnStats< _TAlnIdVec >::GetDimForAln(), and CAlnStats< _TAlnIdVec >::GetSeqIdsForAln().
Definition at line 371 of file aln_stats.hpp.
Referenced by CAlnStats< _TAlnIdVec >::CAlnStats(), and CAlnStats< _TAlnIdVec >::GetAlnVec().
Definition at line 386 of file aln_stats.hpp.
Referenced by CAlnStats< _TAlnIdVec >::GetAnchorIdMap(), and CAlnStats< _TAlnIdVec >::x_IdentifyPotentialAnchors().
Definition at line 389 of file aln_stats.hpp.
Referenced by CAlnStats< _TAlnIdVec >::GetAnchorIdVec(), and CAlnStats< _TAlnIdVec >::x_IdentifyPotentialAnchors().
Definition at line 382 of file aln_stats.hpp.
Referenced by CAlnStats< _TAlnIdVec >::GetAnchorIdxVec(), and CAlnStats< _TAlnIdVec >::x_IdentifyPotentialAnchors().
|
private |
Definition at line 374 of file aln_stats.hpp.
Referenced by CAlnStats< _TAlnIdVec >::CAlnStats(), CAlnStats< _TAlnIdVec >::GetAlignedIds(), and CAlnStats< _TAlnIdVec >::GetIdMap().
|
private |
Definition at line 377 of file aln_stats.hpp.
Referenced by CAlnStats< _TAlnIdVec >::CAlnStats(), CAlnStats< _TAlnIdVec >::GetRowVecVec(), and CAlnStats< _TAlnIdVec >::x_AddId().