NCBI C++ ToolKit
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
CScoreBuilderBase Class Reference

Search Toolkit Book for CScoreBuilderBase

#include <objtools/alnmgr/score_builder_base.hpp>

+ Inheritance diagram for CScoreBuilderBase:

Public Types

enum  EScoreType {
  eScore_Blast , eScore_Blast_BitScore , eScore_Blast_EValue , eScore_IdentityCount ,
  eScore_MismatchCount , eScore_PercentIdentity , eScore_PercentCoverage
}
 
enum  EErrorMode { eError_Silent , eError_Report , eError_Throw }
 Error handling while adding scores that are not implemented or unsupported (cannot be defined) for certain types of alignments. More...
 

Public Member Functions

 CScoreBuilderBase ()
 Default constructor. More...
 
virtual ~CScoreBuilderBase ()
 Destructor. More...
 
Functions to add scores directly to Seq-aligns
EErrorMode GetErrorMode (void) const
 
void SetErrorMode (EErrorMode mode)
 
void AddScore (CScope &scope, CSeq_align &align, CSeq_align::EScoreType score)
 
void AddScore (CScope &scope, list< CRef< CSeq_align > > &aligns, CSeq_align::EScoreType score)
 

Private Member Functions

void x_GetMatrixCounts (CScope &scope, const CSeq_align &align, int *positives, int *negatives)
 

Private Attributes

EErrorMode m_ErrorMode
 
string m_SubstMatrixName
 

Functions to compute scores without adding

enum  EPercentIdentityType { eGapped , eUngapped , eGBDNA }
 Compute percent identity (range 0-100) More...
 
double ComputeScore (CScope &scope, const CSeq_align &align, CSeq_align::EScoreType score)
 
double ComputeScore (CScope &scope, const CSeq_align &align, const TSeqRange &range, CSeq_align::EScoreType score)
 
virtual double ComputeScore (CScope &scope, const CSeq_align &align, const CRangeCollection< TSeqPos > &ranges, CSeq_align::EScoreType score)
 
void AddSplignScores (const CSeq_align &align, CSeq_align::TScore &scores)
 Compute the six splign scores. More...
 
void AddSplignScores (CSeq_align &align)
 
double GetPercentIdentity (CScope &scope, const CSeq_align &align, EPercentIdentityType type=eGapped)
 
double GetPercentCoverage (CScope &scope, const CSeq_align &align, unsigned query=0)
 Compute percent coverage of the query (sequence 0) (range 0-100) More...
 
double GetPercentIdentity (CScope &scope, const CSeq_align &align, const TSeqRange &range, EPercentIdentityType type=eGapped)
 Compute percent identity or coverage of the query within specified range. More...
 
double GetPercentCoverage (CScope &scope, const CSeq_align &align, const TSeqRange &range, unsigned query=0)
 
double GetPercentIdentity (CScope &scope, const CSeq_align &align, const CRangeCollection< TSeqPos > &ranges, EPercentIdentityType type=eGapped)
 Compute percent identity or coverage of the query within specified collection of ranges. More...
 
double GetPercentCoverage (CScope &scope, const CSeq_align &align, const CRangeCollection< TSeqPos > &ranges, unsigned query=0)
 
int GetIdentityCount (CScope &scope, const CSeq_align &align)
 Compute the number of identities in the alignment. More...
 
int GetMismatchCount (CScope &scope, const CSeq_align &align)
 Compute the number of mismatches in the alignment. More...
 
void GetMismatchCount (CScope &scope, const CSeq_align &align, int &identities, int &mismatches)
 
int GetIdentityCount (CScope &scope, const CSeq_align &align, const TSeqRange &range)
 Compute identity and/or mismatch counts within specified range. More...
 
int GetMismatchCount (CScope &scope, const CSeq_align &align, const TSeqRange &range)
 
void GetMismatchCount (CScope &scope, const CSeq_align &align, const TSeqRange &range, int &identities, int &mismatches)
 
int GetIdentityCount (CScope &scope, const CSeq_align &align, const CRangeCollection< TSeqPos > &ranges)
 Compute identity and/or mismatch counts within specified collection of ranges. More...
 
int GetMismatchCount (CScope &scope, const CSeq_align &align, const CRangeCollection< TSeqPos > &ranges)
 
void GetMismatchCount (CScope &scope, const CSeq_align &align, const CRangeCollection< TSeqPos > &ranges, int &identities, int &mismatches)
 
int GetPositiveCount (CScope &scope, const CSeq_align &align)
 counts based on substitution matrix for protein alignments More...
 
int GetNegativeCount (CScope &scope, const CSeq_align &align)
 
void GetMatrixCounts (CScope &scope, const CSeq_align &align, int &positives, int &negatives)
 
int GetGapCount (const CSeq_align &align)
 Compute the number of gaps in the alignment. More...
 
int GetGapCount (const CSeq_align &align, const TSeqRange &range)
 
int GetGapCount (const CSeq_align &align, const CRangeCollection< TSeqPos > &ranges)
 
int GetGapBaseCount (const CSeq_align &align)
 Compute the number of gap bases in the alignment (= length of all gap segments) More...
 
int GetGapBaseCount (const CSeq_align &align, const TSeqRange &range)
 
int GetGapBaseCount (const CSeq_align &align, const CRangeCollection< TSeqPos > &ranges)
 
TSeqPos GetAlignLength (const CSeq_align &align, bool ungapped=false)
 Compute the length of the alignment (= length of all segments, gaps + aligned) More...
 
TSeqPos GetAlignLength (const CSeq_align &align, const TSeqRange &range, bool ungapped=false)
 
TSeqPos GetAlignLength (const CSeq_align &align, const CRangeCollection< TSeqPos > &ranges, bool ungapped=false)
 
void SetSubstMatrix (const string &name)
 

Detailed Description

Definition at line 44 of file score_builder_base.hpp.

Member Enumeration Documentation

◆ EErrorMode

Error handling while adding scores that are not implemented or unsupported (cannot be defined) for certain types of alignments.

Transient errors, such as problems retrieving sequence data, will always throw.

Enumerator
eError_Silent 

Try to ignore errors, continue adding scores.

eError_Report 

Print error messages, but do not fail.

eError_Throw 

Throw exceptions on errors.

Definition at line 85 of file score_builder_base.hpp.

◆ EPercentIdentityType

Compute percent identity (range 0-100)

Enumerator
eGapped 
eUngapped 
eGBDNA 

Definition at line 127 of file score_builder_base.hpp.

◆ EScoreType

Enumerator
eScore_Blast 
eScore_Blast_BitScore 
eScore_Blast_EValue 
eScore_IdentityCount 
eScore_MismatchCount 
eScore_PercentIdentity 
eScore_PercentCoverage 

Definition at line 51 of file score_builder_base.hpp.

Constructor & Destructor Documentation

◆ CScoreBuilderBase()

CScoreBuilderBase::CScoreBuilderBase ( )

Default constructor.

Definition at line 66 of file score_builder_base.cpp.

◆ ~CScoreBuilderBase()

CScoreBuilderBase::~CScoreBuilderBase ( )
virtual

Destructor.

Definition at line 73 of file score_builder_base.cpp.

Member Function Documentation

◆ AddScore() [1/2]

void CScoreBuilderBase::AddScore ( CScope scope,
CSeq_align align,
CSeq_align::EScoreType  score 
)

◆ AddScore() [2/2]

void CScoreBuilderBase::AddScore ( CScope scope,
list< CRef< CSeq_align > > &  aligns,
CSeq_align::EScoreType  score 
)

Definition at line 904 of file score_builder_base.cpp.

References AddScore(), and NON_CONST_ITERATE.

◆ AddSplignScores() [1/2]

void CScoreBuilderBase::AddSplignScores ( const CSeq_align align,
CSeq_align::TScore scores 
)

◆ AddSplignScores() [2/2]

void CScoreBuilderBase::AddSplignScores ( CSeq_align align)
inline

Definition at line 120 of file score_builder_base.hpp.

References AddSplignScores(), and CSeq_align_Base::SetScore().

◆ ComputeScore() [1/3]

double CScoreBuilderBase::ComputeScore ( CScope scope,
const CSeq_align align,
const CRangeCollection< TSeqPos > &  ranges,
CSeq_align::EScoreType  score 
)
virtual

◆ ComputeScore() [2/3]

double CScoreBuilderBase::ComputeScore ( CScope scope,
const CSeq_align align,
const TSeqRange range,
CSeq_align::EScoreType  score 
)

Definition at line 1174 of file score_builder_base.cpp.

References ComputeScore(), and compile_time_bits::range().

◆ ComputeScore() [3/3]

double CScoreBuilderBase::ComputeScore ( CScope scope,
const CSeq_align align,
CSeq_align::EScoreType  score 
)

◆ GetAlignLength() [1/3]

TSeqPos CScoreBuilderBase::GetAlignLength ( const CSeq_align align,
bool  ungapped = false 
)

◆ GetAlignLength() [2/3]

TSeqPos CScoreBuilderBase::GetAlignLength ( const CSeq_align align,
const CRangeCollection< TSeqPos > &  ranges,
bool  ungapped = false 
)

Definition at line 893 of file score_builder_base.cpp.

References CSeq_align::GetAlignLengthWithinRanges().

◆ GetAlignLength() [3/3]

TSeqPos CScoreBuilderBase::GetAlignLength ( const CSeq_align align,
const TSeqRange range,
bool  ungapped = false 
)

◆ GetErrorMode()

EErrorMode CScoreBuilderBase::GetErrorMode ( void  ) const
inline

Definition at line 94 of file score_builder_base.hpp.

References m_ErrorMode.

Referenced by AddScore().

◆ GetGapBaseCount() [1/3]

int CScoreBuilderBase::GetGapBaseCount ( const CSeq_align align)

Compute the number of gap bases in the alignment (= length of all gap segments)

Definition at line 838 of file score_builder_base.cpp.

References CSeq_align::GetTotalGapCount().

Referenced by BOOST_AUTO_TEST_CASE(), and CTableDataAlnSummary::x_GetAlnSummary().

◆ GetGapBaseCount() [2/3]

int CScoreBuilderBase::GetGapBaseCount ( const CSeq_align align,
const CRangeCollection< TSeqPos > &  ranges 
)

◆ GetGapBaseCount() [3/3]

int CScoreBuilderBase::GetGapBaseCount ( const CSeq_align align,
const TSeqRange range 
)

◆ GetGapCount() [1/3]

int CScoreBuilderBase::GetGapCount ( const CSeq_align align)

◆ GetGapCount() [2/3]

int CScoreBuilderBase::GetGapCount ( const CSeq_align align,
const CRangeCollection< TSeqPos > &  ranges 
)

◆ GetGapCount() [3/3]

int CScoreBuilderBase::GetGapCount ( const CSeq_align align,
const TSeqRange range 
)

◆ GetIdentityCount() [1/3]

int CScoreBuilderBase::GetIdentityCount ( CScope scope,
const CSeq_align align 
)

Compute the number of identities in the alignment.

Definition at line 721 of file score_builder_base.cpp.

References s_GetCountIdentityMismatch().

Referenced by BOOST_AUTO_TEST_CASE(), ComputeScore(), and CDemoScoreBuilderApp::Run().

◆ GetIdentityCount() [2/3]

int CScoreBuilderBase::GetIdentityCount ( CScope scope,
const CSeq_align align,
const CRangeCollection< TSeqPos > &  ranges 
)

Compute identity and/or mismatch counts within specified collection of ranges.

Definition at line 781 of file score_builder_base.cpp.

References s_GetCountIdentityMismatch().

◆ GetIdentityCount() [3/3]

int CScoreBuilderBase::GetIdentityCount ( CScope scope,
const CSeq_align align,
const TSeqRange range 
)

Compute identity and/or mismatch counts within specified range.

Definition at line 748 of file score_builder_base.cpp.

References compile_time_bits::range(), and s_GetCountIdentityMismatch().

◆ GetMatrixCounts()

void CScoreBuilderBase::GetMatrixCounts ( CScope scope,
const CSeq_align align,
int positives,
int negatives 
)

Definition at line 829 of file score_builder_base.cpp.

References x_GetMatrixCounts().

◆ GetMismatchCount() [1/6]

int CScoreBuilderBase::GetMismatchCount ( CScope scope,
const CSeq_align align 
)

◆ GetMismatchCount() [2/6]

int CScoreBuilderBase::GetMismatchCount ( CScope scope,
const CSeq_align align,
const CRangeCollection< TSeqPos > &  ranges 
)

Definition at line 791 of file score_builder_base.cpp.

References s_GetCountIdentityMismatch().

◆ GetMismatchCount() [3/6]

void CScoreBuilderBase::GetMismatchCount ( CScope scope,
const CSeq_align align,
const CRangeCollection< TSeqPos > &  ranges,
int identities,
int mismatches 
)

Definition at line 801 of file score_builder_base.cpp.

References s_GetCountIdentityMismatch().

◆ GetMismatchCount() [4/6]

int CScoreBuilderBase::GetMismatchCount ( CScope scope,
const CSeq_align align,
const TSeqRange range 
)

◆ GetMismatchCount() [5/6]

void CScoreBuilderBase::GetMismatchCount ( CScope scope,
const CSeq_align align,
const TSeqRange range,
int identities,
int mismatches 
)

◆ GetMismatchCount() [6/6]

void CScoreBuilderBase::GetMismatchCount ( CScope scope,
const CSeq_align align,
int identities,
int mismatches 
)

Definition at line 739 of file score_builder_base.cpp.

References s_GetCountIdentityMismatch().

◆ GetNegativeCount()

int CScoreBuilderBase::GetNegativeCount ( CScope scope,
const CSeq_align align 
)

Definition at line 820 of file score_builder_base.cpp.

References x_GetMatrixCounts().

Referenced by ComputeScore().

◆ GetPercentCoverage() [1/3]

double CScoreBuilderBase::GetPercentCoverage ( CScope scope,
const CSeq_align align,
const CRangeCollection< TSeqPos > &  ranges,
unsigned  query = 0 
)

Definition at line 711 of file score_builder_base.cpp.

References query, and s_GetPercentCoverage().

◆ GetPercentCoverage() [2/3]

double CScoreBuilderBase::GetPercentCoverage ( CScope scope,
const CSeq_align align,
const TSeqRange range,
unsigned  query = 0 
)

Definition at line 701 of file score_builder_base.cpp.

References query, compile_time_bits::range(), and s_GetPercentCoverage().

◆ GetPercentCoverage() [3/3]

double CScoreBuilderBase::GetPercentCoverage ( CScope scope,
const CSeq_align align,
unsigned  query = 0 
)

◆ GetPercentIdentity() [1/3]

double CScoreBuilderBase::GetPercentIdentity ( CScope scope,
const CSeq_align align,
const CRangeCollection< TSeqPos > &  ranges,
EPercentIdentityType  type = eGapped 
)

Compute percent identity or coverage of the query within specified collection of ranges.

Definition at line 675 of file score_builder_base.cpp.

References s_GetPercentIdentity().

◆ GetPercentIdentity() [2/3]

double CScoreBuilderBase::GetPercentIdentity ( CScope scope,
const CSeq_align align,
const TSeqRange range,
EPercentIdentityType  type = eGapped 
)

Compute percent identity or coverage of the query within specified range.

Definition at line 660 of file score_builder_base.cpp.

References compile_time_bits::range(), and s_GetPercentIdentity().

◆ GetPercentIdentity() [3/3]

double CScoreBuilderBase::GetPercentIdentity ( CScope scope,
const CSeq_align align,
EPercentIdentityType  type = eGapped 
)

◆ GetPositiveCount()

int CScoreBuilderBase::GetPositiveCount ( CScope scope,
const CSeq_align align 
)

counts based on substitution matrix for protein alignments

Definition at line 811 of file score_builder_base.cpp.

References x_GetMatrixCounts().

Referenced by ComputeScore().

◆ SetErrorMode()

void CScoreBuilderBase::SetErrorMode ( EErrorMode  mode)
inline

Definition at line 95 of file score_builder_base.hpp.

References m_ErrorMode.

◆ SetSubstMatrix()

void CScoreBuilderBase::SetSubstMatrix ( const string name)

Definition at line 642 of file score_builder_base.cpp.

References m_SubstMatrixName.

◆ x_GetMatrixCounts()

void CScoreBuilderBase::x_GetMatrixCounts ( CScope scope,
const CSeq_align align,
int positives,
int negatives 
)
private

Member Data Documentation

◆ m_ErrorMode

EErrorMode CScoreBuilderBase::m_ErrorMode
private

Definition at line 216 of file score_builder_base.hpp.

Referenced by GetErrorMode(), and SetErrorMode().

◆ m_SubstMatrixName

string CScoreBuilderBase::m_SubstMatrixName
private

Definition at line 217 of file score_builder_base.hpp.

Referenced by SetSubstMatrix(), and x_GetMatrixCounts().


The documentation for this class was generated from the following files:
Modified on Fri May 24 14:54:47 2024 by modify_doxy.py rev. 669887