bpp-seq3  3.0.0
bpp::AbstractTransliterator Class Referenceabstract

Partial implementation of the Transliterator interface. More...

#include <Bpp/Seq/Transliterator.h>

+ Inheritance diagram for bpp::AbstractTransliterator:
+ Collaboration diagram for bpp::AbstractTransliterator:

Public Member Functions

 AbstractTransliterator ()
 
virtual ~AbstractTransliterator ()
 
int translate (int state) const override=0
 Translate a given state coded as a int from source alphabet to target alphabet. More...
 
std::string translate (const std::string &state) const override=0
 Translate a given state coded as a string from source alphabet to target alphabet. More...
 
std::unique_ptr< Sequencetranslate (const SequenceInterface &sequence) const override
 Translate a whole sequence from source alphabet to target alphabet. More...
 
virtual std::shared_ptr< const AlphabetgetSourceAlphabet () const =0
 Get the source alphabet. More...
 
virtual const AlphabetsourceAlphabet () const =0
 Get the source alphabet. More...
 
virtual std::shared_ptr< const AlphabetgetTargetAlphabet () const =0
 Get the target alphabet. More...
 
virtual const AlphabettargetAlphabet () const =0
 Get the target alphabet. More...
 

Detailed Description

Partial implementation of the Transliterator interface.

Definition at line 116 of file Transliterator.h.

Constructor & Destructor Documentation

◆ AbstractTransliterator()

bpp::AbstractTransliterator::AbstractTransliterator ( )
inline

Definition at line 120 of file Transliterator.h.

◆ ~AbstractTransliterator()

virtual bpp::AbstractTransliterator::~AbstractTransliterator ( )
inlinevirtual

Definition at line 121 of file Transliterator.h.

Member Function Documentation

◆ getSourceAlphabet()

virtual std::shared_ptr<const Alphabet> bpp::TransliteratorInterface::getSourceAlphabet ( ) const
pure virtualinherited

Get the source alphabet.

Returns
A pointer toward the source alphabet.

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

◆ getTargetAlphabet()

virtual std::shared_ptr<const Alphabet> bpp::TransliteratorInterface::getTargetAlphabet ( ) const
pure virtualinherited

Get the target alphabet.

Returns
A pointer toward the target alphabet.

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

◆ 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]

unique_ptr< Sequence > AbstractTransliterator::translate ( const SequenceInterface sequence) const
overridevirtual

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 13 of file Transliterator.cpp.

References bpp::CruxSymbolListInterface::alphabet(), bpp::CruxSymbolListInterface::getAlphabet(), bpp::Alphabet::getAlphabetType(), bpp::Commentable::getComments(), bpp::CoreSequenceInterface::getName(), bpp::TemplateCoreSymbolListInterface< T >::getValue(), and bpp::CruxSymbolListInterface::size().

◆ translate() [2/3]

std::string bpp::AbstractTransliterator::translate ( const std::string &  state) const
overridepure virtual

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::TransliteratorInterface.

Implemented in bpp::GeneticCode, bpp::DNAToRNA, and bpp::AllelicAlphabet::AllelicTransliterator.

◆ translate() [3/3]

int bpp::AbstractTransliterator::translate ( int  state) const
overridepure virtual

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

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

Implements bpp::TransliteratorInterface.

Implemented in bpp::GeneticCode, bpp::DNAToRNA, and bpp::AllelicAlphabet::AllelicTransliterator.

Referenced by bpp::AllelicAlphabet::AllelicTransliterator::translate(), bpp::DNAToRNA::translate(), and bpp::GeneticCode::translate().


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