Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

gnFastTranslator Class Reference

#include <gnFastTranslator.h>

Inheritance diagram for gnFastTranslator::

gnBaseFilter gnClone List of all members.

Public Types

enum  gnTranslatorType { ProteinDNATranslatorType, DNAProteinTranslatorType }

Public Methods

 gnFastTranslator ()
 gnFastTranslator (gnTranslatorType t_type)
 gnFastTranslator (const gnFastTranslator &sf)
gnFastTranslator& operator= (const gnFastTranslator &sf)
gnFastTranslator* Clone () const
virtual void CacheTranslator (const gnTranslator *tranny, string inputs, const gnSeqI input_width)
 Queries the specified gnTranslator for every possible combination translation of the characters specified in the inputs string. More...

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)
gnSeqC GetDefaultChar () const
void UseDefaultChar (const boolean use=true)
void SetPair (const string &ch1, const string &ch2)
void RemovePair (const string &ch)

Static Public Methods

const gnFastTranslator* ProteinDNATranslator ()
const gnFastTranslator* DNAProteinTranslator ()

Private Methods

void CreateProteinDNATranslator ()
void CreateDNAProteinTranslator ()

Private Attributes

map<string, string> m_transCache
const gnTranslatorm_translator
boolean use_default
gnSeqC m_defaultChar

Member Enumeration Documentation

enum gnFastTranslator::gnTranslatorType
 

Enumeration values:
ProteinDNATranslatorType  
DNAProteinTranslatorType  

Definition at line 33 of file gnFastTranslator.h.


Constructor & Destructor Documentation

gnFastTranslator::gnFastTranslator ( )
 

Definition at line 26 of file gnFastTranslator.cpp.

Referenced by Clone(), DNAProteinTranslator(), and ProteinDNATranslator().

gnFastTranslator::gnFastTranslator ( gnTranslatorType t_type )
 

Definition at line 39 of file gnFastTranslator.cpp.

gnFastTranslator::gnFastTranslator ( const gnFastTranslator & sf )
 

Definition at line 32 of file gnFastTranslator.cpp.


Member Function Documentation

void gnFastTranslator::CacheTranslator ( const gnTranslator * tranny,
string inputs,
const gnSeqI input_width ) [virtual]
 

Queries the specified gnTranslator for every possible combination translation of the characters specified in the inputs string.

An input_width may be specified so that every possible combination of "input_width" characters in "inputs" will be cached. This is useful for DNA to protein translations, for example.

Parameters:
tranny   The gnTranslator to cache.
inputs   The characters to cache from tranny.
input_width   The number of characters in each query to make to tranny.

Definition at line 125 of file gnFastTranslator.cpp.

Referenced by gnFastTranslator().

gnFastTranslator * gnFastTranslator::Clone ( ) const [inline, virtual]
 

Reimplemented from gnBaseFilter.

Definition at line 84 of file gnFastTranslator.h.

void gnFastTranslator::CreateDNAProteinTranslator ( ) [private]
 

void gnFastTranslator::CreateProteinDNATranslator ( ) [private]
 

const gnFastTranslator * gnFastTranslator::DNAProteinTranslator ( ) [static]
 

Definition at line 20 of file gnFastTranslator.cpp.

Referenced by gnPosSpecificTranslator::gnPosSpecificTranslator(), and main().

void gnFastTranslator::Filter ( string & seq ) const [virtual]
 

Filters the given string.

Parameters:
seq   The string to filter

Reimplemented from gnBaseFilter.

Definition at line 94 of file gnFastTranslator.cpp.

void gnFastTranslator::Filter ( gnSeqC ** seq,
uint32 & len ) const [virtual]
 

Filter the given character array.

Parameters:
seq   A pointer to the character array
len   the length of the character array to filter
Returns:
The filtered character

Reimplemented from gnBaseFilter.

Definition at line 63 of file gnFastTranslator.cpp.

gnSeqC gnFastTranslator::Filter ( const gnSeqC ch ) const [virtual]
 

Filter the given character.

Parameters:
ch   The character to filter
Returns:
The filtered character

Reimplemented from gnBaseFilter.

Definition at line 54 of file gnFastTranslator.cpp.

Referenced by main().

gnSeqC gnFastTranslator::GetDefaultChar ( ) const [inline]
 

Definition at line 96 of file gnFastTranslator.h.

const gnFastTranslator * gnFastTranslator::ProteinDNATranslator ( ) [static]
 

Definition at line 16 of file gnFastTranslator.cpp.

Referenced by gnPosSpecificTranslator::gnPosSpecificTranslator().

void gnFastTranslator::RemovePair ( const string & ch )
 

void gnFastTranslator::SetDefaultChar ( const gnSeqC ch1 ) [inline]
 

Definition at line 90 of file gnFastTranslator.h.

void gnFastTranslator::SetPair ( const string & ch1,
const string & ch2 )
 

void gnFastTranslator::UseDefaultChar ( const boolean use = true ) [inline]
 

Definition at line 102 of file gnFastTranslator.h.

gnFastTranslator & gnFastTranslator::operator= ( const gnFastTranslator & sf )
 


Member Data Documentation

gnSeqC gnFastTranslator::m_defaultChar [private]
 

Definition at line 80 of file gnFastTranslator.h.

map< string, string > gnFastTranslator::m_transCache<string, string> [private]
 

Definition at line 76 of file gnFastTranslator.h.

const gnTranslator * gnFastTranslator::m_translator [private]
 

Definition at line 77 of file gnFastTranslator.h.

boolean gnFastTranslator::use_default [private]
 

Definition at line 79 of file gnFastTranslator.h.


The documentation for this class was generated from the following files:
Generated at Thu Apr 4 01:52:05 2002 for libGenome by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001