Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

TVector Class Reference

This class stores all sequence information, both DNA and amino acids. More...

#include <TVector.h>

List of all members.

Public Member Functions

 TVector (ChildBase *win=NULL)
 Constructor.
 ~TVector ()
 Destructor.
void init ()
 Set up basic values.
void clear ()
 Reset internal state.
void recalculateCuts ()
 Recalculate restriction enzyme cuts.
void getCuts (TRestrictionEnzyme *e, vector< TRestrictionCut > &ret, bool clear_vector=true, int max=10000000)
 Gets the cuts of restriction enzyme in this sequence.
bool reduceToFragment (TRestrictionCut left, TRestrictionCut right)
 Cuts off everything except what is betreen these two cuts.
void doRestriction ()
 Performs restriction. See TRestrictionEditor.
void sortRestrictionSites ()
 Sorts the restriction sites by point of cut.
int countCuts (wxString enzyme)
 Counts the number of cuts for an enzyme in this sequence.
void methylationSites (wxArrayInt &vi, int what=ALL_METHYLATION_ENZYMES)
 Finds methylation sites.
bool basematch (char b1, char b2)
 matches DNA bases; b1 in IUPAC, b2 in SIUPAC. This is superior to the "=" operator :-)
void setIUPAC (char b, wxString s, char *pac=NULL)
char getNucleotide (int pos, bool complement=false)
 Returns the base at a certain position, or its complement.
void setNucleotide (int pos, char t)
 Sets a base at a certain position.
char getComplement (char c)
 Returns the complement of a given base.
void ligate_right (TVector &v, bool inverted=false)
 Adds another TVector to the right of this one.
void closeCircle ()
 Closes a linear sequence into a circular (intramolecular ligation).
void turn (int off)
 Turns a circular sequence "off" bases.
TVectorgetAAvector (int from, int to, int dir=1)
 Returns part of the sequence translated into amino acids.
void doAction ()
 Perform an action (restriction, usually). Internal use.
void doRemove (int from, int to, bool update=true, bool enableUndo=true)
 Removes part of the sequence.
void insert_char (char x, int pos, bool overwrite=false)
 Inserts a character into the sequence.
float getAAmw (char aa)
 Returns the molecular weight of an amino acid.
float getAApi (char aa)
 Returns the isoelectric point of an amino acid.
wxString dna2aa (wxString codon, int translation_table=-1)
 Translates a codon into an amino acid.
void setAction (wxString _action, int _action_value=0)
 Sets the action for doAction().
void setDatabase (wxString s)
 Sets the database in which the sequence is stored.
wxString getDatabase ()
 Returns the database name in which the sequence is stored.
TVectornewFromMark (int from, int to)
 Generates a new sequence based on a part of this one.
void setChanged (bool c=true)
 The sequence has been changed.
bool isChanged ()
 Was the sequence changed?
void ClearORFs ()
 Clear the found open reading frames.
void addORFs (int off)
 Add open reading frames for a specific reading frame.
void removeBlanksFromSequence ()
 Removes blank chars (spaces etc.) from the sequence.
void removeBlanksFromVector ()
 Removes blank chars (spaces etc.) from the sequence, altering items if necessary.
wxString getParams ()
 Return sequence parameters.
void setParams (wxString t)
 Set sequence parameters.
wxString getParam (wxString key)
 Return the value of a parameter.
void setParam (wxString key, wxString value)
 Set a parameter key/value pair.
void setWindow (ChildBase *c)
 Set the window which owns this sequence.
void setCircular (bool c=true)
 This is a circular sequence (or linear, if c == false).
bool isCircular ()
 Is this a circular sequence?
bool isLinear ()
 Is this a linear sequence?
wxString one2three (int a)
 Converts one letter amino acid code to three-letter acronym.
char three2one (wxString s)
 Converts three-letter acronym to one letter amino acid code.
void setStickyEnd (bool left, bool upper, wxString s)
 Sets one of the four possible sticky ends.
wxString getStickyEnd (bool left, bool upper)
 Returns one of the possible sticky ends.
bool hasStickyEnds ()
 Does this sequence have sticky ends?
void callUpdateUndoMenu ()
 Refreshes the Undo menu.
void setFromVector (TVector &v)
 Makes this sequence a copy of another one (v).
void doRemoveNucleotide (int x)
 Removes single base at position x.
int getItemLength (int a)
 Return the length of item a.
TVectorbacktranslate (wxString mode=_T(""))
 Generate a new DNA sequence from this amino acid sequence.
wxString getStrand53 ()
 Returns the 5'->3' strand of the sequence.
wxString getStrand35 ()
 Returns the 3'->5' strand of the sequence, as 5'->3'.
TAAProp getAAprop (char a)
 Returns the properties of the one-letter code amino acid.
int find_item (wxString s)
 Finds an item with that name.
bool isEnzymeHidden (wxString s)
 Is enzyme "s" hidden?
void hideEnzyme (wxString s, bool hideit=true)
 Set enzyme hidden state.
wxString getSubstring (int mf, int mt)
 Returns a sequence substring.
wxString transformSequence (bool inverse, bool reverse)
 Transforms the sequence.
wxString getSequence ()
 Returns the sequence.
wxString * getSequencePointer ()
 Internal use; only used by SequenceCanvas::OnCharHook.
char getSequenceChar (int x)
 Gets base at position x.
void setSequence (wxString ns)
 Sets the sequence.
void addToSequence (wxString x)
 Appends to the sequence.
void alterSequence (int pos, char c)
 Changes the base at position pos into c.
int getSequenceLength ()
 Returns the sequence length.
void eraseSequence (int from, int len)
 Removes part of the sequence.
void removeAlignmentArtifacts (char what= '-')
 Removes alignment artifacts from the sequence.
wxString getDescription ()
 Returns the sequence description.
void setDescription (wxString s)
 Sets the sequence description.
void addDescription (wxString s)
 Appends to the sequence description.
wxString getName ()
 Returns the sequence name.
void setName (wxString s)
 Sets the sequence name.
void addName (wxString s)
 Appends to the sequence name.
void setGenomeMode (bool gm=true)
 Turns genome mode on/off.
bool getGenomeMode ()
 Returns the genome mode.
int getMem ()
 Returns memory usage estimate for this sequence. Debugging use only.
bool getVectorCuts (TVector *v)
 Returns wether or not isoenzymes should be joined.
TEnzymeRulesgetEnzymeRule ()
 Gets the enzyme rules to follow.
int showGC ()
 Returns 0 for "no", otherwise the number of blocks.
TORFgetORF (int a)
 Returns an open reading frame.
int countORFs ()
 Returns the number of found open reading frames.
void updateDisplay (bool update=true)
 Recalc visual information on next draw.
bool displayUpdate ()
 Update the display?
void setType (int newtype)
 Set the sequence type.
int getType ()
 Returns the sequence type.
int getMethylationSiteIndex (int pos)
 Returns the index of a potential methylation site.
int getMethylationSite (int index)
 Returns the position of a methylation site.
int countMethylationSites ()
 Returns the number of found methylation sites.
void prepareFeatureEdit (int pos, bool overwrite)
 Changes feature names or cuts features that are about to be edited.
TEnzymeRulesgetEnzymeRules ()
 Returns the restriction enzyme display rules for this vector.
void setEnzymeRules (TEnzymeRules *er)
 Sets the restriction enzyme display rules for this vector.
void getItemsAtPosition (int pos, wxArrayInt &vi, bool limit=false)
 Retrieves a list of items at that position (pos is 0-based).
bool hasItemsAtPosition (int pos)
 Returns wether there are items at that position (pos is 0-based).
int countCodonTables ()
wxString getCodonTableName (int x)
void addRestrictionEnzyme (TRestrictionEnzyme *e)
void resetTurn ()
 Sets the turned variable to zero.

Public Attributes

vector< TVectorItemitems
 Items/features/annotations.
vector< TRestrictionCutrc
 Restriction enzyme cuts.
wxArrayTRestrictionEnzyme re
 Manually specified restriction enzymes.
wxArrayTRestrictionEnzyme re2
 Automatically added restriction enzymes.
wxArrayString proteases
 Proteases used.
wxArrayString cocktail
 Enzymes from the last restriction.
TUndo undo
 Undo information.

Private Member Functions

wxString invert (wxString s)
 Inverts a string.
wxString vary_base (char b)
 Turns a SIUPAC into a string of A, C, G, T.
void makeAA2DNA (wxString mode=_T(""))
 "Translate" amino acid sequence into DNA; can be specified for an organism
wxString mergeCodons (wxString c1, wxString c2)
 Used by makeAA2DNA for generating "abstract" (SIUPAC) DNA.
void setCodonTable (int table, wxString sequence, wxString name)
 Sets up the codon_tables variable.
void evaluate_key_value (wxString key, wxString value)
 Used in setParam() and setParams().
wxString get_translation_table (int translation_table)

Private Attributes

int type
 The sequence type.
TEnzymeRulesenzyme_rules
 Pointer to the restriction enzyme display rules.
bool recalcvisual
 Recalculate the layout of the sequence?
vector< TORFworf
 Open Reading Frames.
wxArrayInt methyl
 Methylation sites.
wxArrayString hiddenEnzymes
 Enzymes that are not shown.
wxString sequence
 The sequence that all this fuss is about.
wxString _lu
 Left upper sticky end.
wxString _ll
 Left lower sticky end.
wxString _ru
 Right upper sticky end.
wxString _rl
 Right lower sticky end.
wxString name
 The name of the sequence.
wxString desc
 The sequence description.
bool circular
 Is this sequence circular?
bool changed
 Was this sequence changed?
bool genomeMode
 Is this a genome (using different display routines)?
ChildBasewindow
 The window this TVector belongs to (might be NULL for most methods).
int turned
 A circular sequence can be turned; this is the number of bases (negative for "left").
int action_value
 Used by doAction().
wxString database
 The database this vector was loaded from.
wxString action
 Used by doAction().
wxString aa
 Hell if I remember what this is for.
wxString AA2DNA [256]
 AA-to-DNA "translation" table; used by makeAA2DNA().
wxArrayString paramk
 Parameter keys.
wxArrayString paramv
 Parameter values.

Static Private Attributes

static char IUPAC [256]
 The ACTG chars in binary encoding (IUPAC_A, IUPAC_C, IUPAC_T, IUPAC_G).
static char SIUPAC [256]
 The extended IUPAC codes in binary encoding.
static char COMPLEMENT [256]
 The complement to each SIUPAC base.
static char ACGT [256]
 Different values for A, C, G, T; used in dna2aa().
static vector< TAAPropaaprop
 The 20 amino acids and their properties.
static wxArrayString codon_tables
 The codon tables for different organisms.
static wxArrayString codon_table_names
 The names of these codon tables.


Detailed Description

This class stores all sequence information, both DNA and amino acids.

This class is of extreme importance. It carries sequence data, annotated items, methods for sequence manipulation, and static data, e.e., about amino acid properties and translation tables. So don't let the name fool you, this class does much more than storing vectors.


Constructor & Destructor Documentation

TVector::TVector ChildBase win = NULL  ) 
 

Constructor.

TVector::~TVector  ) 
 

Destructor.


Member Function Documentation

void TVector::addDescription wxString  s  ) 
 

Appends to the sequence description.

void TVector::addName wxString  s  ) 
 

Appends to the sequence name.

void TVector::addORFs int  off  ) 
 

Add open reading frames for a specific reading frame.

void TVector::addRestrictionEnzyme TRestrictionEnzyme e  ) 
 

void TVector::addToSequence wxString  x  ) 
 

Appends to the sequence.

void TVector::alterSequence int  pos,
char  c
 

Changes the base at position pos into c.

TVector * TVector::backtranslate wxString  mode = _T("")  ) 
 

Generate a new DNA sequence from this amino acid sequence.

bool TVector::basematch char  b1,
char  b2
 

matches DNA bases; b1 in IUPAC, b2 in SIUPAC. This is superior to the "=" operator :-)

void TVector::callUpdateUndoMenu  ) 
 

Refreshes the Undo menu.

void TVector::clear  ) 
 

Reset internal state.

void TVector::ClearORFs  ) 
 

Clear the found open reading frames.

void TVector::closeCircle  ) 
 

Closes a linear sequence into a circular (intramolecular ligation).

int TVector::countCodonTables  ) 
 

int TVector::countCuts wxString  enzyme  ) 
 

Counts the number of cuts for an enzyme in this sequence.

int TVector::countMethylationSites  ) 
 

Returns the number of found methylation sites.

int TVector::countORFs  ) 
 

Returns the number of found open reading frames.

bool TVector::displayUpdate  ) 
 

Update the display?

wxString TVector::dna2aa wxString  codon,
int  translation_table = -1
 

Translates a codon into an amino acid.

void TVector::doAction  ) 
 

Perform an action (restriction, usually). Internal use.

void TVector::doRemove int  from,
int  to,
bool  update = true,
bool  enableUndo = true
 

Removes part of the sequence.

void TVector::doRemoveNucleotide int  x  ) 
 

Removes single base at position x.

void TVector::doRestriction  ) 
 

Performs restriction. See TRestrictionEditor.

void TVector::eraseSequence int  from,
int  len
 

Removes part of the sequence.

void TVector::evaluate_key_value wxString  key,
wxString  value
[private]
 

Used in setParam() and setParams().

int TVector::find_item wxString  s  ) 
 

Finds an item with that name.

wxString TVector::get_translation_table int  translation_table  )  [private]
 

float TVector::getAAmw char  aa  ) 
 

Returns the molecular weight of an amino acid.

float TVector::getAApi char  aa  ) 
 

Returns the isoelectric point of an amino acid.

TAAProp TVector::getAAprop char  a  ) 
 

Returns the properties of the one-letter code amino acid.

TVector * TVector::getAAvector int  from,
int  to,
int  dir = 1
 

Returns part of the sequence translated into amino acids.

wxString TVector::getCodonTableName int  x  ) 
 

char TVector::getComplement char  c  ) 
 

Returns the complement of a given base.

void TVector::getCuts TRestrictionEnzyme e,
vector< TRestrictionCut > &  ret,
bool  clear_vector = true,
int  max = 10000000
 

Gets the cuts of restriction enzyme in this sequence.

wxString TVector::getDatabase  )  [inline]
 

Returns the database name in which the sequence is stored.

wxString TVector::getDescription  ) 
 

Returns the sequence description.

TEnzymeRules * TVector::getEnzymeRule  ) 
 

Gets the enzyme rules to follow.

TEnzymeRules * TVector::getEnzymeRules  ) 
 

Returns the restriction enzyme display rules for this vector.

bool TVector::getGenomeMode  ) 
 

Returns the genome mode.

int TVector::getItemLength int  a  ) 
 

Return the length of item a.

void TVector::getItemsAtPosition int  pos,
wxArrayInt &  vi,
bool  limit = false
 

Retrieves a list of items at that position (pos is 0-based).

int TVector::getMem  ) 
 

Returns memory usage estimate for this sequence. Debugging use only.

int TVector::getMethylationSite int  index  ) 
 

Returns the position of a methylation site.

int TVector::getMethylationSiteIndex int  pos  ) 
 

Returns the index of a potential methylation site.

wxString TVector::getName  ) 
 

Returns the sequence name.

char TVector::getNucleotide int  pos,
bool  complement = false
 

Returns the base at a certain position, or its complement.

TORF * TVector::getORF int  a  ) 
 

Returns an open reading frame.

wxString TVector::getParam wxString  key  ) 
 

Return the value of a parameter.

wxString TVector::getParams  ) 
 

Return sequence parameters.

wxString TVector::getSequence  ) 
 

Returns the sequence.

char TVector::getSequenceChar int  x  ) 
 

Gets base at position x.

int TVector::getSequenceLength  ) 
 

Returns the sequence length.

wxString * TVector::getSequencePointer  ) 
 

Internal use; only used by SequenceCanvas::OnCharHook.

wxString TVector::getStickyEnd bool  left,
bool  upper
 

Returns one of the possible sticky ends.

wxString TVector::getStrand35  ) 
 

Returns the 3'->5' strand of the sequence, as 5'->3'.

wxString TVector::getStrand53  ) 
 

Returns the 5'->3' strand of the sequence.

wxString TVector::getSubstring int  mf,
int  mt
 

Returns a sequence substring.

int TVector::getType  ) 
 

Returns the sequence type.

bool TVector::getVectorCuts TVector v  ) 
 

Returns wether or not isoenzymes should be joined.

bool TVector::hasItemsAtPosition int  pos  ) 
 

Returns wether there are items at that position (pos is 0-based).

bool TVector::hasStickyEnds  ) 
 

Does this sequence have sticky ends?

void TVector::hideEnzyme wxString  s,
bool  hideit = true
 

Set enzyme hidden state.

void TVector::init  ) 
 

Set up basic values.

void TVector::insert_char char  x,
int  pos,
bool  overwrite = false
 

Inserts a character into the sequence.

wxString TVector::invert wxString  s  )  [private]
 

Inverts a string.

bool TVector::isChanged  )  [inline]
 

Was the sequence changed?

bool TVector::isCircular  ) 
 

Is this a circular sequence?

bool TVector::isEnzymeHidden wxString  s  ) 
 

Is enzyme "s" hidden?

bool TVector::isLinear  ) 
 

Is this a linear sequence?

void TVector::ligate_right TVector v,
bool  inverted = false
 

Adds another TVector to the right of this one.

void TVector::makeAA2DNA wxString  mode = _T("")  )  [private]
 

"Translate" amino acid sequence into DNA; can be specified for an organism

wxString TVector::mergeCodons wxString  c1,
wxString  c2
[private]
 

Used by makeAA2DNA for generating "abstract" (SIUPAC) DNA.

void TVector::methylationSites wxArrayInt &  vi,
int  what = ALL_METHYLATION_ENZYMES
 

Finds methylation sites.

TVector * TVector::newFromMark int  from,
int  to
 

Generates a new sequence based on a part of this one.

wxString TVector::one2three int  a  ) 
 

Converts one letter amino acid code to three-letter acronym.

void TVector::prepareFeatureEdit int  pos,
bool  overwrite
 

Changes feature names or cuts features that are about to be edited.

void TVector::recalculateCuts  ) 
 

Recalculate restriction enzyme cuts.

bool TVector::reduceToFragment TRestrictionCut  left,
TRestrictionCut  right
 

Cuts off everything except what is betreen these two cuts.

void TVector::removeAlignmentArtifacts char  what = '-'  ) 
 

Removes alignment artifacts from the sequence.

void TVector::removeBlanksFromSequence  ) 
 

Removes blank chars (spaces etc.) from the sequence.

void TVector::removeBlanksFromVector  ) 
 

Removes blank chars (spaces etc.) from the sequence, altering items if necessary.

void TVector::resetTurn  ) 
 

Sets the turned variable to zero.

void TVector::setAction wxString  _action,
int  _action_value = 0
 

Sets the action for doAction().

void TVector::setChanged bool  c = true  ) 
 

The sequence has been changed.

void TVector::setCircular bool  c = true  ) 
 

This is a circular sequence (or linear, if c == false).

void TVector::setCodonTable int  table,
wxString  sequence,
wxString  name
[private]
 

Sets up the codon_tables variable.

void TVector::setDatabase wxString  s  )  [inline]
 

Sets the database in which the sequence is stored.

void TVector::setDescription wxString  s  ) 
 

Sets the sequence description.

void TVector::setEnzymeRules TEnzymeRules er  ) 
 

Sets the restriction enzyme display rules for this vector.

void TVector::setFromVector TVector v  ) 
 

Makes this sequence a copy of another one (v).

void TVector::setGenomeMode bool  gm = true  ) 
 

Turns genome mode on/off.

void TVector::setIUPAC char  b,
wxString  s,
char *  pac = NULL
 

void TVector::setName wxString  s  ) 
 

Sets the sequence name.

void TVector::setNucleotide int  pos,
char  t
 

Sets a base at a certain position.

void TVector::setParam wxString  key,
wxString  value
 

Set a parameter key/value pair.

void TVector::setParams wxString  t  ) 
 

Set sequence parameters.

void TVector::setSequence wxString  ns  ) 
 

Sets the sequence.

void TVector::setStickyEnd bool  left,
bool  upper,
wxString  s
 

Sets one of the four possible sticky ends.

void TVector::setType int  newtype  ) 
 

Set the sequence type.

void TVector::setWindow ChildBase c  ) 
 

Set the window which owns this sequence.

int TVector::showGC  ) 
 

Returns 0 for "no", otherwise the number of blocks.

void TVector::sortRestrictionSites  ) 
 

Sorts the restriction sites by point of cut.

char TVector::three2one wxString  s  ) 
 

Converts three-letter acronym to one letter amino acid code.

wxString TVector::transformSequence bool  inverse,
bool  reverse
 

Transforms the sequence.

void TVector::turn int  off  ) 
 

Turns a circular sequence "off" bases.

void TVector::updateDisplay bool  update = true  ) 
 

Recalc visual information on next draw.

wxString TVector::vary_base char  b  )  [private]
 

Turns a SIUPAC into a string of A, C, G, T.


Member Data Documentation

wxString TVector::_ll [private]
 

Left lower sticky end.

wxString TVector::_lu [private]
 

Left upper sticky end.

wxString TVector::_rl [private]
 

Right lower sticky end.

wxString TVector::_ru [private]
 

Right upper sticky end.

wxString TVector::aa [private]
 

Hell if I remember what this is for.

wxString TVector::AA2DNA[256] [private]
 

AA-to-DNA "translation" table; used by makeAA2DNA().

vector< TAAProp > TVector::aaprop [static, private]
 

The 20 amino acids and their properties.

char TVector::ACGT [static, private]
 

Different values for A, C, G, T; used in dna2aa().

wxString TVector::action [private]
 

Used by doAction().

int TVector::action_value [private]
 

Used by doAction().

bool TVector::changed [private]
 

Was this sequence changed?

bool TVector::circular [private]
 

Is this sequence circular?

wxArrayString TVector::cocktail
 

Enzymes from the last restriction.

wxArrayString TVector::codon_table_names [static, private]
 

The names of these codon tables.

wxArrayString TVector::codon_tables [static, private]
 

The codon tables for different organisms.

char TVector::COMPLEMENT [static, private]
 

The complement to each SIUPAC base.

wxString TVector::database [private]
 

The database this vector was loaded from.

wxString TVector::desc [private]
 

The sequence description.

TEnzymeRules* TVector::enzyme_rules [private]
 

Pointer to the restriction enzyme display rules.

bool TVector::genomeMode [private]
 

Is this a genome (using different display routines)?

wxArrayString TVector::hiddenEnzymes [private]
 

Enzymes that are not shown.

vector<TVectorItem> TVector::items
 

Items/features/annotations.

char TVector::IUPAC [static, private]
 

The ACTG chars in binary encoding (IUPAC_A, IUPAC_C, IUPAC_T, IUPAC_G).

wxArrayInt TVector::methyl [private]
 

Methylation sites.

wxString TVector::name [private]
 

The name of the sequence.

wxArrayString TVector::paramk [private]
 

Parameter keys.

wxArrayString TVector::paramv [private]
 

Parameter values.

wxArrayString TVector::proteases
 

Proteases used.

vector<TRestrictionCut> TVector::rc
 

Restriction enzyme cuts.

wxArrayTRestrictionEnzyme TVector::re
 

Manually specified restriction enzymes.

wxArrayTRestrictionEnzyme TVector::re2
 

Automatically added restriction enzymes.

bool TVector::recalcvisual [private]
 

Recalculate the layout of the sequence?

wxString TVector::sequence [private]
 

The sequence that all this fuss is about.

char TVector::SIUPAC [static, private]
 

The extended IUPAC codes in binary encoding.

int TVector::turned [private]
 

A circular sequence can be turned; this is the number of bases (negative for "left").

int TVector::type [private]
 

The sequence type.

TUndo TVector::undo
 

Undo information.

ChildBase* TVector::window [private]
 

The window this TVector belongs to (might be NULL for most methods).

vector<TORF> TVector::worf [private]
 

Open Reading Frames.


The documentation for this class was generated from the following files:
Generated on Fri Aug 11 16:19:49 2006 for GENtle by  doxygen 1.4.1