bpp-seq3  3.0.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 (std::shared_ptr< const NucleicAlphabet > nuc1, std::shared_ptr< const NucleicAlphabet > nuc2)
 
 NucleicAcidsReplication (const NucleicAcidsReplication &nar)
 
NucleicAcidsReplicationoperator= (const NucleicAcidsReplication &nar)
 
virtual ~NucleicAcidsReplication ()
 
std::shared_ptr< const AlphabetgetSourceAlphabet () const override
 Get the source alphabet. More...
 
const AlphabetsourceAlphabet () const override
 Get the source alphabet. More...
 
std::shared_ptr< const AlphabetgetTargetAlphabet () const override
 Get the target alphabet. More...
 
const AlphabettargetAlphabet () const override
 Get the target alphabet. More...
 
int translate (int state) const override
 Translate a given state coded as a int from source alphabet to target alphabet. More...
 
std::string translate (const std::string &state) const override
 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...
 
int reverse (int state) const override
 Translate a given state coded as a int from target alphabet to source alphabet. More...
 
std::string reverse (const std::string &state) const override
 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...
 

Private Attributes

std::shared_ptr< const NucleicAlphabetnuc1_
 
std::shared_ptr< 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 31 of file NucleicAcidsReplication.h.

Constructor & Destructor Documentation

◆ NucleicAcidsReplication() [1/2]

NucleicAcidsReplication::NucleicAcidsReplication ( std::shared_ptr< const NucleicAlphabet nuc1,
std::shared_ptr< const NucleicAlphabet nuc2 
)

Definition at line 11 of file NucleicAcidsReplication.cpp.

References trans_.

◆ NucleicAcidsReplication() [2/2]

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

Definition at line 43 of file NucleicAcidsReplication.h.

◆ ~NucleicAcidsReplication()

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

Definition at line 57 of file NucleicAcidsReplication.h.

Member Function Documentation

◆ getSourceAlphabet()

std::shared_ptr<const Alphabet> bpp::NucleicAcidsReplication::getSourceAlphabet ( ) const
inlineoverridevirtual

Get the source alphabet.

Returns
A pointer toward the source alphabet.

Implements bpp::TransliteratorInterface.

Definition at line 60 of file NucleicAcidsReplication.h.

References nuc1_.

Referenced by reverse(), and translate().

◆ getTargetAlphabet()

std::shared_ptr<const Alphabet> bpp::NucleicAcidsReplication::getTargetAlphabet ( ) const
inlineoverridevirtual

Get the target alphabet.

Returns
A pointer toward the target alphabet.

Implements bpp::TransliteratorInterface.

Definition at line 64 of file NucleicAcidsReplication.h.

References nuc2_.

Referenced by reverse(), and translate().

◆ operator=()

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

Definition at line 48 of file NucleicAcidsReplication.h.

References nuc1_, nuc2_, and trans_.

◆ reverse() [1/3]

unique_ptr< Sequence > NucleicAcidsReplication::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 75 of file NucleicAcidsReplication.cpp.

References bpp::CruxSymbolListInterface::getAlphabet(), bpp::Commentable::getComments(), bpp::CoreSequenceInterface::getName(), getSourceAlphabet(), getTargetAlphabet(), bpp::TemplateCoreSymbolListInterface< T >::getValue(), reverse(), and bpp::CruxSymbolListInterface::size().

◆ reverse() [2/3]

std::string NucleicAcidsReplication::reverse ( const std::string &  state) const
overridevirtual

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.

Definition at line 69 of file NucleicAcidsReplication.cpp.

References nuc1_, nuc2_, and trans_.

◆ reverse() [3/3]

int NucleicAcidsReplication::reverse ( int  state) const
overridevirtual

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.

Definition at line 63 of file NucleicAcidsReplication.cpp.

References nuc2_, and trans_.

Referenced by reverse().

◆ sourceAlphabet()

const Alphabet& bpp::NucleicAcidsReplication::sourceAlphabet ( ) const
inlineoverridevirtual

Get the source alphabet.

Returns
A reference toward the source alphabet.

Implements bpp::TransliteratorInterface.

Definition at line 62 of file NucleicAcidsReplication.h.

References nuc1_.

◆ targetAlphabet()

const Alphabet& bpp::NucleicAcidsReplication::targetAlphabet ( ) const
inlineoverridevirtual

Get the target alphabet.

Returns
A reference toward the target alphabet.

Implements bpp::TransliteratorInterface.

Definition at line 66 of file NucleicAcidsReplication.h.

References nuc2_.

◆ translate() [1/3]

unique_ptr< Sequence > NucleicAcidsReplication::translate ( const SequenceInterface sequence) const
overridevirtual

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 49 of file NucleicAcidsReplication.cpp.

References bpp::CruxSymbolListInterface::getAlphabet(), bpp::Commentable::getComments(), bpp::CoreSequenceInterface::getName(), getSourceAlphabet(), getTargetAlphabet(), bpp::TemplateCoreSymbolListInterface< T >::getValue(), bpp::CruxSymbolListInterface::size(), and translate().

◆ translate() [2/3]

std::string NucleicAcidsReplication::translate ( const std::string &  state) const
overridevirtual

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.

Definition at line 43 of file NucleicAcidsReplication.cpp.

References nuc1_, nuc2_, and trans_.

◆ translate() [3/3]

int NucleicAcidsReplication::translate ( int  state) const
overridevirtual

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.

Definition at line 37 of file NucleicAcidsReplication.cpp.

References nuc1_, and trans_.

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

Member Data Documentation

◆ nuc1_

std::shared_ptr<const NucleicAlphabet> bpp::NucleicAcidsReplication::nuc1_
private

◆ nuc2_

std::shared_ptr<const NucleicAlphabet> bpp::NucleicAcidsReplication::nuc2_
private

◆ trans_

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

Definition at line 36 of file NucleicAcidsReplication.h.

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


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