NCBI C++ ToolKit
|
Search Toolkit Book for CHitMatrixDataSource
#include <gui/widgets/hit_matrix/dense_ds.hpp>
Public Member Functions | |
CHitMatrixDataSource () | |
CHitMatrixDataSource. More... | |
virtual | ~CHitMatrixDataSource () |
IHitMatrixDataSource implementation | |
void | Init (objects::CScope &scope, TAlignVector &aligns) |
virtual bool | CanCreateRowBased () const |
virtual void | SetParams (const SParams ¶ms, bool create_hits) |
virtual void | GetParams (SParams ¶ms) const |
virtual bool | SelectIds (const IHitSeqId &q_id, const IHitSeqId &s_id) |
Creates Hits for all pairwise alignments between selected by Query and Subject IDs. More... | |
virtual bool | SelectDefaultIds () |
selects default query and subject More... | |
virtual const TIdVector & | GetHitSeqIds () |
returns list of all seq ids in the Data Source More... | |
virtual void | GetHitSeqIdsForParams (TIdVector &ids, const SParams ¶ms) const |
returns a list of ids that Data Source will create if the given params are applied. More... | |
virtual void | GetAlignedIds (const IHitSeqId &id, TIdVector &aligned) |
virtual void | GetAlignedIdsForParams (const IHitSeqId &id, const TIdVector &ids, TIdVector &aligned, const SParams ¶ms) |
returns a list of ids that will be aligned with the specified id if the given params are applied. More... | |
virtual objects::CScope & | GetScope () |
virtual IHitSeqId & | GetQueryId () const |
virtual IHitSeqId & | GetSubjectId () const |
virtual objects::CBioseq_Handle | GetQueryHandle () |
virtual objects::CBioseq_Handle | GetSubjectHandle () |
virtual objects::CBioseq_Handle | GetBioseqHandle (const IHitSeqId &id) |
virtual string | GetLabel (const IHitSeqId &id) |
virtual void | GetScoreNames (vector< string > &names) const |
TValueRange | GetScoreRange (const string &name) const |
const THitAdapterCont & | GetHits () const |
TSeqRange | GetQueryHitsRange () |
TSeqRange | GetSubjectHitsRange () |
![]() | |
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 |
![]() | |
virtual | ~IHitMatrixDataSource () |
Protected Types | |
typedef vector< CConstRef< objects::CSeq_id > > | TSeqIdRefVector |
typedef objects::CSeq_align::TSegs::TStd | TStd |
typedef vector< const CSeq_align * > | TAlnPtrVector |
typedef CAlnSeqIdsExtract< CAlnSeqId > | TIdExtract |
typedef CAlnIdMap< TAlnPtrVector, TIdExtract > | TAlnIdMap |
typedef map< string, TValueRange > | TScoreMap |
typedef CSeq_align::TDim | TDim |
typedef const CSeq_id * | TSeqIdPtr |
typedef vector< TSeqIdPtr > | TSeqIdVector |
typedef CAlnStats< TAlnIdMap > | TAlnStats |
typedef set< objects::CBioseq_Handle > | THIdToHandleMap |
Protected Member Functions | |
void | x_TestAndSelectAligns (TAlignVector &aligns) |
void | x_TestAndSelectAlign (const objects::CSeq_align &align) |
bool | x_GoodSeg (const TStd &std_list) |
TSeqRange | GetStdSegRange (const TStd &std_list, size_t row) |
void | x_Clear () |
void | x_ClearHits () |
bool | x_CanCreateRowBased () |
void | x_UpdateScoreMap () |
builds a map of all scores found in the alignments More... | |
void | x_GetSeqAlignIds (const objects::CSeq_align &align, TSeqIdRefVector &ids, bool unique) const |
void | x_GetAlignedSeqIds (const CSeq_align &align, const IHitSeqId &id, TSeqIdRefVector &ids) const |
void | x_CreateIds (TIdVector &seq_ids, const SParams ¶ms) const |
void | x_CreateHits (const objects::CSeq_align &align) |
void | x_CreateHit (const objects::CSeq_align &align, size_t q_index, size_t s_index) |
void | x_CreateHit_Denseg (const objects::CSeq_align &align, size_t q_index, size_t s_index) |
creates a single hit from 2 rows of a Seq-align More... | |
void | x_CreateHit_Std (const objects::CSeq_align &align, size_t q_index, size_t s_index) |
void | x_CreateHits_Diagonal (const objects::CSeq_align &align, size_t q_index, size_t s_index) |
void | x_CalculateHitsRange () |
![]() | |
virtual void | DeleteThis (void) |
Virtual method "deleting" this object. More... | |
Protected Attributes | |
TAlignVector | m_Aligns |
CRef< objects::CScope > | m_Scope |
unique_ptr< TAlnIdMap > | m_AlnIdMap |
CRef< TAlnStats > | m_AlnStats |
bool | m_CanCreateRowBased |
SParams | m_Params |
TIdVector | m_SeqIds |
THIdToHandleMap | m_HIdToHandleMap |
list of Ids for all sequences More... | |
TScoreMap | m_ScoreMap |
unique_ptr< IHitSeqId > | m_SubjectID |
unique_ptr< IHitSeqId > | m_QueryID |
objects::CBioseq_Handle | m_SubjectHandle |
objects::CBioseq_Handle | m_QueryHandle |
THitAdapterCont | m_Hits |
TSeqRange | m_SubjectHitsRange |
TSeqRange | m_QueryHitsRange |
Additional Inherited Members | |
![]() | |
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... | |
![]() | |
typedef vector< CConstRef< objects::CSeq_align > > | TAlignVector |
typedef vector< IHitSeqId * > | TIdVector |
typedef vector< IHit * > | THitAdapterCont |
typedef pair< double, double > | TValueRange |
typedef IHit::TDirection | TDirection |
![]() | |
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... | |
Definition at line 103 of file dense_ds.hpp.
|
protected |
Definition at line 158 of file dense_ds.hpp.
|
protected |
Definition at line 156 of file dense_ds.hpp.
|
protected |
Definition at line 198 of file dense_ds.hpp.
|
protected |
Definition at line 195 of file dense_ds.hpp.
|
protected |
Definition at line 199 of file dense_ds.hpp.
|
protected |
Definition at line 157 of file dense_ds.hpp.
|
protected |
Definition at line 194 of file dense_ds.hpp.
|
protected |
Definition at line 196 of file dense_ds.hpp.
|
protected |
Definition at line 153 of file dense_ds.hpp.
|
protected |
Definition at line 197 of file dense_ds.hpp.
|
protected |
Definition at line 154 of file dense_ds.hpp.
CHitMatrixDataSource::CHitMatrixDataSource | ( | ) |
Definition at line 115 of file dense_ds.cpp.
References CAlnUserOptions::eBothDirections, IHitMatrixDataSource::SParams::m_Direction, and m_Params.
|
virtual |
Definition at line 121 of file dense_ds.cpp.
References x_Clear().
|
virtual |
Implements IHitMatrixDataSource.
Definition at line 343 of file dense_ds.cpp.
References m_CanCreateRowBased.
Implements IHitMatrixDataSource.
Definition at line 571 of file dense_ds.cpp.
References GetAlignedIdsForParams(), m_Params, and m_SeqIds.
|
virtual |
returns a list of ids that will be aligned with the specified id if the given params are applied.
Implements IHitMatrixDataSource.
Definition at line 578 of file dense_ds.cpp.
References _ASSERT, find_id(), GetSeqId(), IAlnSeqId::GetSeqId(), ITERATE, m_AlnStats, and IHitMatrixDataSource::SParams::m_RowBased.
Referenced by GetAlignedIds().
|
virtual |
Implements IHitMatrixDataSource.
Definition at line 880 of file dense_ds.cpp.
|
virtual |
|
virtual |
returns list of all seq ids in the Data Source
Implements IHitMatrixDataSource.
Definition at line 549 of file dense_ds.cpp.
References m_SeqIds.
|
virtual |
returns a list of ids that Data Source will create if the given params are applied.
The caller is responsible for deleting ids.
Implements IHitMatrixDataSource.
Definition at line 555 of file dense_ds.cpp.
References i, m_Params, m_SeqIds, and x_CreateIds().
Implements IHitMatrixDataSource.
Definition at line 892 of file dense_ds.cpp.
References _ASSERT, CLabel::eDefault, CLabel::GetLabel(), CRef< C, Locker >::GetPointer(), CHitSeqRowId::GetRow(), GetSeqId(), NStr::IntToString(), and m_Scope.
|
virtual |
|
virtual |
Implements IHitMatrixDataSource.
Definition at line 868 of file dense_ds.cpp.
References m_QueryHandle.
|
virtual |
Implements IHitMatrixDataSource.
Definition at line 929 of file dense_ds.cpp.
References m_QueryHitsRange.
|
virtual |
|
virtual |
Implements IHitMatrixDataSource.
Definition at line 850 of file dense_ds.cpp.
References CRef< C, Locker >::GetObject(), and m_Scope.
|
virtual |
Implements IHitMatrixDataSource.
Definition at line 912 of file dense_ds.cpp.
References ITERATE, m_ScoreMap, and names.
|
virtual |
Implements IHitMatrixDataSource.
Definition at line 921 of file dense_ds.cpp.
References _ASSERT, map_checker< Container >::end(), map_checker< Container >::find(), and m_ScoreMap.
Definition at line 769 of file dense_ds.cpp.
References COpenRange< TSeqPos >::GetEmpty(), CStd_seg::GetSeqStart(), CStd_seg::GetSeqStop(), ITERATE, r(), compile_time_bits::range(), and row.
|
virtual |
Implements IHitMatrixDataSource.
Definition at line 874 of file dense_ds.cpp.
References m_SubjectHandle.
|
virtual |
Implements IHitMatrixDataSource.
Definition at line 935 of file dense_ds.cpp.
References m_SubjectHitsRange.
|
virtual |
Implements IHitMatrixDataSource.
Definition at line 862 of file dense_ds.cpp.
References m_SubjectID.
|
virtual |
Implements IHitMatrixDataSource.
Definition at line 180 of file dense_ds.cpp.
References m_CanCreateRowBased, m_Params, IHitMatrixDataSource::SParams::m_RowBased, m_Scope, m_SeqIds, CRef< C, Locker >::Reset(), x_CanCreateRowBased(), x_Clear(), x_CreateIds(), x_TestAndSelectAligns(), and x_UpdateScoreMap().
|
virtual |
selects default query and subject
Implements IHitMatrixDataSource.
Definition at line 635 of file dense_ds.cpp.
References m_SeqIds, and SelectIds().
Creates Hits for all pairwise alignments between selected by Query and Subject IDs.
Implements IHitMatrixDataSource.
Definition at line 646 of file dense_ds.cpp.
References IHitSeqId::Clone(), find_id(), ITERATE, m_Aligns, m_QueryHandle, m_QueryID, m_Scope, m_SeqIds, m_SubjectHandle, m_SubjectID, x_CalculateHitsRange(), x_ClearHits(), and x_CreateHits().
Referenced by SelectDefaultIds(), and SetParams().
Implements IHitMatrixDataSource.
Definition at line 308 of file dense_ds.cpp.
References _ASSERT, m_CanCreateRowBased, IHitMatrixDataSource::SParams::m_Direction, m_Params, m_QueryID, IHitMatrixDataSource::SParams::m_RowBased, m_SeqIds, m_SubjectID, SelectIds(), x_ClearHits(), and x_CreateIds().
|
protected |
Definition at line 820 of file dense_ds.cpp.
References COpenRange< Position >::Empty(), IHit::GetElem(), IHit::GetElemsCount(), IHitElement::GetQueryLength(), IHitElement::GetQueryStart(), IHitElement::GetSubjectLength(), IHitElement::GetSubjectStart(), i, m_Hits, m_QueryHitsRange, m_SubjectHitsRange, and COpenRange< Position >::Set().
Referenced by SelectIds().
|
protected |
Definition at line 290 of file dense_ds.cpp.
References i, m_AlnIdMap, and NULL.
Referenced by Init().
|
protected |
Definition at line 146 of file dense_ds.cpp.
References map_checker< Container >::clear(), set< Key, Compare >::clear(), ITERATE, m_Aligns, m_AlnIdMap, m_AlnStats, m_CanCreateRowBased, m_HIdToHandleMap, m_Scope, m_ScoreMap, m_SeqIds, CRef< C, Locker >::Reset(), and x_ClearHits().
Referenced by Init(), and ~CHitMatrixDataSource().
|
protected |
Definition at line 127 of file dense_ds.cpp.
References COpenRange< TSeqPos >::GetEmpty(), ITERATE, m_Hits, m_QueryHandle, m_QueryHitsRange, m_QueryID, m_SubjectHandle, m_SubjectHitsRange, and m_SubjectID.
Referenced by SelectIds(), SetParams(), and x_Clear().
|
protected |
Definition at line 727 of file dense_ds.cpp.
References CSeq_align_Base::GetSegs(), Info(), CSeq_align_Base::IsSetSegs(), LOG_POST, CSeq_align_Base::C_Segs::Which(), x_CreateHit_Std(), and x_CreateHits_Diagonal().
Referenced by x_CreateHits().
|
protected |
creates a single hit from 2 rows of a Seq-align
Definition at line 755 of file dense_ds.cpp.
References _ASSERT, CSeq_align_Base::C_Segs::GetDenseg(), CSeq_align_Base::GetSegs(), CDenseSegHit::HasAlignment(), CSeq_align_Base::C_Segs::IsDenseg(), IHitMatrixDataSource::SParams::m_Direction, m_Hits, and m_Params.
|
protected |
Definition at line 787 of file dense_ds.cpp.
References _ASSERT, CSeq_align_Base::GetSegs(), CSeq_align_Base::C_Segs::GetStd(), CStdSegHit::HasAlignment(), CSeq_align_Base::C_Segs::IsStd(), IHitMatrixDataSource::SParams::m_Direction, m_Hits, and m_Params.
Referenced by x_CreateHit().
|
protected |
Definition at line 678 of file dense_ds.cpp.
References _ASSERT, CHitSeqRowId::GetRow(), i, CSeq_align_Base::IsSetSegs(), m_Params, m_QueryID, IHitMatrixDataSource::SParams::m_RowBased, m_SubjectID, x_CreateHit(), and x_GetSeqAlignIds().
Referenced by SelectIds().
|
protected |
Definition at line 803 of file dense_ds.cpp.
References ConvertSeqAlignToPairwiseAln(), IHitMatrixDataSource::SParams::m_Direction, m_Hits, and m_Params.
Referenced by x_CreateHit().
|
protected |
Definition at line 503 of file dense_ds.cpp.
References CScope::GetBioseqHandle(), CRef< C, Locker >::GetObject(), i, set< Key, Compare >::insert(), ITERATE, m_Aligns, m_HIdToHandleMap, IHitMatrixDataSource::SParams::m_RowBased, m_Scope, m_SeqIds, row, and x_GetSeqAlignIds().
Referenced by GetHitSeqIdsForParams(), Init(), and SetParams().
|
protected |
Definition at line 423 of file dense_ds.cpp.
References _ASSERT, CSeq_align_Base::CanGetSegs(), CSeq_align_Base::GetSegs(), IAlnSeqId::GetSeqId(), ITERATE, and CSeq_align_Base::C_Segs::Which().
|
protected |
Definition at line 468 of file dense_ds.cpp.
References _ASSERT, CSeq_align_Base::CanGetSegs(), CSeq_align_Base::GetSegs(), IAlnSeqId::GetSeqId(), ITERATE, and CSeq_align_Base::C_Segs::Which().
Referenced by x_CreateHits(), and x_CreateIds().
Definition at line 270 of file dense_ds.cpp.
References eNa_strand_minus, eNa_strand_plus, eNa_strand_unknown, CStd_seg_Base::GetLoc(), CSeq_loc::GetStrand(), Info(), ITERATE, and LOG_POST.
Referenced by x_TestAndSelectAlign().
|
protected |
Definition at line 215 of file dense_ds.cpp.
References ERR_POST, CSeq_align_set_Base::Get(), CSeq_align_Base::C_Segs::GetDisc(), CSeq_align_Base::GetSegs(), CSeq_align_Base::C_Segs::GetStd(), ITERATE, m_Aligns, m_AlnIdMap, CSeq_align_Base::C_Segs::Which(), and x_GoodSeg().
Referenced by x_TestAndSelectAligns().
|
protected |
Definition at line 256 of file dense_ds.cpp.
References ITERATE, m_AlnIdMap, m_AlnStats, and x_TestAndSelectAlign().
Referenced by Init().
|
protected |
builds a map of all scores found in the alignments
Definition at line 356 of file dense_ds.cpp.
References _ASSERT, CScore_Base::CanGetId(), CSeq_align_Base::CanGetSegs(), CScore_Base::C_Value::e_Int, CScore_Base::C_Value::e_Real, map_checker< Container >::end(), map_checker< Container >::find(), CScore_Base::GetId(), CSeq_align_Base::GetScore(), CScore_Base::GetValue(), i, ITERATE, m_Aligns, m_ScoreMap, max(), min(), compile_time_bits::range(), val, and rapidjson::value.
Referenced by Init().
|
protected |
Definition at line 201 of file dense_ds.hpp.
Referenced by SelectIds(), x_Clear(), x_CreateIds(), x_TestAndSelectAlign(), and x_UpdateScoreMap().
|
protected |
Definition at line 204 of file dense_ds.hpp.
Referenced by x_CanCreateRowBased(), x_Clear(), x_TestAndSelectAlign(), and x_TestAndSelectAligns().
Definition at line 205 of file dense_ds.hpp.
Referenced by GetAlignedIdsForParams(), x_Clear(), and x_TestAndSelectAligns().
|
protected |
Definition at line 208 of file dense_ds.hpp.
Referenced by CanCreateRowBased(), Init(), SetParams(), and x_Clear().
|
mutableprotected |
list of Ids for all sequences
Definition at line 212 of file dense_ds.hpp.
Referenced by x_Clear(), and x_CreateIds().
|
protected |
Definition at line 221 of file dense_ds.hpp.
Referenced by GetHits(), x_CalculateHitsRange(), x_ClearHits(), x_CreateHit_Denseg(), x_CreateHit_Std(), and x_CreateHits_Diagonal().
|
protected |
Definition at line 209 of file dense_ds.hpp.
Referenced by CHitMatrixDataSource(), GetAlignedIds(), GetHitSeqIdsForParams(), GetParams(), Init(), SetParams(), x_CreateHit_Denseg(), x_CreateHit_Std(), x_CreateHits(), and x_CreateHits_Diagonal().
|
protected |
Definition at line 219 of file dense_ds.hpp.
Referenced by GetQueryHandle(), SelectIds(), and x_ClearHits().
|
protected |
Definition at line 224 of file dense_ds.hpp.
Referenced by GetQueryHitsRange(), x_CalculateHitsRange(), and x_ClearHits().
|
protected |
Definition at line 216 of file dense_ds.hpp.
Referenced by GetQueryId(), SelectIds(), SetParams(), x_ClearHits(), and x_CreateHits().
|
protected |
Definition at line 202 of file dense_ds.hpp.
Referenced by GetBioseqHandle(), GetLabel(), GetScope(), Init(), SelectIds(), x_Clear(), and x_CreateIds().
|
protected |
Definition at line 213 of file dense_ds.hpp.
Referenced by GetScoreNames(), GetScoreRange(), x_Clear(), and x_UpdateScoreMap().
|
protected |
Definition at line 211 of file dense_ds.hpp.
Referenced by GetAlignedIds(), GetHitSeqIds(), GetHitSeqIdsForParams(), Init(), SelectDefaultIds(), SelectIds(), SetParams(), x_Clear(), and x_CreateIds().
|
protected |
Definition at line 218 of file dense_ds.hpp.
Referenced by GetSubjectHandle(), SelectIds(), and x_ClearHits().
|
protected |
Definition at line 223 of file dense_ds.hpp.
Referenced by GetSubjectHitsRange(), x_CalculateHitsRange(), and x_ClearHits().
|
protected |
Definition at line 215 of file dense_ds.hpp.
Referenced by GetSubjectId(), SelectIds(), SetParams(), x_ClearHits(), and x_CreateHits().