NCBI C++ ToolKit
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
CHitMatrixDataSource Class Reference

Search Toolkit Book for CHitMatrixDataSource

CHitMatrixDataSource. More...

#include <gui/widgets/hit_matrix/dense_ds.hpp>

+ Inheritance diagram for CHitMatrixDataSource:
+ Collaboration diagram for CHitMatrixDataSource:

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 &params, bool create_hits)
 
virtual void GetParams (SParams &params) 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 TIdVectorGetHitSeqIds ()
 returns list of all seq ids in the Data Source More...
 
virtual void GetHitSeqIdsForParams (TIdVector &ids, const SParams &params) const
 
virtual void GetAlignedIds (const IHitSeqId &id, TIdVector &aligned)
 
virtual void GetAlignedIdsForParams (const IHitSeqId &id, const TIdVector &ids, TIdVector &aligned, const SParams &params)
 
virtual objects::CScope & GetScope ()
 
virtual IHitSeqIdGetQueryId () const
 
virtual IHitSeqIdGetSubjectId () 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 THitAdapterContGetHits () const
 
TSeqRange GetQueryHitsRange ()
 
TSeqRange GetSubjectHitsRange ()
 
- 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
 
- Public Member Functions inherited from IHitMatrixDataSource
virtual ~IHitMatrixDataSource ()
 
virtual void SetParams (const SParams &params, bool create_hits)=0
 
virtual void GetParams (SParams &params) const =0
 
virtual void GetHitSeqIdsForParams (TIdVector &ids, const SParams &params) const =0
 returns a list of ids that Data Source will create if the given params are applied. More...
 
virtual void GetAlignedIdsForParams (const IHitSeqId &id, const TIdVector &ids, TIdVector &aligned, const SParams &params)=0
 returns a list of ids that will be aligned with the specified id if the given params are applied. More...
 

Protected Types

typedef vector< CConstRef< objects::CSeq_id > > TSeqIdRefVector
 
typedef objects::CSeq_align::TSegs::TStd TStd
 
typedef vector< const CSeq_align * > TAlnPtrVector
 
typedef CAlnSeqIdsExtract< CAlnSeqIdTIdExtract
 
typedef CAlnIdMap< TAlnPtrVector, TIdExtractTAlnIdMap
 
typedef map< string, TValueRangeTScoreMap
 
typedef CSeq_align::TDim TDim
 
typedef const CSeq_idTSeqIdPtr
 
typedef vector< TSeqIdPtrTSeqIdVector
 
typedef CAlnStats< TAlnIdMapTAlnStats
 
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 &params) 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 ()
 
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
 

Protected Attributes

TAlignVector m_Aligns
 
CRef< objects::CScope > m_Scope
 
auto_ptr< TAlnIdMapm_AlnIdMap
 
CRef< TAlnStatsm_AlnStats
 
bool m_CanCreateRowBased
 
SParams m_Params
 
TIdVector m_SeqIds
 
THIdToHandleMap m_HIdToHandleMap
 list of Ids for all sequences More...
 
TScoreMap m_ScoreMap
 
auto_ptr< IHitSeqIdm_SubjectID
 
auto_ptr< IHitSeqIdm_QueryID
 
objects::CBioseq_Handle m_SubjectHandle
 
objects::CBioseq_Handle m_QueryHandle
 
THitAdapterCont m_Hits
 
TSeqRange m_SubjectHitsRange
 
TSeqRange m_QueryHitsRange
 

Additional Inherited Members

- 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 Types inherited from IHitMatrixDataSource
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 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)
 
- 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...
 

Detailed Description

CHitMatrixDataSource.

Definition at line 103 of file dense_ds.hpp.

Member Typedef Documentation

Definition at line 158 of file dense_ds.hpp.

Definition at line 156 of file dense_ds.hpp.

Definition at line 198 of file dense_ds.hpp.

Definition at line 195 of file dense_ds.hpp.

typedef set<objects::CBioseq_Handle> CHitMatrixDataSource::THIdToHandleMap
protected

Definition at line 199 of file dense_ds.hpp.

Definition at line 157 of file dense_ds.hpp.

Definition at line 194 of file dense_ds.hpp.

Definition at line 196 of file dense_ds.hpp.

typedef vector<CConstRef<objects::CSeq_id> > CHitMatrixDataSource::TSeqIdRefVector
protected

Definition at line 153 of file dense_ds.hpp.

typedef vector<TSeqIdPtr> CHitMatrixDataSource::TSeqIdVector
protected

Definition at line 197 of file dense_ds.hpp.

typedef objects::CSeq_align::TSegs::TStd CHitMatrixDataSource::TStd
protected

Definition at line 154 of file dense_ds.hpp.

Constructor & Destructor Documentation

CHitMatrixDataSource::CHitMatrixDataSource ( )
CHitMatrixDataSource::~CHitMatrixDataSource ( )
virtual

Definition at line 121 of file dense_ds.cpp.

References x_Clear().

Member Function Documentation

bool CHitMatrixDataSource::CanCreateRowBased ( ) const
virtual

Implements IHitMatrixDataSource.

Definition at line 343 of file dense_ds.cpp.

References m_CanCreateRowBased.

void CHitMatrixDataSource::GetAlignedIds ( const IHitSeqId id,
TIdVector aligned 
)
virtual

Implements IHitMatrixDataSource.

Definition at line 571 of file dense_ds.cpp.

References GetAlignedIdsForParams(), m_Params, and m_SeqIds.

void CHitMatrixDataSource::GetAlignedIdsForParams ( const IHitSeqId id,
const TIdVector ids,
TIdVector aligned,
const SParams params 
)
virtual
CBioseq_Handle CHitMatrixDataSource::GetBioseqHandle ( const IHitSeqId id)
virtual

Implements IHitMatrixDataSource.

Definition at line 880 of file dense_ds.cpp.

References _ASSERT, and m_Scope.

const CHitMatrixDataSource::THitAdapterCont & CHitMatrixDataSource::GetHits ( ) const
virtual

Implements IHitMatrixDataSource.

Definition at line 906 of file dense_ds.cpp.

References m_Hits.

const CHitMatrixDataSource::TIdVector & CHitMatrixDataSource::GetHitSeqIds ( )
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.

void CHitMatrixDataSource::GetHitSeqIdsForParams ( TIdVector ids,
const SParams params 
) const
virtual

Definition at line 555 of file dense_ds.cpp.

References i, m_Params, m_SeqIds, and x_CreateIds().

string CHitMatrixDataSource::GetLabel ( const IHitSeqId id)
virtual
void CHitMatrixDataSource::GetParams ( SParams params) const
virtual

Definition at line 349 of file dense_ds.cpp.

References m_Params.

CBioseq_Handle CHitMatrixDataSource::GetQueryHandle ( )
virtual

Implements IHitMatrixDataSource.

Definition at line 868 of file dense_ds.cpp.

References m_QueryHandle.

TSeqRange CHitMatrixDataSource::GetQueryHitsRange ( )
virtual

Implements IHitMatrixDataSource.

Definition at line 929 of file dense_ds.cpp.

References m_QueryHitsRange.

IHitSeqId & CHitMatrixDataSource::GetQueryId ( void  ) const
virtual

Implements IHitMatrixDataSource.

Definition at line 856 of file dense_ds.cpp.

References m_QueryID.

CScope & CHitMatrixDataSource::GetScope ( void  )
virtual

Implements IHitMatrixDataSource.

Definition at line 850 of file dense_ds.cpp.

References CRef< C, Locker >::GetObject(), and m_Scope.

void CHitMatrixDataSource::GetScoreNames ( vector< string > &  names) const
virtual

Implements IHitMatrixDataSource.

Definition at line 912 of file dense_ds.cpp.

References ITERATE, and m_ScoreMap.

CHitMatrixDataSource::TValueRange CHitMatrixDataSource::GetScoreRange ( const string name) const
virtual
TSeqRange CHitMatrixDataSource::GetStdSegRange ( const TStd std_list,
size_t  row 
)
protected
CBioseq_Handle CHitMatrixDataSource::GetSubjectHandle ( )
virtual

Implements IHitMatrixDataSource.

Definition at line 874 of file dense_ds.cpp.

References m_SubjectHandle.

TSeqRange CHitMatrixDataSource::GetSubjectHitsRange ( )
virtual

Implements IHitMatrixDataSource.

Definition at line 935 of file dense_ds.cpp.

References m_SubjectHitsRange.

IHitSeqId & CHitMatrixDataSource::GetSubjectId ( ) const
virtual

Implements IHitMatrixDataSource.

Definition at line 862 of file dense_ds.cpp.

References m_SubjectID.

void CHitMatrixDataSource::Init ( objects::CScope &  scope,
TAlignVector aligns 
)
virtual
bool CHitMatrixDataSource::SelectDefaultIds ( )
virtual

selects default query and subject

Implements IHitMatrixDataSource.

Definition at line 635 of file dense_ds.cpp.

References m_SeqIds, and SelectIds().

bool CHitMatrixDataSource::SelectIds ( const IHitSeqId q_id,
const IHitSeqId s_id 
)
virtual

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

void CHitMatrixDataSource::SetParams ( const SParams params,
bool  create_hits 
)
virtual
void CHitMatrixDataSource::x_CalculateHitsRange ( )
protected
bool CHitMatrixDataSource::x_CanCreateRowBased ( )
protected

Definition at line 290 of file dense_ds.cpp.

References i, m_AlnIdMap, and NULL.

Referenced by Init().

void CHitMatrixDataSource::x_Clear ( void  )
protected
void CHitMatrixDataSource::x_ClearHits ( )
protected
void CHitMatrixDataSource::x_CreateHit ( const objects::CSeq_align &  align,
size_t  q_index,
size_t  s_index 
)
protected
void CHitMatrixDataSource::x_CreateHit_Denseg ( const objects::CSeq_align &  align,
size_t  q_index,
size_t  s_index 
)
protected
void CHitMatrixDataSource::x_CreateHit_Std ( const objects::CSeq_align &  align,
size_t  q_index,
size_t  s_index 
)
protected
void CHitMatrixDataSource::x_CreateHits ( const objects::CSeq_align &  align)
protected
void CHitMatrixDataSource::x_CreateHits_Diagonal ( const objects::CSeq_align &  align,
size_t  q_index,
size_t  s_index 
)
protected
void CHitMatrixDataSource::x_CreateIds ( TIdVector seq_ids,
const SParams params 
) const
protected
void CHitMatrixDataSource::x_GetAlignedSeqIds ( const CSeq_align align,
const IHitSeqId id,
TSeqIdRefVector ids 
) const
protected
void CHitMatrixDataSource::x_GetSeqAlignIds ( const objects::CSeq_align &  align,
TSeqIdRefVector ids,
bool  unique 
) const
protected
bool CHitMatrixDataSource::x_GoodSeg ( const TStd std_list)
protected
void CHitMatrixDataSource::x_TestAndSelectAlign ( const objects::CSeq_align &  align)
protected
void CHitMatrixDataSource::x_TestAndSelectAligns ( TAlignVector aligns)
protected

Definition at line 256 of file dense_ds.cpp.

References ITERATE, m_AlnIdMap, m_AlnStats, and x_TestAndSelectAlign().

Referenced by Init().

void CHitMatrixDataSource::x_UpdateScoreMap ( )
protected

Member Data Documentation

TAlignVector CHitMatrixDataSource::m_Aligns
protected

Definition at line 201 of file dense_ds.hpp.

Referenced by SelectIds(), x_Clear(), x_CreateIds(), x_TestAndSelectAlign(), and x_UpdateScoreMap().

auto_ptr<TAlnIdMap> CHitMatrixDataSource::m_AlnIdMap
protected
CRef<TAlnStats> CHitMatrixDataSource::m_AlnStats
protected

Definition at line 205 of file dense_ds.hpp.

Referenced by GetAlignedIdsForParams(), x_Clear(), and x_TestAndSelectAligns().

bool CHitMatrixDataSource::m_CanCreateRowBased
protected

Definition at line 208 of file dense_ds.hpp.

Referenced by CanCreateRowBased(), Init(), SetParams(), and x_Clear().

THIdToHandleMap CHitMatrixDataSource::m_HIdToHandleMap
mutableprotected

list of Ids for all sequences

Definition at line 212 of file dense_ds.hpp.

Referenced by x_Clear(), and x_CreateIds().

THitAdapterCont CHitMatrixDataSource::m_Hits
protected
SParams CHitMatrixDataSource::m_Params
protected
objects::CBioseq_Handle CHitMatrixDataSource::m_QueryHandle
protected

Definition at line 219 of file dense_ds.hpp.

Referenced by GetQueryHandle(), SelectIds(), and x_ClearHits().

TSeqRange CHitMatrixDataSource::m_QueryHitsRange
protected

Definition at line 224 of file dense_ds.hpp.

Referenced by GetQueryHitsRange(), x_CalculateHitsRange(), and x_ClearHits().

auto_ptr<IHitSeqId> CHitMatrixDataSource::m_QueryID
protected

Definition at line 216 of file dense_ds.hpp.

Referenced by GetQueryId(), SelectIds(), SetParams(), x_ClearHits(), and x_CreateHits().

CRef<objects::CScope> CHitMatrixDataSource::m_Scope
protected

Definition at line 202 of file dense_ds.hpp.

Referenced by GetBioseqHandle(), GetLabel(), GetScope(), Init(), SelectIds(), x_Clear(), and x_CreateIds().

TScoreMap CHitMatrixDataSource::m_ScoreMap
protected

Definition at line 213 of file dense_ds.hpp.

Referenced by GetScoreNames(), GetScoreRange(), x_Clear(), and x_UpdateScoreMap().

TIdVector CHitMatrixDataSource::m_SeqIds
protected
objects::CBioseq_Handle CHitMatrixDataSource::m_SubjectHandle
protected

Definition at line 218 of file dense_ds.hpp.

Referenced by GetSubjectHandle(), SelectIds(), and x_ClearHits().

TSeqRange CHitMatrixDataSource::m_SubjectHitsRange
protected

Definition at line 223 of file dense_ds.hpp.

Referenced by GetSubjectHitsRange(), x_CalculateHitsRange(), and x_ClearHits().

auto_ptr<IHitSeqId> CHitMatrixDataSource::m_SubjectID
protected

Definition at line 215 of file dense_ds.hpp.

Referenced by GetSubjectId(), SelectIds(), SetParams(), x_ClearHits(), and x_CreateHits().


The documentation for this class was generated from the following files:
Modified on Sun Jun 25 17:49:45 2017 by modify_doxy.py rev. 533848