NCBI C++ ToolKit
Typedefs | Functions
aln_converters.hpp File Reference
#include <corelib/ncbistd.hpp>
#include <corelib/ncbiobj.hpp>
#include <objects/seqalign/Seq_align.hpp>
#include <objects/seq/seq_loc_mapper_base.hpp>
#include <objtools/alnmgr/alnexception.hpp>
#include <objtools/alnmgr/pairwise_aln.hpp>
#include <objtools/alnmgr/aln_user_options.hpp>
#include <objtools/alnmgr/aln_stats.hpp>
+ Include dependency graph for aln_converters.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Go to the SVN repository for this file.

Typedefs

typedef vector< TAlnSeqIdIRefTAlnSeqIdVec
 
typedef list< CRef< CPairwiseAln > > TPairwiseAlnList
 

Functions

void ConvertSeqAlignToPairwiseAln (CPairwiseAln &pairwise_aln, const objects::CSeq_align &sa, objects::CSeq_align::TDim row_1, objects::CSeq_align::TDim row_2, CAlnUserOptions::EDirection direction=CAlnUserOptions::eBothDirections, const TAlnSeqIdVec *ids=0)
 Build pairwise alignment from the selected rows of a seq-align. More...
 
void ConvertDensegToPairwiseAln (CPairwiseAln &pairwise_aln, const objects::CDense_seg &ds, objects::CSeq_align::TDim row_1, objects::CSeq_align::TDim row_2, CAlnUserOptions::EDirection direction=CAlnUserOptions::eBothDirections, const TAlnSeqIdVec *ids=0)
 Build pairwise alignment from the selected rows of a dense-seg. More...
 
void ConvertPackedsegToPairwiseAln (CPairwiseAln &pairwise_aln, const objects::CPacked_seg &ps, objects::CSeq_align::TDim row_1, objects::CSeq_align::TDim row_2, CAlnUserOptions::EDirection direction=CAlnUserOptions::eBothDirections, const TAlnSeqIdVec *ids=0)
 Build pairwise alignment from the selected rows of a packed-seg. More...
 
void ConvertStdsegToPairwiseAln (CPairwiseAln &pairwise_aln, const objects::CSeq_align::TSegs::TStd &stds, objects::CSeq_align::TDim row_1, objects::CSeq_align::TDim row_2, CAlnUserOptions::EDirection direction=CAlnUserOptions::eBothDirections, const TAlnSeqIdVec *ids=0)
 Build pairwise alignment from the selected rows of an std-seg. More...
 
void ConvertDendiagToPairwiseAln (CPairwiseAln &pairwise_aln, const objects::CSeq_align::TSegs::TDendiag &dendiags, objects::CSeq_align::TDim row_1, objects::CSeq_align::TDim row_2, CAlnUserOptions::EDirection direction=CAlnUserOptions::eBothDirections, const TAlnSeqIdVec *ids=0)
 Build pairwise alignment from the selected rows of a dendiag. More...
 
void ConvertSparseToPairwiseAln (CPairwiseAln &pairwise_aln, const objects::CSparse_seg &sparse_seg, objects::CSeq_align::TDim row_1, objects::CSeq_align::TDim row_2, CAlnUserOptions::EDirection direction=CAlnUserOptions::eBothDirections, const TAlnSeqIdVec *ids=0)
 Build pairwise alignment from the selected rows of a sparse-seg. More...
 
void ConvertSplicedToPairwiseAln (CPairwiseAln &pairwise_aln, const objects::CSpliced_seg &spliced_seg, objects::CSeq_align::TDim row_1, objects::CSeq_align::TDim row_2, CAlnUserOptions::EDirection direction=CAlnUserOptions::eBothDirections, const TAlnSeqIdVec *ids=0)
 Build pairwise alignment from the selected rows of a spliced-seg. More...
 
void ConvertSeqLocsToPairwiseAln (CPairwiseAln &aln, const objects::CSeq_loc &loc_1, const objects::CSeq_loc &loc_2, CAlnUserOptions::EDirection direction=CAlnUserOptions::eBothDirections)
 Build pairwise alignment from a pair of seq-locs. More...
 
void SeqLocMapperToPairwiseAligns (const objects::CSeq_loc_Mapper_Base &mapper, TPairwiseAlnList &aligns)
 Build a list of pairwise alignments from a seq-loc mapper's mappings. More...
 
template<class _TAlnStats >
CRef< CAnchoredAlnCreateAnchoredAlnFromAln (const _TAlnStats &aln_stats, size_t aln_idx, const CAlnUserOptions &options, objects::CSeq_align::TDim explicit_anchor_row=-1)
 Create an anchored alignment from Seq-align using hints. More...
 
template<class _TAlnStats >
void CreateAnchoredAlnVec (_TAlnStats &aln_stats, TAnchoredAlnVec &out_vec, const CAlnUserOptions &options)
 Create anchored alignment from each seq-align in the stats. More...
 
CRef< CPairwiseAlnCreatePairwiseAlnFromSeqAlign (const objects::CSeq_align &seq_align)
 A simple API that assumes that the seq_align has exactly two rows and you want to create a pairwise with the default policy. More...
 

Typedef Documentation

◆ TAlnSeqIdVec

typedef vector<TAlnSeqIdIRef> TAlnSeqIdVec

Definition at line 52 of file aln_converters.hpp.

◆ TPairwiseAlnList

Definition at line 181 of file aln_converters.hpp.

Function Documentation

◆ ConvertDendiagToPairwiseAln()

void ConvertDendiagToPairwiseAln ( CPairwiseAln pairwise_aln,
const objects::CSeq_align::TSegs::TDendiag dendiags,
objects::CSeq_align::TDim  row_1,
objects::CSeq_align::TDim  row_2,
CAlnUserOptions::EDirection  direction = CAlnUserOptions::eBothDirections,
const TAlnSeqIdVec ids = 0 
)

Build pairwise alignment from the selected rows of a dendiag.

See also
ConvertSeqAlignToPairwiseAln

◆ ConvertDensegToPairwiseAln()

void ConvertDensegToPairwiseAln ( CPairwiseAln pairwise_aln,
const objects::CDense_seg &  ds,
objects::CSeq_align::TDim  row_1,
objects::CSeq_align::TDim  row_2,
CAlnUserOptions::EDirection  direction = CAlnUserOptions::eBothDirections,
const TAlnSeqIdVec ids = 0 
)

Build pairwise alignment from the selected rows of a dense-seg.

See also
ConvertSeqAlignToPairwiseAln

◆ ConvertPackedsegToPairwiseAln()

void ConvertPackedsegToPairwiseAln ( CPairwiseAln pairwise_aln,
const objects::CPacked_seg &  ps,
objects::CSeq_align::TDim  row_1,
objects::CSeq_align::TDim  row_2,
CAlnUserOptions::EDirection  direction = CAlnUserOptions::eBothDirections,
const TAlnSeqIdVec ids = 0 
)

Build pairwise alignment from the selected rows of a packed-seg.

See also
ConvertSeqAlignToPairwiseAln

◆ ConvertSeqAlignToPairwiseAln()

void ConvertSeqAlignToPairwiseAln ( CPairwiseAln pairwise_aln,
const objects::CSeq_align &  sa,
objects::CSeq_align::TDim  row_1,
objects::CSeq_align::TDim  row_2,
CAlnUserOptions::EDirection  direction = CAlnUserOptions::eBothDirections,
const TAlnSeqIdVec ids = 0 
)

Build pairwise alignment from the selected rows of a seq-align.

Parameters
pairwise_alnOutput pairwise alignment. Should be initialized with the correct ids (the functions does not check if the ids in the pairwise alignment correspond to the ids of the selected rows).
saInput seq-align object.
row_1First row index.
row_2Second row index.
directionFlag indicating if the output pairwise alignment should include direct, reverse, or any segments. NOTE: segment direction in pariwise alignments is relative (second vs first row).
idsOptional vector of alignment seq-ids used only to check if the source alignment contains mixed sequence types. All ids from the vector are compared, not just the two selected rows.

Referenced by BOOST_AUTO_TEST_CASE(), CreateAnchoredAlnFromAln(), CAlnTestApp::Run(), s_GetAlignmentSpans_Interval(), s_GetSplicedSegIdentityMismatch(), and CHitMatrixDataSource::x_CreateHits_Diagonal().

◆ ConvertSeqLocsToPairwiseAln()

void ConvertSeqLocsToPairwiseAln ( CPairwiseAln aln,
const objects::CSeq_loc &  loc_1,
const objects::CSeq_loc &  loc_2,
CAlnUserOptions::EDirection  direction = CAlnUserOptions::eBothDirections 
)

Build pairwise alignment from a pair of seq-locs.

Each seq-loc must reference a single sequence.

Parameters
alnOutput pairwise alignment. Should be initialized with the correct ids (the functions does not check if the ids in the pairwise alignment correspond to the ids of the seq-locs).
loc_1First seq-loc.
loc_2Second seq-loc.
directionFlag indicating if the output pairwise alignment should include direct, reverse, or any segments. NOTE: segment direction in pariwise alignments is relative (second vs first row).

Definition at line 793 of file aln_converters.cpp.

References _ASSERT, CAlnUserOptions::eBothDirections, CAlnUserOptions::eDirect, CAlnUserOptions::eReverse, CPairwiseAln::GetFirstBaseWidth(), CRange_Base::GetFrom(), COpenRange< Position >::GetLength(), CSeq_loc_CI::GetRange(), CPairwiseAln::GetSecondBaseWidth(), CSeq_loc_CI::GetStrand(), CAlignRangeCollectionList< TAlnRange >::insert(), CSeq_loc_CI::IsEmpty(), IsReverse(), len, and CPairwiseAln::SetUsingGenomic().

Referenced by CFeatGlyph::x_DrawProjectedRuler(), and CFeatGlyph::x_DrawRuler().

◆ ConvertSparseToPairwiseAln()

void ConvertSparseToPairwiseAln ( CPairwiseAln pairwise_aln,
const objects::CSparse_seg &  sparse_seg,
objects::CSeq_align::TDim  row_1,
objects::CSeq_align::TDim  row_2,
CAlnUserOptions::EDirection  direction = CAlnUserOptions::eBothDirections,
const TAlnSeqIdVec ids = 0 
)

Build pairwise alignment from the selected rows of a sparse-seg.

See also
ConvertSeqAlignToPairwiseAln

◆ ConvertSplicedToPairwiseAln()

void ConvertSplicedToPairwiseAln ( CPairwiseAln pairwise_aln,
const objects::CSpliced_seg &  spliced_seg,
objects::CSeq_align::TDim  row_1,
objects::CSeq_align::TDim  row_2,
CAlnUserOptions::EDirection  direction = CAlnUserOptions::eBothDirections,
const TAlnSeqIdVec ids = 0 
)

Build pairwise alignment from the selected rows of a spliced-seg.

See also
ConvertSeqAlignToPairwiseAln

◆ ConvertStdsegToPairwiseAln()

void ConvertStdsegToPairwiseAln ( CPairwiseAln pairwise_aln,
const objects::CSeq_align::TSegs::TStd &  stds,
objects::CSeq_align::TDim  row_1,
objects::CSeq_align::TDim  row_2,
CAlnUserOptions::EDirection  direction = CAlnUserOptions::eBothDirections,
const TAlnSeqIdVec ids = 0 
)

Build pairwise alignment from the selected rows of an std-seg.

See also
ConvertSeqAlignToPairwiseAln

◆ CreateAnchoredAlnFromAln()

template<class _TAlnStats >
CRef<CAnchoredAln> CreateAnchoredAlnFromAln ( const _TAlnStats &  aln_stats,
size_t  aln_idx,
const CAlnUserOptions options,
objects::CSeq_align::TDim  explicit_anchor_row = -1 
)

Create an anchored alignment from Seq-align using hints.

Optionally, choose the anchor row explicitly (this overrides options.GetAnchorId()). NOTE: Potentially, this "shrinks" the alignment vertically in case some row was not aligned to the anchor.

Parameters
aln_statsInput alignment stats (see CAlnStats template).
aln_idxIndex of the input alignment in the stats.
optionsOptions for building the anchored alignment.
explicit_anchor_rowExplicit anchor row index (this overrides anchor id set in the options). By default the anchor row is selected automatically.
See also
CAlnStats

Definition at line 205 of file aln_converters.hpp.

References _ALNMGR_ASSERT, ConvertSeqAlignToPairwiseAln(), CAlnUserOptions::eDirect, ctll::empty(), CAlignRangeCollectionList< CAlignRange< TSignedSeqPos > >::fAllowMixedDir, CAlignRangeCollectionList< CAlignRange< TSignedSeqPos > >::fAllowOverlap, CAlnUserOptions::fAnchorRowFirst, CAlnUserOptions::fIgnoreInsertions, CAlignRangeCollectionList< CAlignRange< TSignedSeqPos > >::fIgnoreInsertions, map_checker< Container >::find(), CAlignRangeCollectionList< CAlignRange< TSignedSeqPos > >::fKeepNormalized, flags, CAlnUserOptions::GetAnchorId(), CSeq_align_Base::GetSegs(), i, CSeq_align_Base::C_Segs::IsStd(), CAlnUserOptions::m_Direction, CAlnUserOptions::m_MergeFlags, NCBI_THROW, CRef< C, Locker >::Reset(), row, CAnchoredAln::SetAnchorRow(), CAnchoredAln::SetDim(), CAnchoredAln::SetPairwiseAlns(), and ncbi::grid::netcache::search::fields::size.

Referenced by BOOST_AUTO_TEST_CASE(), BuildAlignDataSource(), ConvertSeq_align(), CreateAnchoredAlnVec(), CAlnBuildApp::Run(), and CAlnTestApp::Run().

◆ CreateAnchoredAlnVec()

template<class _TAlnStats >
void CreateAnchoredAlnVec ( _TAlnStats &  aln_stats,
TAnchoredAlnVec out_vec,
const CAlnUserOptions options 
)

◆ CreatePairwiseAlnFromSeqAlign()

CRef<CPairwiseAln> CreatePairwiseAlnFromSeqAlign ( const objects::CSeq_align &  seq_align)

A simple API that assumes that the seq_align has exactly two rows and you want to create a pairwise with the default policy.

See also
ConvertSeqAlignToPairwiseAln

Referenced by CScoreBuilder::GetBlastScoreSpliced(), and CScoreBuilder::GetBlastScoreStd().

◆ SeqLocMapperToPairwiseAligns()

void SeqLocMapperToPairwiseAligns ( const objects::CSeq_loc_Mapper_Base &  mapper,
TPairwiseAlnList aligns 
)
Modified on Tue Jul 09 14:23:39 2024 by modify_doxy.py rev. 669887