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

Search Toolkit Book for CNonSynonymousScoringMethod

CNonSynonymousScoringMethod - implementation of IScoringMethod. More...

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

+ Inheritance diagram for CNonSynonymousScoringMethod:
+ Collaboration diagram for CNonSynonymousScoringMethod:

Public Member Functions

 CNonSynonymousScoringMethod ()
 CNonSynonymousScoringMethod. More...
 
 CNonSynonymousScoringMethod (const CNonSynonymousScoringMethod &orig)
 
virtual ~CNonSynonymousScoringMethod ()
 
void SetSequenceLevel (bool seq_level=true)
 
IUITool implementation
virtual IUIToolClone () const override
 
virtual string GetName () const override
 returns unique name of the method that is used in UI to identify it More...
 
virtual string GetDescription () const override
 returns a detailed description of the method that is used in UI More...
 
IScoringMethod implementation
virtual int GetType () const override
 returns combination of EAlignType flags defining types of alignments that can be colored with this method More...
 
virtual int GetSupportedColorTypes () const override
 returns a combination of EColorType flags More...
 
virtual const CRgbaColorGetColorForScore (TScore score, EColorType type) const override
 returns a color corresponding to a given score value. More...
 
virtual bool IsAverageable () const override
 return "true" if scores could be averaged More...
 
virtual const CRgbaColorGetColorForNoScore (EColorType type) const override
 Call for display colors when CanCalculateScores returns false. More...
 
virtual void SetColorForNoScore (EColorType type, const CRgbaColor &color) override
 
IColumnScoringMethod implementation
virtual void CalculateScores (char cons, const string &column, TScore &col_score, TScoreVector &scores) override
 
virtual bool CanCalculateScores (const IScoringAlignment &aln) override
 Do we have what it takes to calculate scores? e.g. a master row selected? More...
 
virtual bool NeedsTranslation () const override
 
- Public Member Functions inherited from CObject
 CObject (void)
 Constructor. More...
 
 CObject (const CObject &src)
 Copy constructor. More...
 
virtual ~CObject (void)
 Destructor. More...
 
CObjectoperator= (const CObject &src) THROWS_NONE
 Assignment operator. More...
 
bool CanBeDeleted (void) const THROWS_NONE
 Check if object can be deleted. More...
 
bool IsAllocatedInPool (void) const THROWS_NONE
 Check if object is allocated in memory pool (not system heap) More...
 
bool Referenced (void) const THROWS_NONE
 Check if object is referenced. More...
 
bool ReferencedOnlyOnce (void) const THROWS_NONE
 Check if object is referenced only once. More...
 
void AddReference (void) const
 Add reference to object. More...
 
void RemoveReference (void) const
 Remove reference to object. More...
 
void ReleaseReference (void) const
 Remove reference without deleting object. More...
 
virtual void DoNotDeleteThisObject (void)
 Mark this object as not allocated in heap – do not delete this object. More...
 
virtual void DoDeleteThisObject (void)
 Mark this object as allocated in heap – object can be deleted. More...
 
void * operator new (size_t size)
 Define new operator for memory allocation. More...
 
void * operator new[] (size_t size)
 Define new[] operator for 'array' memory allocation. More...
 
void operator delete (void *ptr)
 Define delete operator for memory deallocation. More...
 
void operator delete[] (void *ptr)
 Define delete[] operator for memory deallocation. More...
 
void * operator new (size_t size, void *place)
 Define new operator. More...
 
void operator delete (void *ptr, void *place)
 Define delete operator. More...
 
void * operator new (size_t size, CObjectMemoryPool *place)
 Define new operator using memory pool. More...
 
void operator delete (void *ptr, CObjectMemoryPool *place)
 Define delete operator. More...
 
virtual void DebugDump (CDebugDumpContext ddc, unsigned int depth) const
 Define method for dumping debug information. More...
 
- Public Member Functions inherited from CDebugDumpable
 CDebugDumpable (void)
 
virtual ~CDebugDumpable (void)
 
void DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const
 
void DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const
 
void DumpToConsole (void) const
 
- Public Member Functions inherited from IScoringMethod
virtual ~IScoringMethod ()
 
- Public Member Functions inherited from IUITool
virtual ~IUITool ()
 
- Public Member Functions inherited from IColumnScoringMethod
virtual ~IColumnScoringMethod ()
 
virtual void UpdateSettings (const IScoringAlignment &aln)
 Set alignment specifi settings. More...
 

Private Types

enum  EColors { eMismatch , eMatch , eMatchLight , eLast }
 

Private Member Functions

void x_Init ()
 

Private Attributes

int m_ColumnCount = 0
 
bool m_SequenceLevel = false
 
CRgbaColor m_Colors [EColors::eLast]
 
CRgbaGradColorTable m_ColorTable
 

Additional Inherited Members

- Public Types inherited from CObject
enum  EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern }
 Control filling of newly allocated memory. More...
 
typedef CObjectCounterLocker TLockerType
 Default locker type for CRef. More...
 
typedef atomic< Uint8TCounter
 Counter type is CAtomiCounter. More...
 
typedef Uint8 TCount
 Alias for value type of counter. More...
 
- Public Types inherited from IScoringMethod
enum  EColorType { fBackground = 0x1 , fForeground = 0x2 }
 
typedef float TScore
 
typedef vector< TScoreTScoreVector
 
typedef CAttrRangeCollection< TScore, TSeqPosTScoreColl
 
- Static Public Member Functions inherited from CObject
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (void)
 Define method to throw null pointer exception. More...
 
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (const type_info &type)
 
static EAllocFillMode GetAllocFillMode (void)
 
static void SetAllocFillMode (EAllocFillMode mode)
 
static void SetAllocFillMode (const string &value)
 Set mode from configuration parameter value. More...
 
- Static Public Member Functions inherited from CDebugDumpable
static void EnableDebugDump (bool on)
 
- Static Public Member Functions inherited from IScoringMethod
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 inherited from CObject
static const TCount eCounterBitsCanBeDeleted = 1 << 0
 Define possible object states. More...
 
static const TCount eCounterBitsInPlainHeap = 1 << 1
 Heap signature was found. More...
 
static const TCount eCounterBitsPlaceMask
 Mask for 'in heap' state flags. More...
 
static const int eCounterStep = 1 << 2
 Skip over the "in heap" bits. More...
 
static const TCount eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2)
 Minimal value for valid objects (reference counter is zero) Must be a single bit value. More...
 
static const TCount eCounterStateMask
 Valid object, and object in heap. More...
 
- Static Public Attributes inherited from IScoringMethod
static const int sm_DefGradientSize = 32
 default number of colors in gradient More...
 
- Static Public Attributes inherited from IColumnScoringMethod
static const int kAmbiguousResidueScore = 1000
 
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
 
- Protected Attributes inherited from IColumnScoringMethod
char m_AmbiguousResidue = ' '
 Ambiguous Residue, typically 'N' for nucleotides, 'X' for proteins. More...
 
std::function< bool(char c, char b)> mf_CompareResidue
 

Detailed Description

CNonSynonymousScoringMethod - implementation of IScoringMethod.

Highlights triplets with non-synonymous mismtaches Can be used only with 'CDS' alignments - nucleotide alignments of CDS regions

Definition at line 210 of file simple_methods.hpp.

Member Enumeration Documentation

◆ EColors

Enumerator
eMismatch 
eMatch 
eMatchLight 
eLast 

Definition at line 267 of file simple_methods.hpp.

Constructor & Destructor Documentation

◆ CNonSynonymousScoringMethod() [1/2]

CNonSynonymousScoringMethod::CNonSynonymousScoringMethod ( )

CNonSynonymousScoringMethod.

Definition at line 764 of file simple_methods.cpp.

References x_Init().

Referenced by Clone().

◆ CNonSynonymousScoringMethod() [2/2]

CNonSynonymousScoringMethod::CNonSynonymousScoringMethod ( const CNonSynonymousScoringMethod orig)

Definition at line 792 of file simple_methods.cpp.

References i, m_Colors, m_ColorTable, and orig.

◆ ~CNonSynonymousScoringMethod()

CNonSynonymousScoringMethod::~CNonSynonymousScoringMethod ( )
virtual

Definition at line 770 of file simple_methods.cpp.

Member Function Documentation

◆ CalculateScores()

void CNonSynonymousScoringMethod::CalculateScores ( char  cons,
const string column,
TScore col_score,
TScoreVector scores 
)
overridevirtual

Implements IColumnScoringMethod.

Definition at line 829 of file simple_methods.cpp.

References column, i, kSameBase, kSNP, m_ColumnCount, and m_SequenceLevel.

◆ CanCalculateScores()

virtual bool CNonSynonymousScoringMethod::CanCalculateScores ( const IScoringAlignment aln)
inlineoverridevirtual

Do we have what it takes to calculate scores? e.g. a master row selected?

Implements IColumnScoringMethod.

Definition at line 245 of file simple_methods.hpp.

◆ Clone()

IUITool * CNonSynonymousScoringMethod::Clone ( void  ) const
overridevirtual

Implements IUITool.

Definition at line 801 of file simple_methods.cpp.

References CNonSynonymousScoringMethod().

◆ GetColorForNoScore()

const CRgbaColor & CNonSynonymousScoringMethod::GetColorForNoScore ( EColorType  type) const
overridevirtual

Call for display colors when CanCalculateScores returns false.

Implements IScoringMethod.

Definition at line 872 of file simple_methods.cpp.

References _ASSERT.

◆ GetColorForScore()

const CRgbaColor & CNonSynonymousScoringMethod::GetColorForScore ( TScore  score,
EColorType  type 
) const
overridevirtual

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.

Implements IScoringMethod.

Definition at line 854 of file simple_methods.cpp.

References _ASSERT, eMatch, eMatchLight, eMismatch, CRgbaGradColorTable::GetSize(), int, kSameBase, kSNP, m_Colors, m_ColorTable, m_SequenceLevel, min(), and ncbi::grid::netcache::search::fields::size.

◆ GetDescription()

string CNonSynonymousScoringMethod::GetDescription ( ) const
overridevirtual

returns a detailed description of the method that is used in UI

Implements IUITool.

Definition at line 817 of file simple_methods.cpp.

References CNONSYNONYMOUS_METHOD_DESCR.

◆ GetName()

string CNonSynonymousScoringMethod::GetName ( ) const
overridevirtual

returns unique name of the method that is used in UI to identify it

Implements IUITool.

Definition at line 807 of file simple_methods.cpp.

◆ GetSupportedColorTypes()

int CNonSynonymousScoringMethod::GetSupportedColorTypes ( ) const
overridevirtual

returns a combination of EColorType flags

Implements IScoringMethod.

Definition at line 848 of file simple_methods.cpp.

References IScoringMethod::fBackground.

◆ GetType()

int CNonSynonymousScoringMethod::GetType ( ) const
overridevirtual

returns combination of EAlignType flags defining types of alignments that can be colored with this method

Implements IScoringMethod.

Definition at line 823 of file simple_methods.cpp.

References IAlnExplorer::fDNA.

◆ IsAverageable()

virtual bool CNonSynonymousScoringMethod::IsAverageable ( ) const
inlineoverridevirtual

return "true" if scores could be averaged

Implements IScoringMethod.

Definition at line 232 of file simple_methods.hpp.

◆ NeedsTranslation()

virtual bool CNonSynonymousScoringMethod::NeedsTranslation ( ) const
inlineoverridevirtual

Reimplemented from IColumnScoringMethod.

Definition at line 248 of file simple_methods.hpp.

◆ SetColorForNoScore()

void CNonSynonymousScoringMethod::SetColorForNoScore ( EColorType  type,
const CRgbaColor color 
)
overridevirtual

Implements IScoringMethod.

Definition at line 880 of file simple_methods.cpp.

◆ SetSequenceLevel()

void CNonSynonymousScoringMethod::SetSequenceLevel ( bool  seq_level = true)
inline

Definition at line 281 of file simple_methods.hpp.

References m_SequenceLevel.

◆ x_Init()

void CNonSynonymousScoringMethod::x_Init ( void  )
private

Member Data Documentation

◆ m_Colors

CRgbaColor CNonSynonymousScoringMethod::m_Colors[EColors::eLast]
private

Definition at line 275 of file simple_methods.hpp.

Referenced by CNonSynonymousScoringMethod(), GetColorForScore(), and x_Init().

◆ m_ColorTable

CRgbaGradColorTable CNonSynonymousScoringMethod::m_ColorTable
private

Definition at line 276 of file simple_methods.hpp.

Referenced by CNonSynonymousScoringMethod(), GetColorForScore(), and x_Init().

◆ m_ColumnCount

int CNonSynonymousScoringMethod::m_ColumnCount = 0
private

Definition at line 265 of file simple_methods.hpp.

Referenced by CalculateScores(), and x_Init().

◆ m_SequenceLevel

bool CNonSynonymousScoringMethod::m_SequenceLevel = false
private

Definition at line 266 of file simple_methods.hpp.

Referenced by CalculateScores(), GetColorForScore(), and SetSequenceLevel().


The documentation for this class was generated from the following files:
Modified on Tue May 28 05:52:21 2024 by modify_doxy.py rev. 669887