bpp-seq  2.2.0
bpp::DNAToRNA Class Reference

Reverse iterator to convert RNA to DNA. More...

#include <Bpp/Seq/DNAToRNA.h>

+ Inheritance diagram for bpp::DNAToRNA:
+ Collaboration diagram for bpp::DNAToRNA:

Public Member Functions

 DNAToRNA ()
 
 DNAToRNA (const DNAToRNA &d2r)
 
DNAToRNAoperator= (const DNAToRNA &d2r)
 
virtual ~DNAToRNA ()
 
virtual const AlphabetgetSourceAlphabet () const
 Get the source alphabet. More...
 
virtual const AlphabetgetTargetAlphabet () const
 Get the target alphabet. More...
 
int translate (int state) const throw (BadIntException)
 Translate a given state coded as a int from source alphabet to target alphabet. More...
 
std::string translate (const std::string &state) const throw (BadCharException)
 Translate a given state coded as a string from source alphabet to target alphabet. More...
 
Sequencetranslate (const Sequence &sequence) const throw (AlphabetMismatchException, Exception)
 Translate a whole sequence from source alphabet to target alphabet. More...
 
int reverse (int state) const throw (BadIntException)
 Translate a given state coded as a int from target alphabet to source alphabet. More...
 
std::string reverse (const std::string &state) const throw (BadCharException)
 Translate a given state coded as a string from target alphabet to source alphabet. More...
 
Sequencereverse (const Sequence &sequence) const throw (AlphabetMismatchException, Exception)
 Translate a whole sequence from target alphabet to source alphabet. More...
 

Private Attributes

const Alphabetdna_
 
const Alphabetrna_
 

Detailed Description

Reverse iterator to convert RNA to DNA.

This only changes U to T characters.

See also
NucleicAcidsReplication

Definition at line 58 of file DNAToRNA.h.

Constructor & Destructor Documentation

◆ DNAToRNA() [1/2]

bpp::DNAToRNA::DNAToRNA ( )
inline

Definition at line 65 of file DNAToRNA.h.

◆ DNAToRNA() [2/2]

bpp::DNAToRNA::DNAToRNA ( const DNAToRNA d2r)
inline

Definition at line 67 of file DNAToRNA.h.

◆ ~DNAToRNA()

virtual bpp::DNAToRNA::~DNAToRNA ( )
inlinevirtual

Definition at line 77 of file DNAToRNA.h.

Member Function Documentation

◆ getSourceAlphabet()

virtual const Alphabet* bpp::DNAToRNA::getSourceAlphabet ( ) const
inlinevirtual

Get the source alphabet.

Returns
The source alphabet.

Implements bpp::AbstractReverseTransliterator.

Definition at line 80 of file DNAToRNA.h.

References dna_.

◆ getTargetAlphabet()

virtual const Alphabet* bpp::DNAToRNA::getTargetAlphabet ( ) const
inlinevirtual

Get the target alphabet.

Returns
The target alphabet.

Implements bpp::AbstractReverseTransliterator.

Definition at line 81 of file DNAToRNA.h.

References rna_.

◆ operator=()

DNAToRNA& bpp::DNAToRNA::operator= ( const DNAToRNA d2r)
inline

Definition at line 69 of file DNAToRNA.h.

References dna_, and rna_.

◆ reverse() [1/3]

int DNAToRNA::reverse ( int  state) const
throw (BadIntException
)
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.
Exceptions
BadIntExceptionIf the state is not a proper state for target alphabet.
ExceptionOther kind of error, depending on the implementation.

Implements bpp::AbstractReverseTransliterator.

Definition at line 63 of file DNAToRNA.cpp.

◆ reverse() [2/3]

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

Implements bpp::AbstractReverseTransliterator.

Definition at line 71 of file DNAToRNA.cpp.

◆ reverse() [3/3]

Sequence* bpp::DNAToRNA::reverse ( const Sequence sequence) const
throw (AlphabetMismatchException,
Exception
)
inlinevirtual

Translate a whole sequence from target alphabet to source alphabet.

Parameters
sequenceA sequence in target alphabet.
Returns
The corresponding sequence in source alphabet.
Exceptions
AlphabetMismatchExceptionIf the sequence alphabet do not match the target alphabet.
ExceptionOther kind of error, depending on the implementation.

Reimplemented from bpp::AbstractReverseTransliterator.

Definition at line 90 of file DNAToRNA.h.

References bpp::AbstractReverseTransliterator::reverse().

◆ translate() [1/3]

int DNAToRNA::translate ( int  state) const
throw (BadIntException
)
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::AbstractTransliterator.

Definition at line 47 of file DNAToRNA.cpp.

◆ translate() [2/3]

string DNAToRNA::translate ( const std::string &  state) const
throw (BadCharException
)
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::AbstractTransliterator.

Definition at line 55 of file DNAToRNA.cpp.

◆ translate() [3/3]

Sequence* bpp::DNAToRNA::translate ( const Sequence sequence) const
throw (AlphabetMismatchException,
Exception
)
inlinevirtual

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.

Reimplemented from bpp::AbstractTransliterator.

Definition at line 84 of file DNAToRNA.h.

References bpp::AbstractTransliterator::translate().

Member Data Documentation

◆ dna_

const Alphabet* bpp::DNAToRNA::dna_
private

Definition at line 62 of file DNAToRNA.h.

Referenced by getSourceAlphabet(), and operator=().

◆ rna_

const Alphabet * bpp::DNAToRNA::rna_
private

Definition at line 62 of file DNAToRNA.h.

Referenced by getTargetAlphabet(), and operator=().


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