bpp-seq3  3.0.0
bpp::AAIndex2Entry Class Reference

Create a AlphabetIndex2 object from an AAIndex2 entry. More...

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

+ Inheritance diagram for bpp::AAIndex2Entry:
+ Collaboration diagram for bpp::AAIndex2Entry:

Public Member Functions

 AAIndex2Entry (std::istream &input, bool sym=true)
 Create a new AAIndex2Entry from an input stream. More...
 
 AAIndex2Entry (const AAIndex2Entry &index)
 
AAIndex2Entryoperator= (const AAIndex2Entry &index)
 
virtual ~AAIndex2Entry ()
 
AAIndex2Entryclone () const override
 
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...
 
const Matrix< double > & getIndexMatrix () const override
 
bool isSymmetric () const override
 
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...
 

Private Attributes

LinearMatrix< double > property_
 
bool sym_
 
std::shared_ptr< const ProteicAlphabetalpha_
 

Detailed Description

Create a AlphabetIndex2 object from an AAIndex2 entry.

Definition at line 17 of file AAIndex2Entry.h.

Constructor & Destructor Documentation

◆ AAIndex2Entry() [1/2]

AAIndex2Entry::AAIndex2Entry ( std::istream &  input,
bool  sym = true 
)

Create a new AAIndex2Entry from an input stream.

Parameters
inputThe input stream to use.
symTell if the matrix is symmetric. This option as an effect only if the matrix is specified as a triangle in the entry. If sym==true, the other triangle will be built by symmetry. If sym==false, the other triangle will be set to (-) the given triangle. If the input matrix is square, it will be considered non-symetric.
Exceptions
IOExceptionif the stream content does not follow the AAIndex2 database entry format.

Definition at line 15 of file AAIndex2Entry.cpp.

References bpp::FileTools::getNextLine(), bpp::StringTokenizer::nextToken(), bpp::StringTokenizer::numberOfRemainingTokens(), property_, sym_, and bpp::TextTools::toDouble().

Referenced by clone().

◆ AAIndex2Entry() [2/2]

bpp::AAIndex2Entry::AAIndex2Entry ( const AAIndex2Entry index)
inline

Definition at line 38 of file AAIndex2Entry.h.

◆ ~AAIndex2Entry()

virtual bpp::AAIndex2Entry::~AAIndex2Entry ( )
inlinevirtual

Definition at line 53 of file AAIndex2Entry.h.

Member Function Documentation

◆ alphabet()

const Alphabet& bpp::ProteicAlphabetIndex2::alphabet ( ) const
inlineoverridevirtualinherited

Get the alphabet associated to this index.

Returns
Alphabet The alphabet associated to this index.

Implements bpp::AlphabetIndex2.

Definition at line 104 of file AlphabetIndex2.h.

References bpp::ProteicAlphabetIndex2::alpha_.

◆ clone()

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

Implements bpp::ProteicAlphabetIndex2.

Definition at line 56 of file AAIndex2Entry.h.

References AAIndex2Entry().

◆ getAlphabet()

std::shared_ptr<const Alphabet> bpp::ProteicAlphabetIndex2::getAlphabet ( ) const
inlineoverridevirtualinherited

Get the alphabet associated to this index.

Returns
Alphabet The alphabet associated to this index.

Implements bpp::AlphabetIndex2.

Definition at line 102 of file AlphabetIndex2.h.

References bpp::ProteicAlphabetIndex2::alpha_.

Referenced by getIndex(), bpp::BLOSUM50::getIndex(), bpp::GranthamAAChemicalDistance::getIndex(), and bpp::MiyataAAChemicalDistance::getIndex().

◆ getIndex() [1/2]

double bpp::AAIndex2Entry::getIndex ( const std::string &  state1,
const std::string &  state2 
) const
inlineoverridevirtual

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 63 of file AAIndex2Entry.h.

References bpp::ProteicAlphabetIndex2::getAlphabet(), and property_.

◆ getIndex() [2/2]

double bpp::AAIndex2Entry::getIndex ( int  state1,
int  state2 
) const
inlineoverridevirtual

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.

Implements bpp::AlphabetIndex2.

Definition at line 58 of file AAIndex2Entry.h.

References bpp::ProteicAlphabetIndex2::getAlphabet(), and property_.

◆ getIndexMatrix()

const Matrix<double>& bpp::AAIndex2Entry::getIndexMatrix ( ) const
inlineoverridevirtual
Returns
A matrix object with all indices.

Implements bpp::AlphabetIndex2.

Definition at line 68 of file AAIndex2Entry.h.

References property_.

◆ isSymmetric()

bool bpp::AAIndex2Entry::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 AAIndex2Entry.h.

References sym_.

◆ operator=()

AAIndex2Entry& bpp::AAIndex2Entry::operator= ( const AAIndex2Entry index)
inline

Definition at line 44 of file AAIndex2Entry.h.

References bpp::ProteicAlphabetIndex2::operator=(), property_, and sym_.

Member Data Documentation

◆ alpha_

std::shared_ptr<const ProteicAlphabet> bpp::ProteicAlphabetIndex2::alpha_
privateinherited

◆ property_

LinearMatrix<double> bpp::AAIndex2Entry::property_
private

Definition at line 21 of file AAIndex2Entry.h.

Referenced by AAIndex2Entry(), getIndex(), getIndexMatrix(), and operator=().

◆ sym_

bool bpp::AAIndex2Entry::sym_
private

Definition at line 22 of file AAIndex2Entry.h.

Referenced by AAIndex2Entry(), isSymmetric(), and operator=().


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