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
 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 &params)
 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 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 ()
 

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
 
unique_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
 
unique_ptr< IHitSeqIdm_SubjectID
 
unique_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 atomic< Uint8TCounter
 Counter type is CAtomiCounter. More...
 
typedef Uint8 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_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 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

◆ TAlnIdMap

Definition at line 158 of file dense_ds.hpp.

◆ TAlnPtrVector

Definition at line 156 of file dense_ds.hpp.

◆ TAlnStats

Definition at line 198 of file dense_ds.hpp.

◆ TDim

Definition at line 195 of file dense_ds.hpp.

◆ THIdToHandleMap

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

Definition at line 199 of file dense_ds.hpp.

◆ TIdExtract

Definition at line 157 of file dense_ds.hpp.

◆ TScoreMap

Definition at line 194 of file dense_ds.hpp.

◆ TSeqIdPtr

Definition at line 196 of file dense_ds.hpp.

◆ TSeqIdRefVector

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

Definition at line 153 of file dense_ds.hpp.

◆ TSeqIdVector

typedef vector<TSeqIdPtr> CHitMatrixDataSource::TSeqIdVector
protected

Definition at line 197 of file dense_ds.hpp.

◆ TStd

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

CHitMatrixDataSource::~CHitMatrixDataSource ( )
virtual

Definition at line 121 of file dense_ds.cpp.

References x_Clear().

Member Function Documentation

◆ CanCreateRowBased()

bool CHitMatrixDataSource::CanCreateRowBased ( ) const
virtual

Implements IHitMatrixDataSource.

Definition at line 343 of file dense_ds.cpp.

References m_CanCreateRowBased.

◆ GetAlignedIds()

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.

◆ GetAlignedIdsForParams()

void CHitMatrixDataSource::GetAlignedIdsForParams ( const IHitSeqId id,
const TIdVector ids,
TIdVector aligned,
const SParams params 
)
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().

◆ GetBioseqHandle()

CBioseq_Handle CHitMatrixDataSource::GetBioseqHandle ( const IHitSeqId id)
virtual

Implements IHitMatrixDataSource.

Definition at line 880 of file dense_ds.cpp.

References _ASSERT, and m_Scope.

◆ GetHits()

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

Implements IHitMatrixDataSource.

Definition at line 906 of file dense_ds.cpp.

References m_Hits.

◆ GetHitSeqIds()

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.

◆ GetHitSeqIdsForParams()

void CHitMatrixDataSource::GetHitSeqIdsForParams ( TIdVector ids,
const SParams params 
) const
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().

◆ GetLabel()

string CHitMatrixDataSource::GetLabel ( const IHitSeqId id)
virtual

◆ GetParams()

void CHitMatrixDataSource::GetParams ( SParams params) const
virtual

Implements IHitMatrixDataSource.

Definition at line 349 of file dense_ds.cpp.

References m_Params.

◆ GetQueryHandle()

CBioseq_Handle CHitMatrixDataSource::GetQueryHandle ( )
virtual

Implements IHitMatrixDataSource.

Definition at line 868 of file dense_ds.cpp.

References m_QueryHandle.

◆ GetQueryHitsRange()

TSeqRange CHitMatrixDataSource::GetQueryHitsRange ( )
virtual

Implements IHitMatrixDataSource.

Definition at line 929 of file dense_ds.cpp.

References m_QueryHitsRange.

◆ GetQueryId()

IHitSeqId & CHitMatrixDataSource::GetQueryId ( void  ) const
virtual

Implements IHitMatrixDataSource.

Definition at line 856 of file dense_ds.cpp.

References m_QueryID.

◆ GetScope()

CScope & CHitMatrixDataSource::GetScope ( void  )
virtual

Implements IHitMatrixDataSource.

Definition at line 850 of file dense_ds.cpp.

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

◆ GetScoreNames()

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

Implements IHitMatrixDataSource.

Definition at line 912 of file dense_ds.cpp.

References ITERATE, m_ScoreMap, and names.

◆ GetScoreRange()

CHitMatrixDataSource::TValueRange CHitMatrixDataSource::GetScoreRange ( const string name) const
virtual

◆ GetStdSegRange()

TSeqRange CHitMatrixDataSource::GetStdSegRange ( const TStd std_list,
size_t  row 
)
protected

◆ GetSubjectHandle()

CBioseq_Handle CHitMatrixDataSource::GetSubjectHandle ( )
virtual

Implements IHitMatrixDataSource.

Definition at line 874 of file dense_ds.cpp.

References m_SubjectHandle.

◆ GetSubjectHitsRange()

TSeqRange CHitMatrixDataSource::GetSubjectHitsRange ( )
virtual

Implements IHitMatrixDataSource.

Definition at line 935 of file dense_ds.cpp.

References m_SubjectHitsRange.

◆ GetSubjectId()

IHitSeqId & CHitMatrixDataSource::GetSubjectId ( ) const
virtual

Implements IHitMatrixDataSource.

Definition at line 862 of file dense_ds.cpp.

References m_SubjectID.

◆ Init()

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

◆ SelectDefaultIds()

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

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

◆ SetParams()

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

◆ x_CalculateHitsRange()

void CHitMatrixDataSource::x_CalculateHitsRange ( )
protected

◆ x_CanCreateRowBased()

bool CHitMatrixDataSource::x_CanCreateRowBased ( )
protected

Definition at line 290 of file dense_ds.cpp.

References i, m_AlnIdMap, and NULL.

Referenced by Init().

◆ x_Clear()

void CHitMatrixDataSource::x_Clear ( void  )
protected

◆ x_ClearHits()

void CHitMatrixDataSource::x_ClearHits ( )
protected

◆ x_CreateHit()

void CHitMatrixDataSource::x_CreateHit ( const objects::CSeq_align &  align,
size_t  q_index,
size_t  s_index 
)
protected

◆ x_CreateHit_Denseg()

void CHitMatrixDataSource::x_CreateHit_Denseg ( const objects::CSeq_align &  align,
size_t  q_index,
size_t  s_index 
)
protected

◆ x_CreateHit_Std()

void CHitMatrixDataSource::x_CreateHit_Std ( const objects::CSeq_align &  align,
size_t  q_index,
size_t  s_index 
)
protected

◆ x_CreateHits()

void CHitMatrixDataSource::x_CreateHits ( const objects::CSeq_align &  align)
protected

◆ x_CreateHits_Diagonal()

void CHitMatrixDataSource::x_CreateHits_Diagonal ( const objects::CSeq_align &  align,
size_t  q_index,
size_t  s_index 
)
protected

◆ x_CreateIds()

void CHitMatrixDataSource::x_CreateIds ( TIdVector seq_ids,
const SParams params 
) const
protected

◆ x_GetAlignedSeqIds()

void CHitMatrixDataSource::x_GetAlignedSeqIds ( const CSeq_align align,
const IHitSeqId id,
TSeqIdRefVector ids 
) const
protected

◆ x_GetSeqAlignIds()

void CHitMatrixDataSource::x_GetSeqAlignIds ( const objects::CSeq_align &  align,
TSeqIdRefVector ids,
bool  unique 
) const
protected

◆ x_GoodSeg()

bool CHitMatrixDataSource::x_GoodSeg ( const TStd std_list)
protected

◆ x_TestAndSelectAlign()

void CHitMatrixDataSource::x_TestAndSelectAlign ( const objects::CSeq_align &  align)
protected

◆ x_TestAndSelectAligns()

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

◆ x_UpdateScoreMap()

void CHitMatrixDataSource::x_UpdateScoreMap ( )
protected

Member Data Documentation

◆ m_Aligns

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

◆ m_AlnIdMap

unique_ptr<TAlnIdMap> CHitMatrixDataSource::m_AlnIdMap
protected

◆ m_AlnStats

CRef<TAlnStats> CHitMatrixDataSource::m_AlnStats
protected

Definition at line 205 of file dense_ds.hpp.

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

◆ m_CanCreateRowBased

bool CHitMatrixDataSource::m_CanCreateRowBased
protected

Definition at line 208 of file dense_ds.hpp.

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

◆ m_HIdToHandleMap

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

◆ m_Hits

THitAdapterCont CHitMatrixDataSource::m_Hits
protected

◆ m_Params

SParams CHitMatrixDataSource::m_Params
protected

◆ m_QueryHandle

objects::CBioseq_Handle CHitMatrixDataSource::m_QueryHandle
protected

Definition at line 219 of file dense_ds.hpp.

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

◆ m_QueryHitsRange

TSeqRange CHitMatrixDataSource::m_QueryHitsRange
protected

Definition at line 224 of file dense_ds.hpp.

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

◆ m_QueryID

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

◆ m_Scope

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

◆ m_ScoreMap

TScoreMap CHitMatrixDataSource::m_ScoreMap
protected

Definition at line 213 of file dense_ds.hpp.

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

◆ m_SeqIds

TIdVector CHitMatrixDataSource::m_SeqIds
protected

◆ m_SubjectHandle

objects::CBioseq_Handle CHitMatrixDataSource::m_SubjectHandle
protected

Definition at line 218 of file dense_ds.hpp.

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

◆ m_SubjectHitsRange

TSeqRange CHitMatrixDataSource::m_SubjectHitsRange
protected

Definition at line 223 of file dense_ds.hpp.

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

◆ m_SubjectID

unique_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 Mon Jun 24 05:21:35 2024 by modify_doxy.py rev. 669887