bpp-seq3  3.0.0
bpp::AllelicAlphabet::AllelicTransliterator Class Referenceabstract

#include <Bpp/Seq/Alphabet/AllelicAlphabet.h>

+ Inheritance diagram for bpp::AllelicAlphabet::AllelicTransliterator:
+ Collaboration diagram for bpp::AllelicAlphabet::AllelicTransliterator:

Public Member Functions

 AllelicTransliterator (std::shared_ptr< const AllelicAlphabet > alph)
 
std::shared_ptr< const AlphabetgetSourceAlphabet () const override
 Get the source alphabet. More...
 
std::shared_ptr< const AlphabetgetTargetAlphabet () const override
 Get the target alphabet. More...
 
std::string translate (const std::string &state) const override
 Translate a given state coded as a string from source alphabet to target alphabet. More...
 
int translate (int state) const override
 States of the original alphabet are the first ones of the allelic alphabet. More...
 
std::unique_ptr< Sequencetranslate (const SequenceInterface &sequence) const override
 Translate a whole sequence from source alphabet to target alphabet. More...
 
virtual const AlphabetsourceAlphabet () const =0
 Get the source alphabet. More...
 
virtual const AlphabettargetAlphabet () const =0
 Get the target alphabet. More...
 

Private Attributes

std::shared_ptr< const AllelicAlphabetalph_
 

Detailed Description

Definition at line 162 of file AllelicAlphabet.h.

Constructor & Destructor Documentation

◆ AllelicTransliterator()

bpp::AllelicAlphabet::AllelicTransliterator::AllelicTransliterator ( std::shared_ptr< const AllelicAlphabet alph)
inline

Definition at line 168 of file AllelicAlphabet.h.

Member Function Documentation

◆ getSourceAlphabet()

std::shared_ptr<const Alphabet> bpp::AllelicAlphabet::AllelicTransliterator::getSourceAlphabet ( ) const
inlineoverridevirtual

Get the source alphabet.

Returns
A pointer toward the source alphabet.

Implements bpp::TransliteratorInterface.

Definition at line 172 of file AllelicAlphabet.h.

References alph_.

Referenced by translate().

◆ getTargetAlphabet()

std::shared_ptr<const Alphabet> bpp::AllelicAlphabet::AllelicTransliterator::getTargetAlphabet ( ) const
inlineoverridevirtual

Get the target alphabet.

Returns
A pointer toward the target alphabet.

Implements bpp::TransliteratorInterface.

Definition at line 176 of file AllelicAlphabet.h.

References alph_.

Referenced by translate().

◆ sourceAlphabet()

virtual const Alphabet& bpp::TransliteratorInterface::sourceAlphabet ( ) const
pure virtualinherited

Get the source alphabet.

Returns
A reference toward the source alphabet.

Implemented in bpp::NucleicAcidsReplication, bpp::GeneticCode, and bpp::DNAToRNA.

◆ targetAlphabet()

virtual const Alphabet& bpp::TransliteratorInterface::targetAlphabet ( ) const
pure virtualinherited

Get the target alphabet.

Returns
A reference toward the target alphabet.

Implemented in bpp::NucleicAcidsReplication, bpp::GeneticCode, and bpp::DNAToRNA.

◆ translate() [1/3]

std::unique_ptr<Sequence> bpp::AllelicAlphabet::AllelicTransliterator::translate ( const SequenceInterface sequence) const
inlineoverridevirtual

Translate a whole sequence from source alphabet to target alphabet.

Parameters
sequenceA sequence in source alphabet.
Returns
The corresponding sequence in target alphabet.

Implements bpp::TransliteratorInterface.

Definition at line 192 of file AllelicAlphabet.h.

References bpp::AbstractTransliterator::translate().

◆ translate() [2/3]

std::string bpp::AllelicAlphabet::AllelicTransliterator::translate ( const std::string &  state) const
inlineoverridevirtual

Translate a given state coded as a string from source alphabet to target alphabet.

Parameters
stateA state in source alphabet.
Returns
The corresponding state in target alphabet.

Implements bpp::AbstractTransliterator.

Definition at line 178 of file AllelicAlphabet.h.

References bpp::AllelicAlphabet::charToInt(), getSourceAlphabet(), and getTargetAlphabet().

◆ translate() [3/3]

int bpp::AllelicAlphabet::AllelicTransliterator::translate ( int  state) const
inlineoverridevirtual

States of the original alphabet are the first ones of the allelic alphabet.

Implements bpp::AbstractTransliterator.

Definition at line 187 of file AllelicAlphabet.h.

Member Data Documentation

◆ alph_

std::shared_ptr<const AllelicAlphabet> bpp::AllelicAlphabet::AllelicTransliterator::alph_
private

Definition at line 165 of file AllelicAlphabet.h.

Referenced by getSourceAlphabet(), and getTargetAlphabet().


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