bpp-seq3  3.0.0
bpp::AbstractReverseTransliterator Class Referenceabstract

Partial implementation of the ReverseTransliterator interface. More...

#include <Bpp/Seq/Transliterator.h>

+ Inheritance diagram for bpp::AbstractReverseTransliterator:
+ Collaboration diagram for bpp::AbstractReverseTransliterator:

Public Member Functions

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

Detailed Description

Partial implementation of the ReverseTransliterator interface.

Definition at line 133 of file Transliterator.h.

Constructor & Destructor Documentation

◆ AbstractReverseTransliterator()

bpp::AbstractReverseTransliterator::AbstractReverseTransliterator ( )
inline

Definition at line 138 of file Transliterator.h.

◆ ~AbstractReverseTransliterator()

virtual bpp::AbstractReverseTransliterator::~AbstractReverseTransliterator ( )
inlinevirtual

Definition at line 139 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.

◆ reverse() [1/3]

unique_ptr< Sequence > AbstractReverseTransliterator::reverse ( const SequenceInterface sequence) const
overridevirtual

Translate a whole sequence from target alphabet to source alphabet.

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

Implements bpp::ReverseTransliteratorInterface.

Definition at line 31 of file Transliterator.cpp.

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

◆ reverse() [2/3]

std::string bpp::AbstractReverseTransliterator::reverse ( const std::string &  state) const
overridepure virtual

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

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

Implements bpp::ReverseTransliteratorInterface.

Implemented in bpp::DNAToRNA.

◆ reverse() [3/3]

int bpp::AbstractReverseTransliterator::reverse ( int  state) const
overridepure virtual

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

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

Implements bpp::ReverseTransliteratorInterface.

Implemented in bpp::DNAToRNA.

Referenced by bpp::DNAToRNA::reverse().

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

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

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/6]

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

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() [3/6]

virtual std::string bpp::TransliteratorInterface::translate ( const std::string &  state) const
pure virtualinherited

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() [4/6]

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

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() [5/6]

virtual int bpp::TransliteratorInterface::translate ( int  state) const
pure virtualinherited

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.

◆ translate() [6/6]

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

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: