NCBI C++ ToolKit
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
IScoringMethod Class Referenceabstract

Search Toolkit Book for IScoringMethod

IScoringMethod represents an abstract algorithm for calculating alignment scores and assigning colors to residues. More...

#include <gui/widgets/aln_score/scoring_method.hpp>

+ Inheritance diagram for IScoringMethod:
+ Collaboration diagram for IScoringMethod:

Public Types

enum  EColorType { fBackground = 0x1 , fForeground = 0x2 }
 
typedef float TScore
 
typedef vector< TScoreTScoreVector
 
typedef CAttrRangeCollection< TScore, TSeqPosTScoreColl
 

Public Member Functions

virtual ~IScoringMethod ()
 
virtual int GetType () const =0
 returns combination of EAlignType flags defining types of alignments that can be colored with this method More...
 
virtual bool IsAverageable () const =0
 return "true" if scores could be averaged More...
 
virtual int GetSupportedColorTypes () const =0
 returns a combination of EColorType flags More...
 
virtual const CRgbaColorGetColorForScore (TScore score, EColorType type) const =0
 returns a color corresponding to a given score value. More...
 
virtual const CRgbaColorGetColorForNoScore (IScoringMethod::EColorType type) const =0
 Call for display colors when CanCalculateScores returns false. More...
 
virtual void SetColorForNoScore (IScoringMethod::EColorType type, const CRgbaColor &color)=0
 
- Public Member Functions inherited from IUITool
virtual ~IUITool ()
 
virtual IUIToolClone () const =0
 
virtual string GetName () const =0
 returns unique name of the method that is used in UI to identify it More...
 
virtual string GetDescription () const =0
 returns a detailed description of the method that is used in UI More...
 

Static Public Member Functions

static const char * GetAlignmentTagByType (IAlnExplorer::EAlignType type)
 returns symbolic label for the given alignment type, should be More...
 
static IAlnExplorer::EAlignType GetAlignmentTypeByTag (const string &tag)
 

Static Public Attributes

static const int sm_DefGradientSize = 32
 default number of colors in gradient More...
 

Detailed Description

IScoringMethod represents an abstract algorithm for calculating alignment scores and assigning colors to residues.

IScoringMethod has a unique Name that identifies the method and Description that can contain detailed information about the method. Method Type indicates whether it can be applied to DNA or Protein alignments (or both). Method is defined as "Averageable" is scores produced by the method can be calculated for the interval not only for individual residues.

Definition at line 58 of file scoring_method.hpp.

Member Typedef Documentation

◆ TScore

typedef float IScoringMethod::TScore

Definition at line 62 of file scoring_method.hpp.

◆ TScoreColl

Definition at line 64 of file scoring_method.hpp.

◆ TScoreVector

Definition at line 63 of file scoring_method.hpp.

Member Enumeration Documentation

◆ EColorType

Enumerator
fBackground 
fForeground 

Definition at line 66 of file scoring_method.hpp.

Constructor & Destructor Documentation

◆ ~IScoringMethod()

virtual IScoringMethod::~IScoringMethod ( )
inlinevirtual

Definition at line 74 of file scoring_method.hpp.

Member Function Documentation

◆ GetAlignmentTagByType()

const char * IScoringMethod::GetAlignmentTagByType ( IAlnExplorer::EAlignType  type)
static

returns symbolic label for the given alignment type, should be

Definition at line 50 of file scoring_method.cpp.

References _ASSERT, IAlnExplorer::fDNA, IAlnExplorer::fMixed, IAlnExplorer::fProtein, kDNATag, kMixedTag, and kProteinTag.

Referenced by CAlnMultiWidget::x_GetScoringMRUListName().

◆ GetAlignmentTypeByTag()

IAlnExplorer::EAlignType IScoringMethod::GetAlignmentTypeByTag ( const string tag)
static

◆ GetColorForNoScore()

virtual const CRgbaColor& IScoringMethod::GetColorForNoScore ( IScoringMethod::EColorType  type) const
pure virtual

◆ GetColorForScore()

virtual const CRgbaColor& IScoringMethod::GetColorForScore ( TScore  score,
EColorType  type 
) const
pure virtual

returns a color corresponding to a given score value.

It is recommended that this method be implemented using color table, on-the-fly creation of colors is expensive.

Implemented in CNonSynonymousScoringMethod, CMatrixScoringMethod, CColumnScoringMethod, CColorTableMethod, CTestSeqBasedMethod, CSNPScoringMethod, CSimpleScoringMethod, CConservationScoringMethod, and CQualityScoringMethod.

◆ GetSupportedColorTypes()

virtual int IScoringMethod::GetSupportedColorTypes ( ) const
pure virtual

◆ GetType()

virtual int IScoringMethod::GetType ( ) const
pure virtual

◆ IsAverageable()

virtual bool IScoringMethod::IsAverageable ( ) const
pure virtual

◆ SetColorForNoScore()

virtual void IScoringMethod::SetColorForNoScore ( IScoringMethod::EColorType  type,
const CRgbaColor color 
)
pure virtual

Member Data Documentation

◆ sm_DefGradientSize

const int IScoringMethod::sm_DefGradientSize = 32
static

The documentation for this class was generated from the following files:
Modified on Sun Jul 14 04:59:56 2024 by modify_doxy.py rev. 669887