NCBI C++ ToolKit
|
#include <ncbi_pch.hpp>
#include <objects/seqalign/Dense_seg.hpp>
#include <objects/seqalign/Std_seg.hpp>
#include <objects/seqalign/Seq_align_set.hpp>
#include <objects/seqalign/Dense_diag.hpp>
#include <objects/seqalign/Sparse_seg.hpp>
#include <objects/seqalign/Spliced_seg.hpp>
#include <objects/seqalign/Spliced_exon.hpp>
#include <objects/seqalign/Spliced_exon_chunk.hpp>
#include <objects/seqalign/Product_pos.hpp>
#include <objects/seqalign/Prot_pos.hpp>
#include <objmgr/scope.hpp>
#include <objmgr/bioseq_handle.hpp>
#include <objects/seqloc/Seq_loc.hpp>
#include <objects/seqloc/Seq_id.hpp>
#include <objtools/alnmgr/aln_generators.hpp>
#include <objtools/alnmgr/alnexception.hpp>
#include <objtools/alnmgr/aln_serial.hpp>
#include <objtools/alnmgr/aln_converters.hpp>
#include <util/range_set.hpp>
#include <serial/typeinfo.hpp>
Go to the source code of this file.
Go to the SVN repository for this file.
Classes | |
class | CSegmentedRangeCollection |
Macros | |
#define | USE_RANGE_SET |
#define | CRangeCollection CRangeSet |
Typedefs | |
typedef CAnchoredAln::TDim | TDim |
Variables | |
static const TSignedSeqPos | kMaxSplicedExonIndelLength = 15 |
#define CRangeCollection CRangeSet |
Definition at line 61 of file aln_generators.cpp.
#define USE_RANGE_SET |
Definition at line 58 of file aln_generators.cpp.
typedef CAnchoredAln::TDim TDim |
Definition at line 767 of file aln_generators.cpp.
CRef<CSeq_align> ConvertSeq_align | ( | const CSeq_align & | src, |
CSeq_align::TSegs::E_Choice | dst_choice, | ||
CSeq_align::TDim | anchor_row = -1 , |
||
CScope * | scope = NULL |
||
) |
Convert source alignment to a new type.
For spliced-segs the anchor_row is used as product row.
Definition at line 1162 of file aln_generators.cpp.
References CreateAnchoredAlnFromAln(), CreateSeqAlignFromAnchoredAln(), and CAlnIdMap< _TAlnVec, TAlnSeqIdExtract >::push_back().
Referenced by CScoreBuilder::GetBlastScoreStd(), and s_GetRnaMappingLocs().
CRef<CSeq_align_set> CreateAlignSetFromAnchoredAln | ( | const CAnchoredAln & | anchored_aln, |
CScope * | scope | ||
) |
Definition at line 829 of file aln_generators.cpp.
References _ASSERT, eNa_strand_minus, eNa_strand_plus, eNa_strand_unknown, CSeq_align_Base::eType_not_set, CAnchoredAln::GetDim(), CAnchoredAln::GetId(), GetLength(), CAnchoredAln::GetPairwiseAlns(), i, ITERATE, NCBI_THROW, row, CSeq_align_set_Base::Set(), CDense_seg_Base::SetDim(), CSeq_align_Base::SetDim(), CDense_seg_Base::SetIds(), CDense_seg_Base::SetLens(), CDense_seg_Base::SetNumseg(), CSeq_align_Base::SetSegs(), CDense_seg_Base::SetStarts(), CDense_seg_Base::SetStrands(), and CSeq_align_Base::SetType().
Referenced by CreateSeqAlignFromAnchoredAln().
CRef<CSeq_align_set> CreateAlignSetFromPairwiseAln | ( | const CPairwiseAln & | pairwise_aln, |
CScope * | scope | ||
) |
Definition at line 937 of file aln_generators.cpp.
References eNa_strand_minus, eNa_strand_plus, eNa_strand_unknown, CSeq_align_Base::eType_not_set, CPairwiseAln::GetFirstId(), CPairwiseAln::GetSecondId(), i, CDense_seg_Base::IsSetStrands(), ITERATE, CSeq_align_set_Base::Set(), CDense_seg_Base::SetDim(), CSeq_align_Base::SetDim(), CDense_seg_Base::SetIds(), CDense_seg_Base::SetLens(), CDense_seg_Base::SetNumseg(), CSeq_align_Base::SetSegs(), CDense_seg_Base::SetStarts(), CDense_seg_Base::SetStrands(), CSeq_align_Base::SetType(), and CAlignRangeCollectionList< TAlnRange >::size().
Referenced by CreateSeqAlignFromEachPairwiseAln(), and CreateSeqAlignFromPairwiseAln().
void CreateDense_diagFromAnchoredAln | ( | CSeq_align::TSegs::TDendiag & | dd, |
const CAnchoredAln & | anchored_aln, | ||
CScope * | scope | ||
) |
Definition at line 224 of file aln_generators.cpp.
References _ASSERT, eNa_strand_minus, eNa_strand_plus, CAnchoredAln::GetDim(), CAnchoredAln::GetId(), GetLength(), CAnchoredAln::GetPairwiseAlns(), CDense_diag_Base::GetStarts(), ITERATE, kInvalidSeqPos, NCBI_THROW, NON_CONST_ITERATE, row, CDense_diag_Base::SetDim(), CDense_diag_Base::SetIds(), CDense_diag_Base::SetStarts(), CDense_diag_Base::SetStrands(), and CDense_diag::Validate().
Referenced by CreateSeqAlignFromAnchoredAln().
CRef<CDense_seg> CreateDensegFromAnchoredAln | ( | const CAnchoredAln & | anchored_aln, |
CScope * | scope | ||
) |
Definition at line 332 of file aln_generators.cpp.
References _ASSERT, eNa_strand_minus, eNa_strand_plus, eNa_strand_unknown, CAnchoredAln::GetDim(), CAnchoredAln::GetId(), GetLength(), CAnchoredAln::GetPairwiseAlns(), ITERATE, NCBI_THROW, row, CDense_seg_Base::SetDim(), CDense_seg_Base::SetIds(), CDense_seg_Base::SetLens(), CDense_seg_Base::SetNumseg(), CDense_seg_Base::SetStarts(), CDense_seg_Base::SetStrands(), and CDense_seg::Validate().
Referenced by CreateSeqAlignFromAnchoredAln().
CRef<CDense_seg> CreateDensegFromPairwiseAln | ( | const CPairwiseAln & | pairwise_aln, |
CScope * | scope | ||
) |
Definition at line 442 of file aln_generators.cpp.
References _ASSERT, eNa_strand_minus, eNa_strand_plus, CPairwiseAln::GetFirstId(), CPairwiseAln::GetSecondId(), CDense_seg_Base::IsSetStrands(), ITERATE, CDense_seg_Base::SetDim(), CDense_seg_Base::SetIds(), CDense_seg_Base::SetLens(), CDense_seg_Base::SetNumseg(), CDense_seg_Base::SetStarts(), CDense_seg_Base::SetStrands(), CAlignRangeCollectionList< TAlnRange >::size(), and CDense_seg::Validate().
Referenced by CAlignCleanup::CreatePairwiseFromMultiple(), CreateSeqAlignFromEachPairwiseAln(), CreateSeqAlignFromPairwiseAln(), and CAlnBuildApp::Run().
CRef<CPacked_seg> CreatePackedsegFromAnchoredAln | ( | const CAnchoredAln & | anchored_aln, |
CScope * | scope | ||
) |
Definition at line 989 of file aln_generators.cpp.
References _ASSERT, eNa_strand_minus, eNa_strand_plus, eNa_strand_unknown, CAnchoredAln::GetDim(), CAnchoredAln::GetId(), GetLength(), CAnchoredAln::GetPairwiseAlns(), ITERATE, kInvalidSeqPos, NCBI_THROW, CRef< C, Locker >::Reset(), and row.
Referenced by CreateSeqAlignFromAnchoredAln().
CRef<CPacked_seg> CreatePackedsegFromPairwiseAln | ( | const CPairwiseAln & | pairwise_aln, |
CScope * | scope | ||
) |
Definition at line 1102 of file aln_generators.cpp.
References _ASSERT, eNa_strand_minus, eNa_strand_plus, CPairwiseAln::GetFirstId(), CPairwiseAln::GetSecondId(), ITERATE, kInvalidSeqPos, CRef< C, Locker >::Reset(), and CAlignRangeCollectionList< TAlnRange >::size().
Referenced by CreateSeqAlignFromEachPairwiseAln(), and CreateSeqAlignFromPairwiseAln().
CRef<CSeq_align> CreateSeqAlignFromAnchoredAln | ( | const CAnchoredAln & | anchored_aln, |
CSeq_align::TSegs::E_Choice | choice, | ||
CScope * | scope | ||
) |
Convert CAnchoredAln to seq-align of the selected type.
Definition at line 73 of file aln_generators.cpp.
References CreateAlignSetFromAnchoredAln(), CreateDense_diagFromAnchoredAln(), CreateDensegFromAnchoredAln(), CreatePackedsegFromAnchoredAln(), CreateSplicedsegFromAnchoredAln(), CSeq_align_Base::C_Segs::e_Dendiag, CSeq_align_Base::C_Segs::e_Denseg, CSeq_align_Base::C_Segs::e_Disc, CSeq_align_Base::C_Segs::e_not_set, CSeq_align_Base::C_Segs::e_Packed, CSeq_align_Base::C_Segs::e_Sparse, CSeq_align_Base::C_Segs::e_Spliced, CSeq_align_Base::C_Segs::e_Std, CSeq_align_Base::eType_not_set, CAnchoredAln::GetDim(), NCBI_THROW, CSeq_align_Base::SetDim(), CSeq_align_Base::SetSegs(), and CSeq_align_Base::SetType().
Referenced by BOOST_AUTO_TEST_CASE(), ConvertSeq_align(), CAlnBuildApp::Run(), and CAlignCleanup::x_Cleanup_AnchoredAln().
void CreateSeqAlignFromEachPairwiseAln | ( | const CAnchoredAln::TPairwiseAlnVector | pairwises, |
CAnchoredAln::TDim | anchor, | ||
vector< CRef< CSeq_align > > & | out_seqaligns, | ||
CSeq_align::TSegs::E_Choice | choice, | ||
CScope * | scope = NULL |
||
) |
Create seq-align from each of the pairwise alignments vs the selected anchor row.
Each pairwise alignment's second sequence is aligned to the anchor pairwise alignment's second sequence. The output alignments contain only aligned segments, no gaps are included.
pariwises | Input vector of CPairwiseAln. |
anchor | Index of the pairwise alignment to be used as the anchor. |
out_seqaligns | Output vector of seq-aligns. Number of objects put in the vector is size of the input vector less one (the anchor is not aligned to itself). |
choice | Type of the output seq-aligns. |
scope | Optional scope (not required to build most seq-align types). |
Definition at line 770 of file aln_generators.cpp.
References CreateAlignSetFromPairwiseAln(), CreateDensegFromPairwiseAln(), CreatePackedsegFromPairwiseAln(), CreateSplicedsegFromPairwiseAln(), CSeq_align_Base::C_Segs::e_Dendiag, CSeq_align_Base::C_Segs::e_Denseg, CSeq_align_Base::C_Segs::e_Disc, CSeq_align_Base::C_Segs::e_not_set, CSeq_align_Base::C_Segs::e_Packed, CSeq_align_Base::C_Segs::e_Sparse, CSeq_align_Base::C_Segs::e_Spliced, CSeq_align_Base::C_Segs::e_Std, CSeq_align_Base::eType_partial, CAlignRangeCollectionList< TAlnRange >::GetFlags(), CPairwiseAln::GetSecondId(), NCBI_THROW, row, s_TranslatePairwise(), CSeq_align_Base::SetDim(), CSeq_align_Base::SetSegs(), and CSeq_align_Base::SetType().
Referenced by CAlnBuildApp::Run(), CAlignCleanup::x_Cleanup_AnchoredAln(), and CMergeAlignmentsJob::x_CreateProjectItems().
CRef<CSeq_align> CreateSeqAlignFromPairwiseAln | ( | const CPairwiseAln & | pairwise_aln, |
CSeq_align::TSegs::E_Choice | choice, | ||
CScope * | scope | ||
) |
Convert CPairwiseAln to seq-align of the selected type.
Definition at line 115 of file aln_generators.cpp.
References CreateAlignSetFromPairwiseAln(), CreateDensegFromPairwiseAln(), CreatePackedsegFromPairwiseAln(), CreateSplicedsegFromPairwiseAln(), CSeq_align_Base::C_Segs::e_Dendiag, CSeq_align_Base::C_Segs::e_Denseg, CSeq_align_Base::C_Segs::e_Disc, CSeq_align_Base::C_Segs::e_not_set, CSeq_align_Base::C_Segs::e_Packed, CSeq_align_Base::C_Segs::e_Sparse, CSeq_align_Base::C_Segs::e_Spliced, CSeq_align_Base::C_Segs::e_Std, CSeq_align_Base::eType_not_set, NCBI_THROW, CSeq_align_Base::SetDim(), CSeq_align_Base::SetSegs(), and CSeq_align_Base::SetType().
CRef<CSpliced_seg> CreateSplicedsegFromAnchoredAln | ( | const CAnchoredAln & | anchored_aln, |
CScope * | scope | ||
) |
Definition at line 721 of file aln_generators.cpp.
References _ASSERT, CAnchoredAln::GetAnchorRow(), CAnchoredAln::GetDim(), CAnchoredAln::GetPairwiseAlns(), and InitSplicedsegFromPairwiseAln().
Referenced by CreateSeqAlignFromAnchoredAln().
CRef<CSpliced_seg> CreateSplicedsegFromPairwiseAln | ( | const CPairwiseAln & | pairwise_aln, |
CScope * | scope | ||
) |
Definition at line 743 of file aln_generators.cpp.
References InitSplicedsegFromPairwiseAln().
Referenced by CreateSeqAlignFromEachPairwiseAln(), and CreateSeqAlignFromPairwiseAln().
void InitSplicedsegFromPairwiseAln | ( | CSpliced_seg & | spliced_seg, |
const CPairwiseAln & | pairwise_aln, | ||
CScope * | scope | ||
) |
Definition at line 502 of file aln_generators.cpp.
References _ASSERT, CSeq_id::Assign(), CAlignRangeCollectionList< TAlnRange >::begin(), eNa_strand_minus, eNa_strand_plus, CAlignRangeCollectionList< TAlnRange >::end(), CSpliced_seg_Base::eProduct_type_protein, CSpliced_seg_Base::eProduct_type_transcript, CAlignRangeCollectionList< CAlignRange< TSignedSeqPos > >::fMixedDir, CScope::GetBioseqHandle(), CBioseq_Handle::GetBioseqLength(), CPairwiseAln::GetFirstBaseWidth(), CAlignRange< Position >::GetFirstFrom(), CPairwiseAln::GetFirstId(), CAlignRange< Position >::GetFirstTo(), CAlignRange< Position >::GetFirstToOpen(), CAlignRangeCollectionList< TAlnRange >::GetFlags(), CAlignRange< Position >::GetLength(), CPairwiseAln::GetSecondBaseWidth(), CAlignRange< Position >::GetSecondFrom(), CPairwiseAln::GetSecondId(), CAlignRange< Position >::GetSecondTo(), CAlignRange< Position >::GetSecondToOpen(), ITERATE, kInvalidSeqPos, kMaxSplicedExonIndelLength, min(), prot, CRef< C, Locker >::Reset(), CSpliced_seg_Base::SetExons(), CSpliced_seg_Base::SetGenomic_id(), CSpliced_seg_Base::SetProduct_id(), CSpliced_seg_Base::SetProduct_type(), and CSpliced_seg::Validate().
Referenced by CreateSplicedsegFromAnchoredAln(), and CreateSplicedsegFromPairwiseAln().
void s_TranslatePairwise | ( | CPairwiseAln & | out_pw, |
const CPairwiseAln & | pw, | ||
const CPairwiseAln & | tr | ||
) |
Definition at line 753 of file aln_generators.cpp.
References CAlignRange< Position >::GetFirstFrom(), CAlignRangeCollectionList< TAlnRange >::GetSecondPosByFirstPos(), CAlignRangeCollectionList< TAlnRange >::insert(), ITERATE, and CAlignRange< Position >::SetFirstFrom().
Referenced by CreateSeqAlignFromEachPairwiseAln().
USING_SCOPE | ( | objects | ) |
|
static |
Definition at line 500 of file aln_generators.cpp.
Referenced by InitSplicedsegFromPairwiseAln().