CSeq_align Class Reference

Represents ASN.1 type Seq-align defined in file seqalign.asn

Search Toolkit Book for CSeq_align

#include <Seq_align.hpp>

Inheritance diagram for CSeq_align:

Inheritance graph
[legend]
Collaboration diagram for CSeq_align:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 54 of file Seq_align.hpp.

Public Types

enum  EScoreType {
  eScore_Score, eScore_BitScore, eScore_EValue, eScore_IdentityCount,
  eScore_MismatchCount, eScore_PercentIdentity, eScore_PercentCoverage, eScore_SumEValue,
  eScore_CompAdjMethod
}
 enum controlling known named scores More...

Public Member Functions

 CSeq_align (void)
 constructor
 ~CSeq_align (void)
 destructor
TDim CheckNumRows (void) const
 Validatiors.
void Validate (bool full_test=false) const
CRange< TSeqPosGetSeqRange (TDim row) const
 GetSeqRange NB: On a Spliced-seg, in case the product-type is protein, these only return the amin part of Prot-pos.
TSeqPos GetSeqStart (TDim row) const
TSeqPos GetSeqStop (TDim row) const
TSeqPos GetTotalGapCount () const
 Retrieves the total number of gaps in an alignment
Exceptions:
CSeqalignException if alignment type is not supported.

TSeqPos GetNumGapOpenings () const
 Retrieves the number of gap openings in an alignment (ignoring how many gaps are in the gapped region)
Exceptions:
CSeqalignException if alignment type is not supported.

ENa_strand GetSeqStrand (TDim row) const
 Get strand (the first one if segments have different strands).
const CSeq_idGetSeq_id (TDim row) const
 Get seq-id (the first one if segments have different ids).
bool GetNamedScore (const string &id, int &score) const
 Get score.
bool GetNamedScore (const string &id, double &score) const
 --------------------------------------------------------------------------- PRE : name of score to return POST: whether or not we found that score; score converted to double
bool GetNamedScore (EScoreType type, int &score) const
bool GetNamedScore (EScoreType type, double &score) const
void SetNamedScore (const string &id, int score)
void SetNamedScore (const string &id, double score)
void SetNamedScore (EScoreType type, int score)
void SetNamedScore (EScoreType type, double score)
void Reverse (void)
 Reverse the segments' orientation NOTE: currently *only* works for dense-seg.
void SwapRows (TDim row1, TDim row2)
 Swap the position of two rows in the alignment NOTE: currently *only* works for dense-seg & disc.
CRef< CSeq_alignCreateDensegFromStdseg (SSeqIdChooser *SeqIdChooser=0) const
 ---------------------------------------------------------------------------- PRE : the Seq-align has StdSeg segs POST: Seq_align of type Dense-seg is created with m_Widths if necessary
CRef< CSeq_alignCreateDensegFromDisc (SSeqIdChooser *SeqIdChooser=0) const
CRef< CSeq_alignCreateTranslatedDensegFromNADenseg (void) const
 Create a Dense-seg with widths from Dense-seg of nucleotides Used by AlnMgr to handle translated nucl2nucl alignments IMPORTANT NOTE: Do *NOT* use for alignments containing proteins; the code will not check for this.
void OffsetRow (TDim row, TSignedSeqPos offset)
 Offset row's coords.
NCBI_DEPRECATED void RemapToLoc (TDim row, const CSeq_loc &dst_loc, bool ignore_strand=false)

Protected Member Functions

CConstRef< CScorex_GetNamedScore (const string &name) const
 retrieve a named score object
CRef< CScorex_SetNamedScore (const string &name)

Private Types

typedef CSeq_align_Base Tparent

Private Member Functions

 CSeq_align (const CSeq_align &value)
 Prohibit copy constructor and assignment operator.
CSeq_alignoperator= (const CSeq_align &value)

Classes

struct  SSeqIdChooser
 NOTE: Here we assume that the same rows on different segments contain the same sequence. More...


Member Typedef Documentation

typedef CSeq_align_Base CSeq_align::Tparent [private]
 

Reimplemented from CSeq_align_Base.

Definition at line 56 of file Seq_align.hpp.


Member Enumeration Documentation

enum CSeq_align::EScoreType
 

enum controlling known named scores

Enumerator:
eScore_Score 
eScore_BitScore 
eScore_EValue 
eScore_IdentityCount 
eScore_MismatchCount 
eScore_PercentIdentity 
eScore_PercentCoverage 
eScore_SumEValue 
eScore_CompAdjMethod 

Definition at line 59 of file Seq_align.hpp.


Constructor & Destructor Documentation

CSeq_align::CSeq_align void   )  [inline]
 

constructor

Definition at line 213 of file Seq_align.hpp.

CSeq_align::~CSeq_align void   ) 
 

destructor

Definition at line 65 of file Seq_align.cpp.

CSeq_align::CSeq_align const CSeq_align value  )  [private]
 

Prohibit copy constructor and assignment operator.


Member Function Documentation

CSeq_align::TDim CSeq_align::CheckNumRows void   )  const
 

Validatiors.

Definition at line 70 of file Seq_align.cpp.

References CSeq_align_Base::GetSegs(), ITERATE, and NCBI_THROW.

Referenced by Validate().

CRef< CSeq_align > CSeq_align::CreateDensegFromDisc SSeqIdChooser SeqIdChooser = 0  )  const
 

Order the discontinuous densegs

First pass: determine dim & numseg

Numseg

Dim

Strands?

Multiply the strands by the number of segments.

Second pass: validate and set ids and starts

Ids

Starts

Perform full test (including segment starts consistency check)

Definition at line 846 of file Seq_align.cpp.

References CSeq_align_Base::eType_not_set, CSeq_align_Base::GetScore(), CSeq_align_Base::GetSegs(), CDense_seg::GetSeqStart(), CDense_seg_Base::GetStrands(), CSeq_align_Base::IsSetScore(), CDense_seg_Base::IsSetStrands(), ITERATE, NCBI_THROW, CDense_seg_Base::SetDim(), CDense_seg_Base::SetNumseg(), and size.

CRef< CSeq_align > CSeq_align::CreateDensegFromStdseg SSeqIdChooser SeqIdChooser = 0  )  const
 

---------------------------------------------------------------------------- PRE : the Seq-align has StdSeg segs POST: Seq_align of type Dense-seg is created with m_Widths if necessary

Definition at line 553 of file Seq_align.cpp.

References eNa_strand_unknown, CSeq_align_Base::eType_not_set, CStd_seg_Base::GetLoc(), CSeq_align_Base::GetScore(), CSeq_align_Base::GetSegs(), CSeq_align_Base::IsSetScore(), ITERATE, NCBI_THROW, CDense_seg_Base::SetLens(), CDense_seg_Base::SetStarts(), CDense_seg_Base::SetStrands(), and CDense_seg::SetWidths().

Referenced by s_SeqAlignSetToXMLHsps().

CRef< CSeq_align > CSeq_align::CreateTranslatedDensegFromNADenseg void   )  const
 

Create a Dense-seg with widths from Dense-seg of nucleotides Used by AlnMgr to handle translated nucl2nucl alignments IMPORTANT NOTE: Do *NOT* use for alignments containing proteins; the code will not check for this.

Definition at line 784 of file Seq_align.cpp.

References CSeq_align_Base::eType_not_set, CDense_seg_Base::GetNumseg(), CSeq_align_Base::GetSegs(), NStr::IntToString(), NCBI_THROW, and CDense_seg_Base::SetLens().

bool CSeq_align::GetNamedScore EScoreType  type,
double &  score
const
 

Definition at line 443 of file Seq_align.cpp.

References GetNamedScore(), and sc_ScoreNames.

bool CSeq_align::GetNamedScore EScoreType  type,
int &  score
const
 

Definition at line 438 of file Seq_align.cpp.

References GetNamedScore(), and sc_ScoreNames.

bool CSeq_align::GetNamedScore const string &  id,
double &  score
const
 

--------------------------------------------------------------------------- PRE : name of score to return POST: whether or not we found that score; score converted to double

Definition at line 423 of file Seq_align.cpp.

References x_GetNamedScore().

bool CSeq_align::GetNamedScore const string &  id,
int &  score
const
 

Get score.

Definition at line 406 of file Seq_align.cpp.

References x_GetNamedScore().

Referenced by BOOST_AUTO_TEST_CASE(), and GetNamedScore().

TSeqPos CSeq_align::GetNumGapOpenings  )  const
 

Retrieves the number of gap openings in an alignment (ignoring how many gaps are in the gapped region)

Exceptions:
CSeqalignException if alignment type is not supported.

Definition at line 1209 of file Seq_align.cpp.

References s_GetGapCount().

const CSeq_id & CSeq_align::GetSeq_id TDim  row  )  const
 

Get seq-id (the first one if segments have different ids).

Throw exception if row is invalid.

Definition at line 265 of file Seq_align.cpp.

References CSeq_align_Base::GetSegs(), ITERATE, and size.

Referenced by s_SeqAlignSetToXMLHsps().

CRange< TSeqPos > CSeq_align::GetSeqRange TDim  row  )  const
 

GetSeqRange NB: On a Spliced-seg, in case the product-type is protein, these only return the amin part of Prot-pos.

The frame is ignored.

Definition at line 126 of file Seq_align.cpp.

References CSeq_id::Assign(), CSeq_align_Base::CanGetDim(), COpenRange< Position >::CombineWith(), CSeq_id::Compare(), CSeq_id::e_YES, CSeq_align_Base::GetDim(), CSeq_align_Base::GetSegs(), ITERATE, and NCBI_THROW.

Referenced by GetSeqStart(), and GetSeqStop().

TSeqPos CSeq_align::GetSeqStart TDim  row  )  const
 

Definition at line 208 of file Seq_align.cpp.

References COpenRange< Position >::GetFrom(), CSeq_align_Base::GetSegs(), GetSeqRange(), and NCBI_THROW.

TSeqPos CSeq_align::GetSeqStop TDim  row  )  const
 

Definition at line 226 of file Seq_align.cpp.

References CSeq_align_Base::GetSegs(), GetSeqRange(), COpenRange< Position >::GetTo(), and NCBI_THROW.

ENa_strand CSeq_align::GetSeqStrand TDim  row  )  const
 

Get strand (the first one if segments have different strands).

Definition at line 244 of file Seq_align.cpp.

References CSeq_align_Base::GetSegs(), and NCBI_THROW.

Referenced by s_GetSeqStrand().

TSeqPos CSeq_align::GetTotalGapCount  )  const
 

Retrieves the total number of gaps in an alignment

Exceptions:
CSeqalignException if alignment type is not supported.

Definition at line 1203 of file Seq_align.cpp.

References s_GetGapCount().

void CSeq_align::OffsetRow TDim  row,
TSignedSeqPos  offset
 

Offset row's coords.

Definition at line 1014 of file Seq_align.cpp.

References NCBI_THROW, NON_CONST_ITERATE, and CSeq_align_Base::SetSegs().

CSeq_align& CSeq_align::operator= const CSeq_align value  )  [private]
 

void CSeq_align::RemapToLoc TDim  row,
const CSeq_loc dst_loc,
bool  ignore_strand = false
 

See also:
RemapAlignToLoc

Definition at line 1047 of file Seq_align.cpp.

References CSeq_loc_Base::e_Int, CSeq_loc_Base::e_Whole, NCBI_THROW, and CSeq_loc_Base::Which().

void CSeq_align::Reverse void   ) 
 

Reverse the segments' orientation NOTE: currently *only* works for dense-seg.

Definition at line 510 of file Seq_align.cpp.

References CSeq_align_Base::GetSegs(), NCBI_THROW, and CSeq_align_Base::SetSegs().

void CSeq_align::SetNamedScore EScoreType  type,
double  score
 

Definition at line 455 of file Seq_align.cpp.

References sc_ScoreNames, and x_SetNamedScore().

void CSeq_align::SetNamedScore EScoreType  type,
int  score
 

Definition at line 449 of file Seq_align.cpp.

References sc_ScoreNames, and x_SetNamedScore().

void CSeq_align::SetNamedScore const string &  id,
double  score
 

Definition at line 467 of file Seq_align.cpp.

References x_SetNamedScore().

void CSeq_align::SetNamedScore const string &  id,
int  score
 

Definition at line 461 of file Seq_align.cpp.

References x_SetNamedScore().

void CSeq_align::SwapRows TDim  row1,
TDim  row2
 

Swap the position of two rows in the alignment NOTE: currently *only* works for dense-seg & disc.

Definition at line 526 of file Seq_align.cpp.

References CSeq_align_Base::GetSegs(), NCBI_THROW, NON_CONST_ITERATE, and CSeq_align_Base::SetSegs().

void CSeq_align::Validate bool  full_test = false  )  const
 

Definition at line 474 of file Seq_align.cpp.

References CheckNumRows(), CSeq_align_Base::GetSegs(), ITERATE, and NCBI_THROW.

Referenced by CAlnContainer::insert(), CSeqAlignContainer::insert(), CPairwiseAlnApp::InsertAln(), CAlnTestApp::InsertAln(), CAlnBuildApp::InsertAln(), and CAlnIdMap< _TAlnVec, TAlnSeqIdExtract >::push_back().

CConstRef< CScore > CSeq_align::x_GetNamedScore const string &  name  )  const [protected]
 

retrieve a named score object

Definition at line 363 of file Seq_align.cpp.

References CSeq_align_Base::GetScore(), CSeq_align_Base::IsSetScore(), and ITERATE.

Referenced by GetNamedScore().

CRef< CScore > CSeq_align::x_SetNamedScore const string &  name  )  [protected]
 

Definition at line 380 of file Seq_align.cpp.

References CSeq_align_Base::IsSetScore(), NON_CONST_ITERATE, and CSeq_align_Base::SetScore().

Referenced by SetNamedScore().


The documentation for this class was generated from the following files:
Generated on Mon Dec 7 14:01:48 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Mon Dec 07 16:23:55 2009 by modify_doxy.py rev. 173732