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

Search Toolkit Book for IAlnGraphicDataSource

IAlnGraphicDataSource - interface to a data source representing an abstract alignment used in graphical view. More...

#include <gui/widgets/seq_graphic/alngraphic_ds.hpp>

+ Inheritance diagram for IAlnGraphicDataSource:
+ Collaboration diagram for IAlnGraphicDataSource:

Public Types

enum  EPolyATail { ePolyA_Yes , ePolyA_No , ePolyA_Unknown }
 Cetantiy of having unaligned polyA tail. More...
 
enum  ECigarOp {
  eCigar_M = 'M' , eCigar_I = 'I' , eCigar_D = 'D' , eCigar_N = 'N' ,
  eCigar_S = 'S' , eCigar_H = 'H' , eCigar_P = 'P' , eCigar_Eq = '=' ,
  eCigar_X = 'X'
}
 
enum  EPartialAlignment { ePartial_None = 0 , ePartial_5prime = 1 << 0 , ePartial_3prime = 1 << 1 }
 datasource may point to an alignment that was modified from the original actual alignment it's done to optimize rendering. More...
 
typedef pair< ECigarOp, size_t > TCigarPair
 
typedef vector< TCigarPairTCigar
 
typedef IAlnExplorer::TSignedRange TSignedRange
 
typedef IAlnExplorer::TNumrow TNumrow
 
typedef IAlnExplorer::TResidue TResidue
 
typedef IAlnExplorer::ESearchDirection TSearchDirection
 
typedef CRangeCollection< TSeqPosTRangeColl
 
- 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 Member Functions

virtual IAlnExplorer::EAlignType GetAlignType () const
 
virtual TSeqPos GetSeqStart (TNumrow row) const =0
 
virtual TSeqPos GetSeqStop (TNumrow row) const =0
 
virtual TSignedRange GetAlnRange (void) const =0
 
virtual TSignedRange GetSeqAlnRange (TNumrow row) const =0
 
virtual TSeqPos GetSeqLength (TNumrow row) const =0
 
virtual const objects::CSeq_id & GetSeqId (TNumrow row) const =0
 
virtual bool IsPositiveStrand (TNumrow row) const =0
 
virtual bool IsNegativeStrand (TNumrow row) const =0
 
virtual TSignedSeqPos GetAlnPosFromSeqPos (TNumrow row, TSeqPos seq_pos, IAlnExplorer::ESearchDirection dir=IAlnExplorer::eNone, bool try_reverse_dir=true) const =0
 
virtual stringGetSeqString (string &buffer, TNumrow row, const TSignedRange &seq_rng, const TSignedRange &aln_rng, bool anchor_direct) const
 Get sequence string for a given row in sequence range. More...
 
virtual TSignedSeqPos AlnPosToNativeSeqPos (TNumrow row, TSignedSeqPos aln_pos) const
 Convert alignment (genomic) coordinate on the selected row to real sequence position. More...
 
virtual TSignedSeqPos NativeSeqPosToAlnPos (TNumrow row, TSignedSeqPos seq_pos, int frame=0) const
 Convert sequence position to alignment (genomic) coordinate. More...
 
virtual TSignedSeqPos GetSeqPosFromSeqPos (TNumrow for_row, TNumrow row, TSeqPos seq_pos) const =0
 
virtual IAlnExplorer::TNumrow GetQuery () const
 
virtual void GetUnalignedTails (TSignedSeqPos &start_tail, TSignedSeqPos &end_tail, bool clipped=true) const
 
const TSignedSeqPos GetUnalignedTailLimit () const
 
virtual TSeqRange GetAlnRangeWithTails () const
 
virtual EPolyATail HasPolyATail () const =0
 Check if there is any unaligned polyA tail. More...
 
virtual bool HasCigar () const =0
 Check if there is a CIGAR string. More...
 
virtual bool IsCigarUnambiguous () const
 Check if cigar doesn't have ambiguous M's. More...
 
virtual const TCigarGetCigar () const =0
 Get CIGAR vector. More...
 
virtual bool IsSimplified () const
 
virtual bool IsRegular () const
 
bool IsPartial () const
 
int GetPartialFlags () const
 
void SetPartialFlags (int partial_flags)
 
virtual bool IsColoringAvailable () const
 
virtual const TCigarPairGetCigarAtAlnPos (int row, TSignedSeqPos pos) const
 
virtual const objects::CBioseq_Handle & GetBioseqHandle (IAlnExplorer::TNumrow row) const =0
 
int GetGenCode (IAlnExplorer::TNumrow row) const
 
- Public Member Functions inherited from CObjectEx
 CObjectEx (void)
 
virtual ~CObjectEx (void)
 
- 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 CWeakObject
 CWeakObject (void)
 
virtual ~CWeakObject (void)
 
CPtrToObjectProxyGetPtrProxy (void) const
 Get pointer to proxy object containing pointer to this object. More...
 
- Public Member Functions inherited from IScoringAlignment
virtual ~IScoringAlignment ()
 
virtual IAlnExplorer::TNumrow GetNumRows () const =0
 
virtual TSeqPos GetAlnStart () const =0
 
virtual TSeqPos GetAlnStop () const =0
 
virtual IAlnExplorer::TNumrow GetAnchor () const =0
 
virtual stringGetAlnSeqString (IAlnExplorer::TNumrow row, string &buffer, const IAlnExplorer::TSignedRange &aln_range) const =0
 
virtual IAlnSegmentIteratorCreateSegmentIterator (IAlnExplorer::TNumrow, const IAlnExplorer::TSignedRange &, IAlnSegmentIterator::EFlags) const =0
 
virtual TSeqPos GetBaseWidth (IAlnExplorer::TNumrow) const =0
 
virtual TSignedSeqPos GetSeqPosFromAlnPos (IAlnExplorer::TNumrow for_row, TSeqPos aln_pos, IAlnExplorer::ESearchDirection dir=IAlnExplorer::eNone, bool try_reverse_dir=true) const =0
 
virtual bool IsMixedAlign () const
 New interfaces to handle alignemnt with mixed type (protein-to-genomic) To make them backward compatible, they have default implementation. More...
 

Protected Attributes

const TSignedSeqPos m_kUnalignedTailLimit = 200
 Unaligned tail length limit. More...
 
unique_ptr< vector< int > > m_GenCodeCache
 
int m_PartialFlags = ePartial_None
 Data source does not represent the whole alignment alignment has been sliced to optimize rendering. More...
 

Additional Inherited Members

- 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...
 
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
 
- Protected Member Functions inherited from CWeakObject
void CleanWeakRefs (void) const
 Method cleaning all CWeakRefs referencing at this moment to the object After calling to this method all existing CWeakRefs referencing to the object will return NULL, so it effectively will be equal to deleting the object. More...
 

Detailed Description

IAlnGraphicDataSource - interface to a data source representing an abstract alignment used in graphical view.

Definition at line 52 of file alngraphic_ds.hpp.

Member Typedef Documentation

◆ TCigar

Definition at line 87 of file alngraphic_ds.hpp.

◆ TCigarPair

Definition at line 86 of file alngraphic_ds.hpp.

◆ TNumrow

Definition at line 90 of file alngraphic_ds.hpp.

◆ TRangeColl

Definition at line 93 of file alngraphic_ds.hpp.

◆ TResidue

Definition at line 91 of file alngraphic_ds.hpp.

◆ TSearchDirection

Definition at line 92 of file alngraphic_ds.hpp.

◆ TSignedRange

Definition at line 89 of file alngraphic_ds.hpp.

Member Enumeration Documentation

◆ ECigarOp

Enumerator
eCigar_M 
eCigar_I 
eCigar_D 
eCigar_N 
eCigar_S 
eCigar_H 
eCigar_P 
eCigar_Eq 
eCigar_X 

Definition at line 64 of file alngraphic_ds.hpp.

◆ EPartialAlignment

datasource may point to an alignment that was modified from the original actual alignment it's done to optimize rendering.

Alignment can be sliced on the right or on the left m_PartialFlgas will indicate that state

Enumerator
ePartial_None 
ePartial_5prime 
ePartial_3prime 

Definition at line 80 of file alngraphic_ds.hpp.

◆ EPolyATail

Cetantiy of having unaligned polyA tail.

Enumerator
ePolyA_Yes 
ePolyA_No 
ePolyA_Unknown 

Definition at line 58 of file alngraphic_ds.hpp.

Member Function Documentation

◆ AlnPosToNativeSeqPos()

virtual TSignedSeqPos IAlnGraphicDataSource::AlnPosToNativeSeqPos ( TNumrow  row,
TSignedSeqPos  aln_pos 
) const
inlinevirtual

Convert alignment (genomic) coordinate on the selected row to real sequence position.

Definition at line 229 of file alngraphic_ds.hpp.

References IScoringAlignment::GetBaseWidth(), and row.

◆ GetAlignType()

virtual IAlnExplorer::EAlignType IAlnGraphicDataSource::GetAlignType ( void  ) const
inlinevirtual

◆ GetAlnPosFromSeqPos()

virtual TSignedSeqPos IAlnGraphicDataSource::GetAlnPosFromSeqPos ( TNumrow  row,
TSeqPos  seq_pos,
IAlnExplorer::ESearchDirection  dir = IAlnExplorer::eNone,
bool  try_reverse_dir = true 
) const
pure virtual

◆ GetAlnRange()

virtual TSignedRange IAlnGraphicDataSource::GetAlnRange ( void  ) const
pure virtual

◆ GetAlnRangeWithTails()

virtual TSeqRange IAlnGraphicDataSource::GetAlnRangeWithTails ( ) const
inlinevirtual

◆ GetBioseqHandle()

virtual const objects::CBioseq_Handle& IAlnGraphicDataSource::GetBioseqHandle ( IAlnExplorer::TNumrow  row) const
pure virtual

◆ GetCigar()

virtual const TCigar* IAlnGraphicDataSource::GetCigar ( ) const
pure virtual

◆ GetCigarAtAlnPos()

virtual const TCigarPair* IAlnGraphicDataSource::GetCigarAtAlnPos ( int  row,
TSignedSeqPos  pos 
) const
inlinevirtual

◆ GetGenCode()

int IAlnGraphicDataSource::GetGenCode ( IAlnExplorer::TNumrow  row) const
inlinevirtual

◆ GetPartialFlags()

int IAlnGraphicDataSource::GetPartialFlags ( ) const
inline

Definition at line 383 of file alngraphic_ds.hpp.

References m_PartialFlags.

Referenced by CAlignGlyph::DrawPWAlignElem().

◆ GetQuery()

virtual IAlnExplorer::TNumrow IAlnGraphicDataSource::GetQuery ( void  ) const
inlinevirtual

◆ GetSeqAlnRange()

virtual TSignedRange IAlnGraphicDataSource::GetSeqAlnRange ( TNumrow  row) const
pure virtual

◆ GetSeqId()

virtual const objects::CSeq_id& IAlnGraphicDataSource::GetSeqId ( TNumrow  row) const
pure virtual

◆ GetSeqLength()

virtual TSeqPos IAlnGraphicDataSource::GetSeqLength ( TNumrow  row) const
pure virtual

◆ GetSeqPosFromSeqPos()

virtual TSignedSeqPos IAlnGraphicDataSource::GetSeqPosFromSeqPos ( TNumrow  for_row,
TNumrow  row,
TSeqPos  seq_pos 
) const
pure virtual

◆ GetSeqStart()

virtual TSeqPos IAlnGraphicDataSource::GetSeqStart ( TNumrow  row) const
pure virtual

◆ GetSeqStop()

virtual TSeqPos IAlnGraphicDataSource::GetSeqStop ( TNumrow  row) const
pure virtual

◆ GetSeqString()

virtual string& IAlnGraphicDataSource::GetSeqString ( string buffer,
TNumrow  row,
const TSignedRange seq_rng,
const TSignedRange aln_rng,
bool  anchor_direct 
) const
inlinevirtual

Get sequence string for a given row in sequence range.

The method can optionally return the sequence string in anchor sequence's direction (if anchor row and selected row have different strands.

Reimplemented in CSimpleGraphicDataSource, and CDensegGraphicDataSource.

Definition at line 190 of file alngraphic_ds.hpp.

References buffer, CSeqUtil::e_Iupacaa, CSeqUtil::e_Iupacna, IScoringAlignment::GetAnchor(), IScoringAlignment::GetBaseWidth(), GetBioseqHandle(), CRange_Base::GetFrom(), CRange_Base::GetTo(), IsPositiveStrand(), CSeqManip::Reverse(), CSeqManip::ReverseComplement(), row, CRange_Base::SetFrom(), and swap().

Referenced by CDensegGraphicDataSource::GetSeqString(), CSimpleGraphicDataSource::GetSeqString(), and CSGAlignStatJob::x_CreatePileUpGraphs().

◆ GetUnalignedTailLimit()

const TSignedSeqPos IAlnGraphicDataSource::GetUnalignedTailLimit ( ) const
inline

Definition at line 338 of file alngraphic_ds.hpp.

References m_kUnalignedTailLimit.

◆ GetUnalignedTails()

virtual void IAlnGraphicDataSource::GetUnalignedTails ( TSignedSeqPos start_tail,
TSignedSeqPos end_tail,
bool  clipped = true 
) const
inlinevirtual

◆ HasCigar()

virtual bool IAlnGraphicDataSource::HasCigar ( ) const
pure virtual

◆ HasPolyATail()

virtual EPolyATail IAlnGraphicDataSource::HasPolyATail ( ) const
pure virtual

Check if there is any unaligned polyA tail.

By default, it returns unknown to ask for further verification.

Implemented in CSparseAlnGraphicDataSource, CSimpleGraphicDataSource, CDensegGraphicDataSource, and CAlnVecGraphicDataSource.

Referenced by CAlignGlyph::x_ShowUnalignedTails().

◆ IsCigarUnambiguous()

virtual bool IAlnGraphicDataSource::IsCigarUnambiguous ( ) const
inlinevirtual

Check if cigar doesn't have ambiguous M's.

Reimplemented in CDensegGraphicDataSource.

Definition at line 366 of file alngraphic_ds.hpp.

Referenced by CSGAlignmentDS::CalculateAlignmentScore(), CAlignCigarScore::GetScoreIterator(), and CAlignCigarScore::HasScores().

◆ IsColoringAvailable()

virtual bool IAlnGraphicDataSource::IsColoringAvailable ( ) const
inlinevirtual

Reimplemented in CDensegGraphicDataSource.

Definition at line 391 of file alngraphic_ds.hpp.

Referenced by CAlignmentTrack::x_AddAlignmentLayout().

◆ IsNegativeStrand()

virtual bool IAlnGraphicDataSource::IsNegativeStrand ( TNumrow  row) const
pure virtual

◆ IsPartial()

bool IAlnGraphicDataSource::IsPartial ( ) const
inline

◆ IsPositiveStrand()

virtual bool IAlnGraphicDataSource::IsPositiveStrand ( TNumrow  row) const
pure virtual

◆ IsRegular()

virtual bool IAlnGraphicDataSource::IsRegular ( ) const
inlinevirtual

Reimplemented in CSimpleGraphicDataSource.

Definition at line 376 of file alngraphic_ds.hpp.

Referenced by CAlignGlyph::x_DrawSimplified().

◆ IsSimplified()

virtual bool IAlnGraphicDataSource::IsSimplified ( ) const
inlinevirtual

Reimplemented in CSimpleGraphicDataSource.

Definition at line 373 of file alngraphic_ds.hpp.

Referenced by CGuiObjectInfoSeq_align::GetToolTip(), and CAlignGlyph::IsSimplified().

◆ NativeSeqPosToAlnPos()

virtual TSignedSeqPos IAlnGraphicDataSource::NativeSeqPosToAlnPos ( TNumrow  row,
TSignedSeqPos  seq_pos,
int  frame = 0 
) const
inlinevirtual

Convert sequence position to alignment (genomic) coordinate.

Definition at line 235 of file alngraphic_ds.hpp.

References IScoringAlignment::GetBaseWidth(), and row.

◆ SetPartialFlags()

void IAlnGraphicDataSource::SetPartialFlags ( int  partial_flags)
inline

Definition at line 387 of file alngraphic_ds.hpp.

References m_PartialFlags.

Member Data Documentation

◆ m_GenCodeCache

unique_ptr<vector<int> > IAlnGraphicDataSource::m_GenCodeCache
mutableprotected

Definition at line 431 of file alngraphic_ds.hpp.

Referenced by GetGenCode().

◆ m_kUnalignedTailLimit

const TSignedSeqPos IAlnGraphicDataSource::m_kUnalignedTailLimit = 200
protected

Unaligned tail length limit.

Definition at line 430 of file alngraphic_ds.hpp.

Referenced by GetUnalignedTailLimit(), and GetUnalignedTails().

◆ m_PartialFlags

int IAlnGraphicDataSource::m_PartialFlags = ePartial_None
protected

Data source does not represent the whole alignment alignment has been sliced to optimize rendering.

Definition at line 435 of file alngraphic_ds.hpp.

Referenced by GetPartialFlags(), GetUnalignedTails(), IsPartial(), and SetPartialFlags().


The documentation for this class was generated from the following file:
Modified on Sat Apr 13 11:46:09 2024 by modify_doxy.py rev. 669887