bpp-seq3  3.0.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 override
 Get the index associated to a pair of states. More...
 
double getIndex (const std::string &state1, const std::string &state2) const override
 Get the index associated to a pair of states. More...
 
std::shared_ptr< const AlphabetgetAlphabet () const override
 Get the alphabet associated to this index. More...
 
const Alphabetalphabet () const override
 Get the alphabet associated to this index. More...
 
DefaultNucleotideScoreclone () const override
 
const Matrix< double > & getIndexMatrix () const override
 
bool isSymmetric () const override
 

Private Attributes

LinearMatrix< double > distanceMatrix_
 
std::shared_ptr< const NucleicAlphabetalpha_
 

Detailed Description

Default Substitution Matrix for nucleotide alignments.

Definition at line 23 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 13 of file DefaultNucleotideScore.cpp.

References distanceMatrix_.

Referenced by clone().

◆ DefaultNucleotideScore() [2/2]

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

Definition at line 38 of file DefaultNucleotideScore.h.

◆ ~DefaultNucleotideScore()

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

Definition at line 49 of file DefaultNucleotideScore.h.

Member Function Documentation

◆ alphabet()

const Alphabet& bpp::DefaultNucleotideScore::alphabet ( ) const
inlineoverridevirtual

Get the alphabet associated to this index.

Returns
Alphabet The alphabet associated to this index.

Implements bpp::AlphabetIndex2.

Definition at line 67 of file DefaultNucleotideScore.h.

References alpha_.

◆ clone()

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

Implements bpp::AlphabetIndex2.

Definition at line 68 of file DefaultNucleotideScore.h.

References DefaultNucleotideScore().

◆ getAlphabet()

std::shared_ptr<const Alphabet> bpp::DefaultNucleotideScore::getAlphabet ( ) const
inlineoverridevirtual

Get the alphabet associated to this index.

Returns
Alphabet The alphabet associated to this index.

Implements bpp::AlphabetIndex2.

Definition at line 66 of file DefaultNucleotideScore.h.

References alpha_.

◆ getIndex() [1/2]

double DefaultNucleotideScore::getIndex ( const std::string &  state1,
const std::string &  state2 
) const
overridevirtual

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 62 of file DefaultNucleotideScore.cpp.

References alpha_, and distanceMatrix_.

◆ getIndex() [2/2]

double DefaultNucleotideScore::getIndex ( int  state1,
int  state2 
) const
overridevirtual

Get the index associated to a pair of states.

Parameters
state1First state to consider, as a int value in the Alphabet
state2Second state to consider, as a int value in the Alphabet
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 39 of file DefaultNucleotideScore.cpp.

References alpha_, and distanceMatrix_.

◆ getIndexMatrix()

const Matrix< double > & DefaultNucleotideScore::getIndexMatrix ( ) const
overridevirtual
Returns
A matrix object with all indices.

Implements bpp::AlphabetIndex2.

Definition at line 69 of file DefaultNucleotideScore.cpp.

References distanceMatrix_.

◆ isSymmetric()

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

Implements bpp::AlphabetIndex2.

Definition at line 70 of file DefaultNucleotideScore.h.

◆ operator=()

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

Definition at line 42 of file DefaultNucleotideScore.h.

References alpha_, and distanceMatrix_.

Member Data Documentation

◆ alpha_

std::shared_ptr<const NucleicAlphabet> bpp::DefaultNucleotideScore::alpha_
private

Definition at line 28 of file DefaultNucleotideScore.h.

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

◆ distanceMatrix_

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

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