NCBI C++ ToolKit
|
Search Toolkit Book for CSparseAln
Sparse alignment. More...
#include <objtools/alnmgr/sparse_aln.hpp>
Public Types | |
enum | EConstants { kDefaultGenCode = 1 } |
typedef CPairwiseAln::TRng | TRng |
typedef CPairwiseAln::TAlnRng | TAlnRng |
typedef CPairwiseAln::TAlnRngColl | TAlnRngColl |
typedef CAnchoredAln::TDim | TDim |
Synonym of TNumrow. More... | |
typedef CSeq_data::E_Choice | TCoding |
typedef pair< int, int > | TFrames |
Get start and stop frames for the selected row/range. More... | |
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< Uint8 > | TCounter |
Counter type is CAtomiCounter. More... | |
typedef Uint8 | TCount |
Alias for value type of counter. More... | |
Public Types inherited from IAlnExplorer | |
enum | EAlignType { fDNA = 0x01 , fProtein = 0x02 , fMixed = 0x04 , fHomogenous = fDNA | fProtein , fInvalid = 0x80000000 } |
enum | ESearchDirection { eNone , eBackwards , eForward , eLeft , eRight } |
Position search options. More... | |
enum | ESortState { eUnSorted , eAscending , eDescending , eNotSupported } |
typedef int | TNumrow |
typedef objects::CSeqVector::TResidue | TResidue |
typedef CRange< TSeqPos > | TRange |
typedef CRange< TSignedSeqPos > | TSignedRange |
Public Member Functions | |
CSparseAln (const CAnchoredAln &anchored_aln, objects::CScope &scope) | |
Constructor. More... | |
virtual | ~CSparseAln (void) |
Destructor. More... | |
void | SetGapChar (TResidue gap_char) |
Gap character modifier. More... | |
CRef< objects::CScope > | GetScope (void) const |
Scope accessor. More... | |
TDim | GetDim (void) const |
Alignment dimension (number of sequence rows in the alignment) More... | |
TNumrow | GetNumRows (void) const |
Synonym of the above. More... | |
const objects::CSeq_id & | GetSeqId (TNumrow row) const |
Get seq-id for the row. More... | |
TRng | GetAlnRange (void) const |
Get whole alignment range. More... | |
const TAlnRngColl & | GetAlignCollection (TNumrow row) |
Get pairwise alignment for the row. More... | |
bool | IsSetAnchor (void) const |
Check if anchor is set - always true for sparse alignments. More... | |
TNumrow | GetAnchor (void) const |
Get anchor row index. More... | |
TSignedRange | GetSeqAlnRange (TNumrow row) const |
Get sequence range in alignment coords (strand ignored). More... | |
TSignedSeqPos | GetSeqAlnStart (TNumrow row) const |
TSignedSeqPos | GetSeqAlnStop (TNumrow row) const |
TRange | GetSeqRange (TNumrow row) const |
Get sequence range in sequence coords. More... | |
TSeqPos | GetSeqStart (TNumrow row) const |
TSeqPos | GetSeqStop (TNumrow row) const |
bool | IsPositiveStrand (TNumrow row) const |
Check direction of the row. More... | |
bool | IsNegativeStrand (TNumrow row) const |
TSignedSeqPos | GetAlnPosFromSeqPos (TNumrow row, TSeqPos seq_pos, ESearchDirection dir=eNone, bool try_reverse_dir=true) const |
Map sequence position to alignment coordinates. More... | |
TSignedSeqPos | GetSeqPosFromAlnPos (TNumrow for_row, TSeqPos aln_pos, ESearchDirection dir=eNone, bool try_reverse_dir=true) const |
TCoding | GetNaCoding (void) const |
Get sequence coding for nucleotides. More... | |
TCoding | GetAaCoding (void) const |
Get sequence coding for proteins. More... | |
void | SetNaCoding (TCoding coding) |
Set sequence coding for nucleotides. If not set, Iupacna coding is used. More... | |
void | SetAaCoding (TCoding coding) |
Set sequence coding for proteins. If not set, Iupacaa coding is used. More... | |
string & | GetSeqString (TNumrow row, string &buffer, TSeqPos seq_from, TSeqPos seq_to, bool force_translation=false) const |
Fetch sequence data for the given row and range. More... | |
string & | GetSeqString (TNumrow row, string &buffer, const TRange &rq_seq_rng, bool force_translation=false) const |
Fetch sequence data for the given row and range. More... | |
string & | GetAlnSeqString (TNumrow row, string &buffer, const TSignedRange &rq_aln_rng, bool force_translation=false) const |
Fetch alignment sequence data. More... | |
const objects::CBioseq_Handle & | GetBioseqHandle (TNumrow row) const |
Get bioseq handle for the row. More... | |
virtual IAlnSegmentIterator * | CreateSegmentIterator (TNumrow row, const TSignedRange &range, IAlnSegmentIterator::EFlags flags) const |
Create segment iterator. More... | |
bool | IsTranslated (void) const |
Wheather the alignment is translated (heterogenous), e.g. nuc-prot. More... | |
int | GetBaseWidth (TNumrow row) const |
Get base width for the sequence (1 for nucleotides, 3 for proteins). More... | |
TSignedSeqPos | AlnPosToNativeSeqPos (TNumrow row, TSignedSeqPos aln_pos) const |
Convert alignment (genomic) coordinate on the selected row to real sequence position. More... | |
int | AlnPosToNativeFrame (TNumrow row, TSignedSeqPos aln_pos) const |
For protein sequences get frame for the specified coordinated. More... | |
TSignedSeqPos | NativeSeqPosToAlnPos (TNumrow row, TSignedSeqPos seq_pos, int frame=0) const |
Convert sequence position to alignment (genomic) coordinate. More... | |
template<class _TRange > | |
_TRange | AlnRangeToNativeSeqRange (TNumrow row, _TRange aln_range) const |
Convert alignment range (genomic coordinates) on the selected row to real sequence range. More... | |
template<class _TRange > | |
TFrames | AlnRangeToNativeFrames (TNumrow row, _TRange aln_range) const |
template<class _TRange > | |
_TRange | NativeSeqRangeToAlnRange (TNumrow row, _TRange seq_range, TFrames frames=TFrames(0, 0)) const |
Convert sequence range to alignment range (genomic coordinates). More... | |
Public Member Functions inherited from CObject | |
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... | |
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 |
Static Public Member Functions | |
static void | TranslateNAToAA (const string &na, string &aa, int gen_code=kDefaultGenCode) |
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) |
Protected Types | |
typedef CAnchoredAln::TPairwiseAlnVector | TPairwiseAlnVector |
Protected Member Functions | |
void | x_Build (const CAnchoredAln &src_align) |
CSeqVector & | x_GetSeqVector (TNumrow row) const |
int | x_GetGenCode (TNumrow row) const |
Protected Member Functions inherited from CObject | |
virtual void | DeleteThis (void) |
Virtual method "deleting" this object. More... | |
Protected Attributes | |
CRef< CAnchoredAln > | m_Aln |
CRef< objects::CScope > | m_Scope |
TRng | m_FirstRange |
vector< TRng > | m_SecondRanges |
TResidue | m_GapChar |
vector< objects::CBioseq_Handle > | m_BioseqHandles |
vector< CRef< CSeqVector > > | m_SeqVectors |
TCoding | m_NaCoding |
TCoding | m_AaCoding |
bool | m_AnchorDirect |
Friends | |
class | CSparse_CI |
Additional Inherited Members | |
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... | |
Sparse alignment.
Definition at line 50 of file sparse_aln.hpp.
Definition at line 54 of file sparse_aln.hpp.
Definition at line 55 of file sparse_aln.hpp.
Definition at line 133 of file sparse_aln.hpp.
typedef CAnchoredAln::TDim CSparseAln::TDim |
Synonym of TNumrow.
Definition at line 56 of file sparse_aln.hpp.
typedef pair<int, int> CSparseAln::TFrames |
Get start and stop frames for the selected row/range.
0 - no frame (native coordinates are genomic) 1..3 - frame value for protein coordinates
Definition at line 275 of file sparse_aln.hpp.
|
protected |
Definition at line 308 of file sparse_aln.hpp.
typedef CPairwiseAln::TRng CSparseAln::TRng |
Definition at line 53 of file sparse_aln.hpp.
Enumerator | |
---|---|
kDefaultGenCode |
Definition at line 216 of file sparse_aln.hpp.
CSparseAln::CSparseAln | ( | const CAnchoredAln & | anchored_aln, |
objects::CScope & | scope | ||
) |
Constructor.
anchored_aln | Input CAnchoredAln object. Should be built using BuildAln function for the alignment coordinates to be correct. |
scope | CScope used to fetch sequence data. |
Definition at line 52 of file sparse_aln.cpp.
References x_Build().
|
virtual |
Destructor.
Definition at line 64 of file sparse_aln.cpp.
|
inline |
For protein sequences get frame for the specified coordinated.
For genomic sequences always returns 0.
Definition at line 242 of file sparse_aln.hpp.
References GetBaseWidth(), and row.
|
inline |
Convert alignment (genomic) coordinate on the selected row to real sequence position.
Definition at line 235 of file sparse_aln.hpp.
References GetBaseWidth(), and row.
|
inline |
Definition at line 277 of file sparse_aln.hpp.
References GetBaseWidth(), and row.
Referenced by DumpSparseAln(), and CAlnTestApp::Run().
|
inline |
Convert alignment range (genomic coordinates) on the selected row to real sequence range.
NOTE: Need to use template since there are many range types: TRng, TAlnRng, TRange, TSignedRange etc.
Definition at line 265 of file sparse_aln.hpp.
References GetBaseWidth(), and row.
Referenced by CheckSparseAln(), DumpSparseAln(), and CAlnTestApp::Run().
|
virtual |
Create segment iterator.
row | Row to iterate segments for. |
range | Range to iterate. |
flags | Iterator flags. |
Definition at line 710 of file sparse_aln.cpp.
References _ASSERT, CSparse_CI, GetDim(), CAnchoredAln::GetPairwiseAlns(), GetSeqId(), NStr::IntToString(), m_Aln, NCBI_THROW, compile_time_bits::range(), and row.
Referenced by CAlignmentSmear::AddAlignment(), CSparseRowHandle::CreateSegmentIterator(), CSparseMultiDataSource::CreateSegmentIterator(), CSparseAlnGraphicDataSource::CreateSegmentIterator(), CAlnBuildApp::PrintAnchoredAln(), and CAlnTestApp::Run().
|
inline |
Get sequence coding for proteins.
Definition at line 137 of file sparse_aln.hpp.
References m_AaCoding.
const CSparseAln::TAlnRngColl & CSparseAln::GetAlignCollection | ( | TNumrow | row | ) |
Get pairwise alignment for the row.
Definition at line 257 of file sparse_aln.cpp.
References _ASSERT, GetDim(), CAnchoredAln::GetPairwiseAlns(), m_Aln, and row.
TSignedSeqPos CSparseAln::GetAlnPosFromSeqPos | ( | TNumrow | row, |
TSeqPos | seq_pos, | ||
ESearchDirection | dir = eNone , |
||
bool | try_reverse_dir = true |
||
) | const |
Map sequence position to alignment coordinates.
row | Alignment row where the input position is defined. |
seq_pos | Input position |
dir | In case the input position can not be mapped to the alignment coordinates (e.g. the position is inside an unaligned range), try to search for the neares alignment position in the specified direction. |
try_reverse_dir | Not implemented |
Definition at line 373 of file sparse_aln.cpp.
References _ASSERT, GetCollectionSearchDirection(), GetDim(), CAnchoredAln::GetPairwiseAlns(), m_Aln, and row.
Referenced by CSparseMultiDataSource::GetAlnFromSeq(), CSparseMultiDataSource::GetAlnPosFromSeqPos(), CSparseAlnGraphicDataSource::GetAlnPosFromSeqPos(), CSparseRowHandle::GetAlnPosFromSeqPos(), CSparseAlnGraphicDataSource::GetSeqPosFromSeqPos(), and CValidError_align::x_ValidateAlignPercentIdentity().
CSparseAln::TRng CSparseAln::GetAlnRange | ( | void | ) | const |
Get whole alignment range.
Definition at line 238 of file sparse_aln.cpp.
References m_FirstRange.
Referenced by CAlignmentSmear::AddAlignment(), CheckSparseAln(), DumpSparseAln(), CSparseAlnGraphicDataSource::GetAlnRange(), CSparseMultiDataSource::GetAlnStart(), CSparseAlnGraphicDataSource::GetAlnStart(), CSparseMultiDataSource::GetAlnStop(), CSparseAlnGraphicDataSource::GetAlnStop(), CAlnBuildApp::PrintAnchoredAln(), CTreeBuilderJob::x_Divergence(), and CValidError_align::x_ValidateAlignPercentIdentity().
string & CSparseAln::GetAlnSeqString | ( | TNumrow | row, |
string & | buffer, | ||
const TSignedRange & | rq_aln_rng, | ||
bool | force_translation = false |
||
) | const |
Fetch alignment sequence data.
Unaligned ranges of the selected row are filled with gap char.
row | Alignment row to fetch sequence for. |
buffer | Output buffer. |
aln_rng | Alignment range. |
force_translation | Force nucleotide to protein sequence translation. |
Definition at line 552 of file sparse_aln.cpp.
References _ASSERT, buffer, CAlignRangeCollectionList< TAlnRange >::empty(), COpenRange< Position >::Empty(), IAlnSegmentIterator::eSkipInserts, IAlnSegment::GetAlnRange(), GetDim(), CRange_Base::GetFrom(), COpenRange< Position >::GetLength(), CAnchoredAln::GetPairwiseAlns(), IAlnSegment::GetRange(), CPairwiseAln::GetSecondBaseWidth(), CPairwiseAln::GetSecondId(), GetSeqAlnRange(), CSeqVector::GetSeqData(), GetSeqId(), COpenRange< Position >::GetToOpen(), NStr::IntToString(), IsPositiveStrand(), COpenRange< Position >::IsWhole(), kInvalidSeqPos, len, m_Aln, m_AnchorDirect, m_GapChar, min(), NCBI_THROW, row, COpenRange< Position >::SetOpen(), CSeqVector::size(), TranslateNAToAA(), x_GetGenCode(), and x_GetSeqVector().
Referenced by CheckSparseAln(), DumpSparseAln(), CSparseRowHandle::GetAlnSeqString(), CSparseMultiDataSource::GetAlnSeqString(), CSparseAlnGraphicDataSource::GetAlnSeqString(), CAlnBuildApp::PrintAnchoredAln(), CTreeBuilderJob::x_Divergence(), and CValidError_align::x_ValidateAlignPercentIdentity().
|
inline |
Get anchor row index.
Definition at line 95 of file sparse_aln.hpp.
References CAnchoredAln::GetAnchorRow(), and m_Aln.
Referenced by CAlignmentSmear::AddAlignment(), CheckSparseAln(), DumpSparseAln(), CSparseMultiDataSource::GetAnchor(), CSparseAlnGraphicDataSource::GetAnchor(), TestIterators(), and TestSparseIt().
Get base width for the sequence (1 for nucleotides, 3 for proteins).
Definition at line 225 of file sparse_aln.hpp.
References _ASSERT, GetDim(), CAnchoredAln::GetPairwiseAlns(), m_Aln, and row.
Referenced by AlnPosToNativeFrame(), AlnPosToNativeSeqPos(), AlnRangeToNativeFrames(), AlnRangeToNativeSeqRange(), CheckSparseAln(), DumpSparseAln(), CSparseRowHandle::GetBaseWidth(), CSparseMultiDataSource::GetBaseWidth(), CSparseAlnGraphicDataSource::GetBaseWidth(), CSparseRowHandle::IsNucProtAlignment(), NativeSeqPosToAlnPos(), NativeSeqRangeToAlnRange(), and CAlnTestApp::Run().
const CBioseq_Handle & CSparseAln::GetBioseqHandle | ( | TNumrow | row | ) | const |
Get bioseq handle for the row.
Throw exception if the handle can not be obtained.
Definition at line 396 of file sparse_aln.cpp.
References _ASSERT, GetDim(), GetSeqId(), m_BioseqHandles, m_Scope, NCBI_THROW, and row.
Referenced by CBuildSparseAlnJob::Build(), CSparseRowHandle::GetBioseqHandle(), CSparseMultiDataSource::GetBioseqHandle(), CSparseAlnGraphicDataSource::GetBioseqHandle(), CSparseAlnGraphicDataSource::GetSeqLength(), CSparseRowHandle::UsesAATranslation(), CTreeBuilderJob::x_CreateProjectItems(), x_GetGenCode(), and x_GetSeqVector().
CSparseAln::TDim CSparseAln::GetDim | ( | void | ) | const |
Alignment dimension (number of sequence rows in the alignment)
Definition at line 69 of file sparse_aln.cpp.
References CAnchoredAln::GetDim(), and m_Aln.
Referenced by BuildAlignDataSource(), CheckSparseAln(), CreateSegmentIterator(), DumpSparseAln(), GetAlignCollection(), GetAlnPosFromSeqPos(), GetAlnSeqString(), GetBaseWidth(), GetBioseqHandle(), GetNumRows(), GetSeqAlnRange(), GetSeqAlnStart(), GetSeqAlnStop(), GetSeqId(), GetSeqPosFromAlnPos(), GetSeqRange(), GetSeqStart(), GetSeqStop(), GetSeqString(), IsNegativeStrand(), IsPositiveStrand(), CValidError_align::IsTpaAlignment(), IsTranslated(), CAlnBuildApp::PrintAnchoredAln(), CAlnTestApp::Run(), x_GetSeqVector(), and CValidError_align::x_ValidateAlignPercentIdentity().
|
inline |
Get sequence coding for nucleotides.
Definition at line 135 of file sparse_aln.hpp.
References m_NaCoding.
|
inline |
Synonym of the above.
Definition at line 80 of file sparse_aln.hpp.
References GetDim().
Referenced by CAlignmentSmear::AddAlignment(), CBuildSparseAlnJob::Build(), CheckSparseAln(), DumpSparseAln(), CSparseMultiDataSource::GetAlignType(), CSparseMultiDataSource::GetNumRows(), CSparseAlnGraphicDataSource::GetNumRows(), CSparseRowHandle::IsNucProtAlignment(), TestIterators(), CSparseMultiDataSource::x_CreateHandles(), CTreeBuilderJob::x_CreateProjectItems(), and CTreeBuilderJob::x_Divergence().
Scope accessor.
Definition at line 250 of file sparse_aln.cpp.
References m_Scope.
Referenced by CSparseMultiDataSource::GetAlignType(), and CSparseRowHandle::GetScope().
CSparseAln::TSignedRange CSparseAln::GetSeqAlnRange | ( | TNumrow | row | ) | const |
Get sequence range in alignment coords (strand ignored).
Definition at line 285 of file sparse_aln.cpp.
References _ASSERT, GetDim(), GetSeqAlnStart(), GetSeqAlnStop(), and row.
Referenced by DumpSparseAln(), GetAlnSeqString(), CSparseRowHandle::GetSeqAlnRange(), CSparseAlnGraphicDataSource::GetSeqAlnRange(), CAlnBuildApp::PrintAnchoredAln(), and CAlnTestApp::Run().
TSignedSeqPos CSparseAln::GetSeqAlnStart | ( | TNumrow | row | ) | const |
Definition at line 271 of file sparse_aln.cpp.
References _ASSERT, GetDim(), CAnchoredAln::GetPairwiseAlns(), m_Aln, and row.
Referenced by CheckSparseAln(), DumpSparseAln(), GetSeqAlnRange(), CSparseRowHandle::GetSeqAlnStart(), CSparseMultiDataSource::GetSeqFromAln(), and CValidError_align::x_ValidateAlignPercentIdentity().
TSignedSeqPos CSparseAln::GetSeqAlnStop | ( | TNumrow | row | ) | const |
Definition at line 278 of file sparse_aln.cpp.
References _ASSERT, GetDim(), CAnchoredAln::GetPairwiseAlns(), m_Aln, and row.
Referenced by CheckSparseAln(), DumpSparseAln(), GetSeqAlnRange(), CSparseRowHandle::GetSeqAlnStop(), CSparseMultiDataSource::GetSeqFromAln(), and CValidError_align::x_ValidateAlignPercentIdentity().
Get seq-id for the row.
Definition at line 264 of file sparse_aln.cpp.
References _ASSERT, GetDim(), CAnchoredAln::GetPairwiseAlns(), m_Aln, and row.
Referenced by CheckSparseAln(), CreateSegmentIterator(), DumpSparseAln(), CSparseMultiDataSource::GetAlignType(), GetAlnSeqString(), GetBioseqHandle(), CSparseRowHandle::GetSeq_id(), CSparseMultiDataSource::GetSeqId(), CSparseAlnGraphicDataSource::GetSeqId(), CValidError_align::IsTpaAlignment(), CAlnBuildApp::PrintAnchoredAln(), and TestIterators().
TSignedSeqPos CSparseAln::GetSeqPosFromAlnPos | ( | TNumrow | for_row, |
TSeqPos | aln_pos, | ||
ESearchDirection | dir = eNone , |
||
bool | try_reverse_dir = true |
||
) | const |
Definition at line 385 of file sparse_aln.cpp.
References _ASSERT, GetCollectionSearchDirection(), GetDim(), CAnchoredAln::GetPairwiseAlns(), m_Aln, and row.
Referenced by CSparseMultiDataSource::GetSeqFromAln(), CSparseMultiDataSource::GetSeqPosFromAlnPos(), CSparseAlnGraphicDataSource::GetSeqPosFromAlnPos(), CSparseRowHandle::GetSeqPosFromAlnPos(), CAlnBuildApp::PrintAnchoredAln(), TestSparseIt(), and CValidError_align::x_ValidateAlignPercentIdentity().
CSparseAln::TRange CSparseAln::GetSeqRange | ( | TNumrow | row | ) | const |
Get sequence range in sequence coords.
Definition at line 306 of file sparse_aln.cpp.
References _ASSERT, GetDim(), GetSeqStart(), GetSeqStop(), and row.
Referenced by CheckSparseAln(), DumpSparseAln(), and GetSeqString().
Definition at line 292 of file sparse_aln.cpp.
References _ASSERT, GetDim(), m_SecondRanges, and row.
Referenced by CSparseMultiDataSource::GetAlnFromSeq(), GetSeqRange(), CSparseRowHandle::GetSeqStart(), CSparseMultiDataSource::GetSeqStart(), and CSparseAlnGraphicDataSource::GetSeqStart().
Definition at line 299 of file sparse_aln.cpp.
References _ASSERT, GetDim(), m_SecondRanges, and row.
Referenced by CSparseMultiDataSource::GetAlnFromSeq(), GetSeqRange(), CSparseRowHandle::GetSeqStop(), CSparseMultiDataSource::GetSeqStop(), and CSparseAlnGraphicDataSource::GetSeqStop().
string & CSparseAln::GetSeqString | ( | TNumrow | row, |
string & | buffer, | ||
const TRange & | rq_seq_rng, | ||
bool | force_translation = false |
||
) | const |
Fetch sequence data for the given row and range.
row | Alignment row to fetch sequence for. |
buffer | Output buffer. |
seq_rng | Sequence range. |
force_translation | Force nucleotide to protein sequence translation. |
Definition at line 505 of file sparse_aln.cpp.
References _ASSERT, buffer, GetDim(), CRange_Base::GetFrom(), CAnchoredAln::GetPairwiseAlns(), CSeqVector::GetSeqData(), GetSeqRange(), COpenRange< Position >::GetToOpen(), IsPositiveStrand(), COpenRange< Position >::IsWhole(), m_Aln, m_GapChar, row, ncbi::grid::netcache::search::fields::size, CSeqVector::size(), TranslateNAToAA(), x_GetGenCode(), and x_GetSeqVector().
string & CSparseAln::GetSeqString | ( | TNumrow | row, |
string & | buffer, | ||
TSeqPos | seq_from, | ||
TSeqPos | seq_to, | ||
bool | force_translation = false |
||
) | const |
Fetch sequence data for the given row and range.
row | Alignment row to fetch sequence for. |
buffer | Output buffer. |
seq_from | Start sequence position. |
seq_to | End sequence position. |
force_translation | Force nucleotide to protein sequence translation. |
Definition at line 496 of file sparse_aln.cpp.
Referenced by CheckSparseAln(), DumpSparseAln(), CSparseRowHandle::GetSeqString(), and CSparseMultiDataSource::GetSeqString().
Definition at line 321 of file sparse_aln.cpp.
References _ASSERT, CAlignRangeCollectionList< CAlignRange< TSignedSeqPos > >::fMixedDir, CAlignRangeCollectionList< CAlignRange< TSignedSeqPos > >::fReversed, GetDim(), CAnchoredAln::GetPairwiseAlns(), m_Aln, m_AnchorDirect, and row.
Referenced by CSparseRowHandle::IsNegativeStrand(), CSparseMultiDataSource::IsNegativeStrand(), and CSparseAlnGraphicDataSource::IsNegativeStrand().
Check direction of the row.
Definition at line 313 of file sparse_aln.cpp.
References _ASSERT, CAlignRangeCollectionList< CAlignRange< TSignedSeqPos > >::fDirect, CAlignRangeCollectionList< CAlignRange< TSignedSeqPos > >::fMixedDir, GetDim(), CAnchoredAln::GetPairwiseAlns(), m_Aln, m_AnchorDirect, and row.
Referenced by GetAlnSeqString(), GetSeqString(), CSparseMultiDataSource::IsPositiveStrand(), CSparseAlnGraphicDataSource::IsPositiveStrand(), and x_GetSeqVector().
|
inline |
Check if anchor is set - always true for sparse alignments.
Definition at line 92 of file sparse_aln.hpp.
Referenced by CSparseMultiDataSource::IsSetAnchor().
bool CSparseAln::IsTranslated | ( | void | ) | const |
Wheather the alignment is translated (heterogenous), e.g. nuc-prot.
Definition at line 329 of file sparse_aln.cpp.
References GetDim(), CAnchoredAln::GetPairwiseAlns(), m_Aln, and row.
|
inline |
Convert sequence position to alignment (genomic) coordinate.
Optional frame can be used with protein positions.
Definition at line 250 of file sparse_aln.hpp.
References GetBaseWidth(), and row.
|
inline |
Convert sequence range to alignment range (genomic coordinates).
Optional frames argument can be provided for protein ranges. NOTE: Need to use template since there are many range types: TRng, TAlnRng, TRange, TSignedRange etc.
Definition at line 290 of file sparse_aln.hpp.
References GetBaseWidth(), and row.
|
inline |
Set sequence coding for proteins. If not set, Iupacaa coding is used.
Definition at line 141 of file sparse_aln.hpp.
References m_AaCoding.
void CSparseAln::SetGapChar | ( | TResidue | gap_char | ) |
Gap character modifier.
Definition at line 244 of file sparse_aln.cpp.
References m_GapChar.
Referenced by CSparseMultiDataSource::SetGapChar(), CTreeBuilderJob::x_CreateProjectItems(), and CTreeBuilderJob::x_Divergence().
|
inline |
Set sequence coding for nucleotides. If not set, Iupacna coding is used.
Definition at line 139 of file sparse_aln.hpp.
References m_NaCoding.
|
static |
Definition at line 463 of file sparse_aln.cpp.
References CTrans_table::GetCodonResidue(), CGen_code_table::GetTransTable(), i, and CTrans_table::NextCodonState().
Referenced by GetAlnSeqString(), GetSeqString(), and CAlnSpanVertModel::x_PopulateRows().
|
protected |
Definition at line 99 of file sparse_aln.cpp.
References _ASSERT, CAlignRangeCollectionList< TAlnRange >::begin(), COpenRange< Position >::CombineWith(), SGapRange::direct, CAlignRangeCollectionList< TAlnRange >::empty(), CAlignRangeCollectionList< TAlnRange >::end(), CAlignRangeCollectionList< TAlnRange >::fInvalid, CAlignRangeCollectionList< TAlnRange >::fOverlap, SGapRange::from, CAlignRangeCollectionList< TAlnRange >::fUnsorted, CAnchoredAln::GetAnchorRow(), CAnchoredAln::GetDim(), CAlignRange< Position >::GetFirstFrom(), CPairwiseAln::GetFirstId(), CAlignRange< Position >::GetFirstToOpen(), CAlignRangeCollectionList< TAlnRange >::GetFlags(), CAlignRangeCollectionList< TAlnRange >::GetInsertions(), CAlignRange< Position >::GetLength(), CAnchoredAln::GetPairwiseAlns(), CAnchoredAln::GetScore(), CAlignRange< Position >::GetSecondFrom(), CPairwiseAln::GetSecondId(), CAlignRangeCollExtender< TColl >::GetSecondRange(), CAlignRange< Position >::GetSecondToOpen(), i, CAlignRange< Position >::IsDirect(), CAlignRange< Position >::IsFirstDirect(), SGapRange::len, m_Aln, m_AnchorDirect, m_BioseqHandles, m_FirstRange, m_SecondRanges, m_SeqVectors, NON_CONST_ITERATE, CRef< C, Locker >::Reset(), row, SGapRange::row, SGapRange::second_from, CAnchoredAln::SetAnchorRow(), CAnchoredAln::SetDim(), CAlignRange< Position >::SetDirect(), CAlignRange< Position >::SetFirstDirect(), CAlignRange< Position >::SetFirstFrom(), CAlignRange< Position >::SetLength(), CAnchoredAln::SetPairwiseAlns(), CAnchoredAln::SetScore(), CAlignRange< Position >::SetSecondFrom(), SGapRange::shift, and CAlignRangeCollExtender< TColl >::UpdateIndex().
Referenced by CSparseAln().
Definition at line 446 of file sparse_aln.cpp.
References GetBioseqHandle(), GetBioSource(), CBioSource::GetGenCode(), GetOrg_refOrNull(), kDefaultGenCode, and row.
Referenced by GetAlnSeqString(), and GetSeqString().
|
protected |
Definition at line 411 of file sparse_aln.cpp.
References _ASSERT, CSeq_data_Base::e_not_set, CBioseq_Handle::eCoding_Iupac, CBioseq_Handle::eStrand_Minus, CBioseq_Handle::eStrand_Plus, GetBioseqHandle(), GetDim(), CSeqVector::IsNucleotide(), IsPositiveStrand(), CSeqVector::IsProtein(), m_AaCoding, m_NaCoding, m_SeqVectors, row, CSeqVector::SetCoding(), and CSeqVector::SetIupacCoding().
Referenced by GetAlnSeqString(), and GetSeqString().
|
friend |
Definition at line 302 of file sparse_aln.hpp.
Referenced by CreateSegmentIterator().
|
protected |
Definition at line 319 of file sparse_aln.hpp.
Referenced by GetAaCoding(), SetAaCoding(), and x_GetSeqVector().
|
protected |
Definition at line 310 of file sparse_aln.hpp.
Referenced by CreateSegmentIterator(), GetAlignCollection(), GetAlnPosFromSeqPos(), GetAlnSeqString(), GetAnchor(), GetBaseWidth(), GetDim(), GetSeqAlnStart(), GetSeqAlnStop(), GetSeqId(), GetSeqPosFromAlnPos(), GetSeqString(), IsNegativeStrand(), IsPositiveStrand(), IsTranslated(), and x_Build().
|
protected |
Definition at line 321 of file sparse_aln.hpp.
Referenced by GetAlnSeqString(), IsNegativeStrand(), IsPositiveStrand(), and x_Build().
|
mutableprotected |
Definition at line 315 of file sparse_aln.hpp.
Referenced by GetBioseqHandle(), and x_Build().
|
protected |
Definition at line 312 of file sparse_aln.hpp.
Referenced by GetAlnRange(), and x_Build().
|
protected |
Definition at line 314 of file sparse_aln.hpp.
Referenced by GetAlnSeqString(), GetSeqString(), and SetGapChar().
|
protected |
Definition at line 318 of file sparse_aln.hpp.
Referenced by GetNaCoding(), SetNaCoding(), and x_GetSeqVector().
|
mutableprotected |
Definition at line 311 of file sparse_aln.hpp.
Referenced by GetBioseqHandle(), and GetScope().
|
protected |
Definition at line 313 of file sparse_aln.hpp.
Referenced by GetSeqStart(), GetSeqStop(), and x_Build().
|
mutableprotected |
Definition at line 316 of file sparse_aln.hpp.
Referenced by x_Build(), and x_GetSeqVector().