bpp-seq3  3.0.0
bpp::TransliteratorInterface Class Referenceabstract

This interface is used when translating a sequence from an alphabet to another: it gives the translation rules, eg: RNA -> DNA. More...

#include <Bpp/Seq/Transliterator.h>

+ Inheritance diagram for bpp::TransliteratorInterface:

Public Member Functions

 TransliteratorInterface ()
 
virtual ~TransliteratorInterface ()
 
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...
 
virtual int translate (int state) const =0
 Translate a given state coded as a int from source alphabet to target alphabet. More...
 
virtual std::string translate (const std::string &state) const =0
 Translate a given state coded as a string from source alphabet to target alphabet. More...
 
virtual std::unique_ptr< Sequencetranslate (const SequenceInterface &sequence) const =0
 Translate a whole sequence from source alphabet to target alphabet. More...
 

Detailed Description

This interface is used when translating a sequence from an alphabet to another: it gives the translation rules, eg: RNA -> DNA.

Definition at line 17 of file Transliterator.h.

Constructor & Destructor Documentation

◆ TransliteratorInterface()

bpp::TransliteratorInterface::TransliteratorInterface ( )
inline

Definition at line 20 of file Transliterator.h.

◆ ~TransliteratorInterface()

virtual bpp::TransliteratorInterface::~TransliteratorInterface ( )
inlinevirtual

Definition at line 21 of file Transliterator.h.

Member Function Documentation

◆ getSourceAlphabet()

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

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 virtual

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 virtual

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 virtual

Get the target alphabet.

Returns
A reference toward the target alphabet.

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

◆ translate() [1/3]

virtual std::unique_ptr<Sequence> bpp::TransliteratorInterface::translate ( const SequenceInterface sequence) const
pure virtual

Translate a whole sequence from source alphabet to target alphabet.

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

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

◆ translate() [2/3]

virtual std::string bpp::TransliteratorInterface::translate ( const std::string &  state) const
pure 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.

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

◆ translate() [3/3]

virtual int bpp::TransliteratorInterface::translate ( int  state) const
pure 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.

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


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