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

Search Toolkit Book for CScoreLookup

#include <algo/align/util/score_lookup.hpp>

+ Inheritance diagram for CScoreLookup:
+ Collaboration diagram for CScoreLookup:

Classes

class  IScore
 

Public Member Functions

 CScoreLookup ()
 
 CScoreLookup (enum blast::EProgram program_type)
 
 CScoreLookup (blast::CBlastOptionsHandle &options)
 
void SetScope (objects::CScope &scope)
 CScoreLookup uses a scope internally. More...
 
objects::CScope & GetScope ()
 
void PrintDictionary (CNcbiOstream &)
 Print out the dictionary of recognized score names. More...
 
string HelpText (const string &score_name)
 Help text for score. More...
 
IScore::EComplexity Complexity (const string &score_name)
 
bool IsIntegerScore (const objects::CSeq_align &align, const string &score_name)
 
double GetScore (const objects::CSeq_align &align, const string &score_name)
 Get requested score for alignment. More...
 
void UpdateState (const objects::CSeq_align &align)
 
- Public Member Functions inherited from CScoreBuilder
 CScoreBuilder ()
 Default constructor. More...
 
 CScoreBuilder (enum blast::EProgram program_type)
 
 CScoreBuilder (blast::CBlastOptionsHandle &options)
 
 ~CScoreBuilder ()
 Destructor. More...
 
void SetGapOpen (int gapopen)
 
void SetGapExtend (int gapextend)
 
void AddScore (CScope &scope, CSeq_align &align, EScoreType score)
 deprecated: use CSeq_align::EScoreType directly More...
 
void AddScore (CScope &scope, list< CRef< CSeq_align > > &aligns, EScoreType score)
 deprecated: use CSeq_align::EScoreType directly More...
 
double ComputeScore (CScope &scope, const CSeq_align &align, const CRangeCollection< TSeqPos > &ranges, CSeq_align::EScoreType score)
 
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)
 
void AddScore (CScope &scope, CSeq_align &align, CSeq_align::EScoreType score)
 
void AddScore (CScope &scope, list< CRef< CSeq_align > > &aligns, CSeq_align::EScoreType score)
 
int GetBlastScore (CScope &scope, const CSeq_align &align)
 Compute the BLAST score of the alignment. More...
 
double GetBlastBitScore (CScope &scope, const CSeq_align &align)
 Compute the BLAST bit score. More...
 
double GetBlastEValue (CScope &scope, const CSeq_align &align)
 Compute the BLAST e-value. More...
 
void AddTracebacks (CScope &scope, CSeq_align &align)
 
void AddTracebacks (CScope &scope, list< CRef< CSeq_align > > &aligns)
 
string GetTraceback (const CSeq_align &align, CSeq_align::TDim row)
 
string GetTraceback (CScope &scope, const CSeq_align &align, CSeq_align::TDim row)
 
int ComputeTieBreaker (const CSeq_align &align)
 
void AddTieBreaker (CSeq_align &align)
 
void SetEffectiveSearchSpace (Int8 searchsp)
 
- Public Member Functions inherited from CScoreBuilderBase
 CScoreBuilderBase ()
 Default constructor. More...
 
virtual ~CScoreBuilderBase ()
 Destructor. More...
 
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)
 
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)
 
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)
 

Static Public Member Functions

static int GetGeneId (const objects::CBioseq_Handle &bsh)
 

Private Types

typedef map< string, CIRef< IScore > > TScoreDictionary
 

Private Member Functions

void x_Init ()
 
void x_PrintDictionaryEntry (CNcbiOstream &ostr, const string &score_name)
 

Private Attributes

CRef< objects::CScope > m_Scope
 
TScoreDictionary m_Scores
 
set< stringm_ScoresUsed
 

Additional Inherited Members

- Public Types inherited from CScoreBuilderBase
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...
 
enum  EPercentIdentityType { eGapped , eUngapped , eGBDNA }
 Compute percent identity (range 0-100) More...
 
- Protected Member Functions inherited from CScoreBuilder
struct BlastScoreBlkGetBlastScoreBlkPtr ()
 

Detailed Description

Definition at line 48 of file score_lookup.hpp.

Member Typedef Documentation

◆ TScoreDictionary

Definition at line 115 of file score_lookup.hpp.

Constructor & Destructor Documentation

◆ CScoreLookup() [1/3]

CScoreLookup::CScoreLookup ( )
inline

Definition at line 72 of file score_lookup.hpp.

References x_Init().

◆ CScoreLookup() [2/3]

CScoreLookup::CScoreLookup ( enum blast::EProgram  program_type)
inline

Definition at line 74 of file score_lookup.hpp.

References x_Init().

◆ CScoreLookup() [3/3]

CScoreLookup::CScoreLookup ( blast::CBlastOptionsHandle &  options)
inline

Definition at line 77 of file score_lookup.hpp.

References x_Init().

Member Function Documentation

◆ Complexity()

CScoreLookup::IScore::EComplexity CScoreLookup::Complexity ( const string score_name)

◆ GetGeneId()

int CScoreLookup::GetGeneId ( const objects::CBioseq_Handle &  bsh)
static

◆ GetScope()

objects::CScope& CScoreLookup::GetScope ( void  )
inline

Definition at line 85 of file score_lookup.hpp.

References m_Scope.

◆ GetScore()

double CScoreLookup::GetScore ( const objects::CSeq_align &  align,
const string score_name 
)

◆ HelpText()

string CScoreLookup::HelpText ( const string score_name)

◆ IsIntegerScore()

bool CScoreLookup::IsIntegerScore ( const objects::CSeq_align &  align,
const string score_name 
)

◆ PrintDictionary()

void CScoreLookup::PrintDictionary ( CNcbiOstream ostr)

Print out the dictionary of recognized score names.

Definition at line 2353 of file score_lookup.cpp.

References ITERATE, m_Scores, CSeq_align::ScoreNameMap(), and x_PrintDictionaryEntry().

◆ SetScope()

void CScoreLookup::SetScope ( objects::CScope &  scope)
inline

CScoreLookup uses a scope internally.

You can set a scope yourself; alternatively, the scope used internally will be a default scope

Definition at line 82 of file score_lookup.hpp.

References m_Scope, and CRef< C, Locker >::Reset().

Referenced by BOOST_AUTO_TEST_CASE().

◆ UpdateState()

void CScoreLookup::UpdateState ( const objects::CSeq_align &  align)

Definition at line 2334 of file score_lookup.cpp.

References ITERATE, m_Scores, and m_ScoresUsed.

◆ x_Init()

void CScoreLookup::x_Init ( void  )
private

◆ x_PrintDictionaryEntry()

void CScoreLookup::x_PrintDictionaryEntry ( CNcbiOstream ostr,
const string score_name 
)
private

Definition at line 2341 of file score_lookup.cpp.

References HelpText(), i, ITERATE, tmp, and NStr::Wrap().

Referenced by PrintDictionary().

Member Data Documentation

◆ m_Scope

CRef<objects::CScope> CScoreLookup::m_Scope
private

Definition at line 113 of file score_lookup.hpp.

Referenced by GetScope(), GetScore(), and SetScope().

◆ m_Scores

TScoreDictionary CScoreLookup::m_Scores
private

◆ m_ScoresUsed

set<string> CScoreLookup::m_ScoresUsed
private

Definition at line 118 of file score_lookup.hpp.

Referenced by GetScore(), HelpText(), and UpdateState().


The documentation for this class was generated from the following files:
Modified on Tue Apr 30 06:40:32 2024 by modify_doxy.py rev. 669887