bpp-seq  2.2.0
bpp::Transliterator 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::Transliterator:

Public Member Functions

 Transliterator ()
 
virtual ~Transliterator ()
 
virtual const AlphabetgetSourceAlphabet () const =0
 Get the source alphabet. More...
 
virtual const AlphabetgetTargetAlphabet () const =0
 Get the target alphabet. More...
 
virtual int translate (int state) const =0 throw (BadIntException, Exception)
 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 throw (BadCharException, Exception)
 Translate a given state coded as a string from source alphabet to target alphabet. More...
 
virtual Sequencetranslate (const Sequence &sequence) const =0 throw (AlphabetMismatchException, Exception)
 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 52 of file Transliterator.h.

Constructor & Destructor Documentation

◆ Transliterator()

bpp::Transliterator::Transliterator ( )
inline

Definition at line 55 of file Transliterator.h.

◆ ~Transliterator()

virtual bpp::Transliterator::~Transliterator ( )
inlinevirtual

Definition at line 56 of file Transliterator.h.

Member Function Documentation

◆ getSourceAlphabet()

virtual const Alphabet* bpp::Transliterator::getSourceAlphabet ( ) const
pure virtual

Get the source alphabet.

Returns
The source alphabet.

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

◆ getTargetAlphabet()

virtual const Alphabet* bpp::Transliterator::getTargetAlphabet ( ) const
pure virtual

Get the target alphabet.

Returns
The target alphabet.

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

◆ translate() [1/3]

virtual int bpp::Transliterator::translate ( int  state) const
throw (BadIntException,
Exception
)
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.
Exceptions
BadIntExceptionIf the state is not a proper state for source alphabet.
ExceptionOther kind of error, depending on the implementation.

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

◆ translate() [2/3]

virtual std::string bpp::Transliterator::translate ( const std::string &  state) const
throw (BadCharException,
Exception
)
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.
Exceptions
BadCharExceptionIf the state is not a proper state for source alphabet.
ExceptionOther kind of error, depending on the implementation.

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

◆ translate() [3/3]

virtual Sequence* bpp::Transliterator::translate ( const Sequence sequence) const
throw (AlphabetMismatchException,
Exception
)
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.
Exceptions
AlphabetMismatchExceptionIf the sequence alphabet do not match the source alphabet.
ExceptionOther kind of error, depending on the implementation.

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


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