bpp-seq  2.2.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 ()
 
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 throw (AlphabetMismatchException, Exception)
 Translate a whole sequence from source alphabet to target alphabet. More...
 
virtual const AlphabetgetSourceAlphabet () const =0
 Get the source alphabet. More...
 
virtual const AlphabetgetTargetAlphabet () const =0
 Get the target alphabet. More...
 

Detailed Description

Partial implementation of the Transliterator interface.

Definition at line 151 of file Transliterator.h.

Constructor & Destructor Documentation

◆ AbstractTransliterator()

bpp::AbstractTransliterator::AbstractTransliterator ( )
inline

Definition at line 155 of file Transliterator.h.

◆ ~AbstractTransliterator()

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

Definition at line 156 of file Transliterator.h.

Member Function Documentation

◆ getSourceAlphabet()

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

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 virtualinherited

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

Implements bpp::Transliterator.

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

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

◆ translate() [2/3]

virtual std::string bpp::AbstractTransliterator::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.

Implements bpp::Transliterator.

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

◆ translate() [3/3]

Sequence * AbstractTransliterator::translate ( const Sequence sequence) const
throw (AlphabetMismatchException,
Exception
)
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.

Implements bpp::Transliterator.

Reimplemented in bpp::GeneticCode, and bpp::DNAToRNA.

Definition at line 44 of file Transliterator.cpp.

References bpp::SymbolList::addElement(), bpp::BasicSymbolList::getAlphabet(), and bpp::Alphabet::getGapCharacterCode().


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