bpp-seq  2.2.0
bpp::NucleicAcidsReplication Class Reference

Replication between to nucleic acids. More...

#include <Bpp/Seq/NucleicAcidsReplication.h>

+ Inheritance diagram for bpp::NucleicAcidsReplication:
+ Collaboration diagram for bpp::NucleicAcidsReplication:

Public Member Functions

 NucleicAcidsReplication (const NucleicAlphabet *nuc1, const NucleicAlphabet *nuc2)
 
 NucleicAcidsReplication (const NucleicAcidsReplication &nar)
 
NucleicAcidsReplicationoperator= (const NucleicAcidsReplication &nar)
 
virtual ~NucleicAcidsReplication ()
 
const AlphabetgetSourceAlphabet () const
 Get the source alphabet. More...
 
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)
 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 NucleicAlphabetnuc1_
 
const NucleicAlphabetnuc2_
 
std::map< int, int > trans_
 

Detailed Description

Replication between to nucleic acids.

Example of use:

Since this is an instance of the ReverseIterator interface, transcription and reverse transcription may be achieved from the same instance of the object by using the translate and reverse methods.

Definition at line 65 of file NucleicAcidsReplication.h.

Constructor & Destructor Documentation

◆ NucleicAcidsReplication() [1/2]

NucleicAcidsReplication::NucleicAcidsReplication ( const NucleicAlphabet nuc1,
const NucleicAlphabet nuc2 
)

Definition at line 46 of file NucleicAcidsReplication.cpp.

References trans_.

◆ NucleicAcidsReplication() [2/2]

bpp::NucleicAcidsReplication::NucleicAcidsReplication ( const NucleicAcidsReplication nar)
inline

Definition at line 74 of file NucleicAcidsReplication.h.

◆ ~NucleicAcidsReplication()

virtual bpp::NucleicAcidsReplication::~NucleicAcidsReplication ( )
inlinevirtual

Definition at line 87 of file NucleicAcidsReplication.h.

Member Function Documentation

◆ getSourceAlphabet()

const Alphabet* bpp::NucleicAcidsReplication::getSourceAlphabet ( ) const
inlinevirtual

Get the source alphabet.

Returns
The source alphabet.

Implements bpp::Transliterator.

Definition at line 90 of file NucleicAcidsReplication.h.

References nuc1_.

◆ getTargetAlphabet()

const Alphabet* bpp::NucleicAcidsReplication::getTargetAlphabet ( ) const
inlinevirtual

Get the target alphabet.

Returns
The target alphabet.

Implements bpp::Transliterator.

Definition at line 91 of file NucleicAcidsReplication.h.

References nuc2_.

◆ operator=()

NucleicAcidsReplication& bpp::NucleicAcidsReplication::operator= ( const NucleicAcidsReplication nar)
inline

Definition at line 78 of file NucleicAcidsReplication.h.

References nuc1_, nuc2_, and trans_.

◆ reverse() [1/3]

int NucleicAcidsReplication::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::ReverseTransliterator.

Definition at line 96 of file NucleicAcidsReplication.cpp.

◆ reverse() [2/3]

std::string NucleicAcidsReplication::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::ReverseTransliterator.

Definition at line 102 of file NucleicAcidsReplication.cpp.

◆ reverse() [3/3]

Sequence * NucleicAcidsReplication::reverse ( const Sequence sequence) const
throw (AlphabetMismatchException,
Exception
)
virtual

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.

Implements bpp::ReverseTransliterator.

Definition at line 108 of file NucleicAcidsReplication.cpp.

References bpp::BasicSymbolList::addElement().

◆ translate() [1/3]

int NucleicAcidsReplication::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::Transliterator.

Definition at line 70 of file NucleicAcidsReplication.cpp.

Referenced by bpp::SequenceWithQualityTools::complement(), bpp::SequenceTools::complement(), bpp::SequenceTools::getComplement(), and bpp::SequenceTools::invertComplement().

◆ translate() [2/3]

std::string NucleicAcidsReplication::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::Transliterator.

Definition at line 76 of file NucleicAcidsReplication.cpp.

◆ translate() [3/3]

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

Definition at line 82 of file NucleicAcidsReplication.cpp.

References bpp::BasicSymbolList::addElement().

Member Data Documentation

◆ nuc1_

const NucleicAlphabet* bpp::NucleicAcidsReplication::nuc1_
private

Definition at line 69 of file NucleicAcidsReplication.h.

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

◆ nuc2_

const NucleicAlphabet * bpp::NucleicAcidsReplication::nuc2_
private

Definition at line 69 of file NucleicAcidsReplication.h.

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

◆ trans_

std::map<int, int> bpp::NucleicAcidsReplication::trans_
mutableprivate

Definition at line 70 of file NucleicAcidsReplication.h.

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


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