#include <gnTranslator.h>
Inheritance diagram for gnTranslator::
Public Types | |
enum | gnTranslatorType { ProteinDNATranslatorType, ProteinRNATranslatorType, DNAProteinTranslatorType, RNAProteinTranslatorType } |
Public Methods | |
gnTranslator () | |
gnTranslator (gnTranslatorType t_type) | |
gnTranslator (const gnTranslator &sf) | |
gnTranslator* | Clone () const |
virtual gnSeqC | Filter (const gnSeqC ch) const |
Filter the given character. More... | |
virtual void | Filter (gnSeqC **seq, uint32 &len) const |
Filter the given character array. More... | |
virtual void | Filter (string &seq) const |
Filters the given string. More... | |
void | SetDefaultChar (const gnSeqC ch1) |
Sets the default character to insert when no valid translation exists. More... | |
gnSeqC | GetDefaultChar () const |
Gets the default character which is inserted into the destination sequence when no valid translation exists. More... | |
void | UseDefaultChar (const boolean use=true) |
Set whether the default character is inserted upon translation failure. More... | |
void | SetDefaultInputWidth (const uint32 defaultInputWidth) |
Set the expected number of characters in each unit of translation. More... | |
uint32 | GetDefaultInputWidth () const |
Get the expected number of characters in each unit of translation. More... | |
void | SetPair (const string &input, const string &output) |
Set a translation mapping. More... | |
void | RemovePair (const string &input) |
Removes a translation mapping. More... | |
void | SetCompare (const gnCompare *comp) |
Set the comparator to use. More... | |
Static Public Methods | |
const gnTranslator* | ProteinDNATranslator () |
const gnTranslator* | ProteinRNATranslator () |
const gnTranslator* | DNAProteinTranslator () |
const gnTranslator* | RNAProteinTranslator () |
Private Methods | |
void | CreateProteinDNATranslator () |
void | CreateProteinRNATranslator () |
void | CreateDNAProteinTranslator () |
void | CreateRNAProteinTranslator () |
Private Attributes | |
vector<string> | m_inputTable |
vector<string> | m_outputTable |
const gnCompare* | compare |
boolean | use_default |
gnSeqC | m_defaultChar |
uint32 | m_defaultInputWidth |
It can also perform reverse translation from Protein to RNA or DNA though the utility of this functionality is somewhat questionable since it does not assign nucleotides probabilistically. Do not attempt to instantiate this class unless you are defining a new translation type. Instead use the static member access functions ProteinDNATranslator(), ProteinRNATranslator(), DNAProteinTranslator(), and RNAProteinTranslator() In general, the gnFastTranslator class should be used instead of this one.
Definition at line 37 of file gnTranslator.h.
|
Definition at line 46 of file gnTranslator.h. |
|
Definition at line 35 of file gnTranslator.cpp. Referenced by Clone(), DNAProteinTranslator(), ProteinDNATranslator(), ProteinRNATranslator(), and RNAProteinTranslator().
|
|
Definition at line 52 of file gnTranslator.cpp. |
|
Definition at line 42 of file gnTranslator.cpp. |
|
Reimplemented from gnBaseFilter. Definition at line 135 of file gnTranslator.h. |
|
Definition at line 225 of file gnTranslator.cpp. Referenced by gnTranslator().
|
|
Definition at line 161 of file gnTranslator.cpp. Referenced by gnTranslator().
|
|
Definition at line 193 of file gnTranslator.cpp. Referenced by gnTranslator().
|
|
Definition at line 288 of file gnTranslator.cpp. Referenced by gnTranslator().
|
|
Definition at line 25 of file gnTranslator.cpp. Referenced by main().
|
|
Filters the given string.
Reimplemented from gnBaseFilter. Definition at line 113 of file gnTranslator.cpp. |
|
Filter the given character array.
Reimplemented from gnBaseFilter. Definition at line 82 of file gnTranslator.cpp. |
|
Filter the given character.
Reimplemented from gnBaseFilter. Definition at line 73 of file gnTranslator.cpp. Referenced by gnFastTranslator::CacheTranslator(), and main().
|
|
Gets the default character which is inserted into the destination sequence when no valid translation exists.
Definition at line 147 of file gnTranslator.h. |
|
Get the expected number of characters in each unit of translation. For DNA to Protein, for instance, this is 3 because each codon is 3 characters of input.
Definition at line 164 of file gnTranslator.h. |
|
Definition at line 17 of file gnTranslator.cpp. |
|
Definition at line 21 of file gnTranslator.cpp. |
|
Definition at line 29 of file gnTranslator.cpp. |
|
Removes a translation mapping. RemovePair removes the translation mapping corresponding to the given input string.
Definition at line 150 of file gnTranslator.cpp. |
|
Set the comparator to use. Ambiguous base matching is facilitated using a gnCompare object. This must be set to allow sequences to be compared.
Definition at line 169 of file gnTranslator.h. Referenced by CreateDNAProteinTranslator(), CreateProteinDNATranslator(), CreateProteinRNATranslator(), and CreateRNAProteinTranslator().
|
|
Sets the default character to insert when no valid translation exists.
Definition at line 141 of file gnTranslator.h. Referenced by CreateDNAProteinTranslator(), CreateProteinDNATranslator(), CreateProteinRNATranslator(), and CreateRNAProteinTranslator().
|
|
Set the expected number of characters in each unit of translation. For DNA to Protein, for instance, this is 3 because each codon is 3 characters of input.
Definition at line 159 of file gnTranslator.h. |
|
Set a translation mapping. The first value is the input, the second value is the output. During translation, any occurrences of the first string will be transformed to the second string. A gnCompare object is used to facilitate ambiguity matching.
Definition at line 141 of file gnTranslator.cpp. Referenced by CreateDNAProteinTranslator(), CreateProteinDNATranslator(), CreateProteinRNATranslator(), and CreateRNAProteinTranslator().
|
|
Set whether the default character is inserted upon translation failure.
Definition at line 153 of file gnTranslator.h. |
|
Definition at line 127 of file gnTranslator.h. |
|
Definition at line 130 of file gnTranslator.h. |
|
Definition at line 131 of file gnTranslator.h. |
|
Definition at line 125 of file gnTranslator.h. |
|
Definition at line 125 of file gnTranslator.h. |
|
Definition at line 129 of file gnTranslator.h. |