bpp-seq  2.2.0
bpp::DefaultNucleotideScore Class Reference

Default Substitution Matrix for nucleotide alignments. More...

#include <Bpp/Seq/AlphabetIndex/DefaultNucleotideScore.h>

+ Inheritance diagram for bpp::DefaultNucleotideScore:
+ Collaboration diagram for bpp::DefaultNucleotideScore:

Public Member Functions

 DefaultNucleotideScore (const NucleicAlphabet *alphabet)
 Build a new DefaultNucleotideScore object. More...
 
 DefaultNucleotideScore (const DefaultNucleotideScore &dns)
 
DefaultNucleotideScoreoperator= (const DefaultNucleotideScore &dns)
 
virtual ~DefaultNucleotideScore ()
 
Methods from the AlphabetIndex2 interface.
double getIndex (int state1, int state2) const throw (BadIntException)
 Get the index associated to a pair of states. More...
 
double getIndex (const std::string &state1, const std::string &state2) const throw (BadCharException)
 Get the index associated to a pair of states. More...
 
const AlphabetgetAlphabet () const
 Get the alphabet associated to this index. More...
 
DefaultNucleotideScoreclone () const
 
LinearMatrix< double > * getIndexMatrix () const
 
bool isSymmetric () const
 

Private Attributes

LinearMatrix< double > distanceMatrix_
 
const NucleicAlphabetalpha_
 

Detailed Description

Default Substitution Matrix for nucleotide alignments.

Definition at line 57 of file DefaultNucleotideScore.h.

Constructor & Destructor Documentation

◆ DefaultNucleotideScore() [1/2]

DefaultNucleotideScore::DefaultNucleotideScore ( const NucleicAlphabet alphabet)

Build a new DefaultNucleotideScore object.

Parameters
alphabetThe alphabet to use.

Definition at line 48 of file DefaultNucleotideScore.cpp.

References distanceMatrix_.

Referenced by clone().

◆ DefaultNucleotideScore() [2/2]

bpp::DefaultNucleotideScore::DefaultNucleotideScore ( const DefaultNucleotideScore dns)
inline

Definition at line 72 of file DefaultNucleotideScore.h.

◆ ~DefaultNucleotideScore()

virtual bpp::DefaultNucleotideScore::~DefaultNucleotideScore ( )
inlinevirtual

Definition at line 83 of file DefaultNucleotideScore.h.

Member Function Documentation

◆ clone()

DefaultNucleotideScore* bpp::DefaultNucleotideScore::clone ( ) const
inlinevirtual

Implements bpp::AlphabetIndex2.

Definition at line 101 of file DefaultNucleotideScore.h.

References DefaultNucleotideScore().

◆ getAlphabet()

const Alphabet* bpp::DefaultNucleotideScore::getAlphabet ( ) const
inlinevirtual

Get the alphabet associated to this index.

Returns
Alphabet The alphabet associated to this index.

Implements bpp::AlphabetIndex2.

Definition at line 100 of file DefaultNucleotideScore.h.

References alpha_.

◆ getIndex() [1/2]

double DefaultNucleotideScore::getIndex ( int  state1,
int  state2 
) const
throw (BadIntException
)
virtual

Get the index associated to a pair of states.

Parameters
state1First state to consider, as a int value.
state2Second state to consider, as a int value.
Returns
The index associated to the pair of states.

If states are unresolved, takes the best score of all possible matches and divides it by the number of different states.

Author
Sylvain Gaillard

Implements bpp::AlphabetIndex2.

Definition at line 74 of file DefaultNucleotideScore.cpp.

◆ getIndex() [2/2]

double DefaultNucleotideScore::getIndex ( const std::string &  state1,
const std::string &  state2 
) const
throw (BadCharException
)
virtual

Get the index associated to a pair of states.

Parameters
state1First state to consider, as a string value.
state2Second state to consider, as a string value.
Returns
The index associated to the pair of states.

Implements bpp::AlphabetIndex2.

Definition at line 101 of file DefaultNucleotideScore.cpp.

◆ getIndexMatrix()

LinearMatrix< double > * DefaultNucleotideScore::getIndexMatrix ( ) const
virtual
Returns
A matrix object with all indices.

Implements bpp::AlphabetIndex2.

Definition at line 109 of file DefaultNucleotideScore.cpp.

References distanceMatrix_.

◆ isSymmetric()

bool bpp::DefaultNucleotideScore::isSymmetric ( ) const
inlinevirtual
Returns
True if the index is symatric (that is, index(i,j) == index(j, i)).

Implements bpp::AlphabetIndex2.

Definition at line 103 of file DefaultNucleotideScore.h.

◆ operator=()

DefaultNucleotideScore& bpp::DefaultNucleotideScore::operator= ( const DefaultNucleotideScore dns)
inline

Definition at line 76 of file DefaultNucleotideScore.h.

References alpha_, and distanceMatrix_.

Member Data Documentation

◆ alpha_

const NucleicAlphabet* bpp::DefaultNucleotideScore::alpha_
private

Definition at line 62 of file DefaultNucleotideScore.h.

Referenced by getAlphabet(), and operator=().

◆ distanceMatrix_

LinearMatrix<double> bpp::DefaultNucleotideScore::distanceMatrix_
private

Definition at line 61 of file DefaultNucleotideScore.h.

Referenced by DefaultNucleotideScore(), getIndexMatrix(), and operator=().


The documentation for this class was generated from the following files: