Representation of a peptide/protein sequence. More...
#include <OpenMS/CHEMISTRY/AASequence.h>
Classes | |
| class | ConstIterator |
| ConstIterator for AASequence. More... | |
| class | Iterator |
| Iterator class for AASequence. More... | |
Public Member Functions | |
| AASequence & | operator= (const AASequence &rhs) |
| assignment operator | |
| bool | empty () const |
| check if sequence is empty | |
Constructors and Destructors | |
| AASequence () | |
| default constructor | |
| AASequence (const AASequence &rhs) | |
| copy constructor | |
| AASequence (const String &rhs) | |
| copy constructor from a String | |
| AASequence (const char *rhs) | |
| copy consturctor from char* string | |
| virtual | ~AASequence () |
| destructor | |
Accessors | |
| String | toString () const |
| returns the peptide as string with modifications embedded in brackets | |
| String | toUnmodifiedString () const |
| returns the peptide as string without any modifications | |
| void | setModification (Size index, const String &modification) |
| set the modification of the residue at position index | |
| void | setNTerminalModification (const String &modification) |
| sets the N-terminal modification | |
| const String & | getNTerminalModification () const |
| returns the Id of the N-term modification; an empty string is returned if none was set | |
| void | setCTerminalModification (const String &modification) |
| sets the C-terminal modification | |
| const String & | getCTerminalModification () const |
| returns the Id of the C-term modification; an empty string is returned if none was set | |
| bool | setStringSequence (const String &sequence) |
| sets the string of the sequence; returns true if the conversion to real AASequence was successful, false otherwise | |
| const Residue & | getResidue (SignedSize index) const |
| returns a pointer to the residue, which is at position index | |
| const Residue & | getResidue (Size index) const |
| returns a pointer to the residue, which is at position index | |
| EmpiricalFormula | getFormula (Residue::ResidueType type=Residue::Full, Int charge=0) const |
| returns the formula of the peptide | |
| DoubleReal | getAverageWeight (Residue::ResidueType type=Residue::Full, Int charge=0) const |
| returns the average weight of the peptide | |
| DoubleReal | getMonoWeight (Residue::ResidueType type=Residue::Full, Int charge=0) const |
| returns the mono isotopic weight of the peptide | |
| const Residue & | operator[] (SignedSize index) const |
| returns a pointer to the residue at given position | |
| const Residue & | operator[] (Size index) const |
| returns a pointer to the residue at given position | |
| AASequence | operator+ (const AASequence &peptide) const |
| adds the residues of the peptide | |
| AASequence | operator+ (const String &peptide) const |
| adds the residues of the peptide, which is given as a string | |
| AASequence | operator+ (const char *rhs) const |
| adds the residue of the peptide, which is given as string literal | |
| AASequence | operator+ (const Residue *residue) const |
| adds the residue to the peptide; the residue must be a valid residue of the ResidueDB | |
| AASequence & | operator+= (const AASequence &) |
| adds the residues of a peptide | |
| AASequence & | operator+= (const String &) |
| adds the residues of a peptide, which is given as a string | |
| AASequence & | operator+= (const char *rhs) |
| adds the residues of a peptide, which is given as string literal | |
| AASequence & | operator+= (const Residue *residue) |
| adds the residue to the peptide; the residue must be a valid residue of the ResidueDB | |
| Size | size () const |
| returns the number of residues | |
| AASequence | getPrefix (Size index) const |
| returns a peptide sequence of the first index residues | |
| AASequence | getSuffix (Size index) const |
| returns a peptide sequence of the last index residues | |
| AASequence | getSubsequence (Size index, UInt number) const |
| returns a peptide sequence of number residues, beginning at position index | |
| Size | getNumberOf (const String &residue) const |
| counts the number of occurrences of residue given by a string | |
| void | getAAFrequencies (Map< String, Size > &frequency_table) const |
| compute frequency table of amino acids | |
Predicates | |
| bool | isValid () const |
| return true if the instance is valid | |
| bool | has (const Residue &residue) const |
| returns true if the peptude contains the given residue | |
| bool | has (const String &name) const |
| returns true if the peptide contains the given residue | |
| bool | hasSubsequence (const AASequence &peptide) const |
| bool | hasSubsequence (const String &peptide) const |
| bool | hasPrefix (const AASequence &peptide) const |
| bool | hasPrefix (const String &peptide) const |
| bool | hasSuffix (const AASequence &peptide) const |
| bool | hasSuffix (const String &peptide) const |
| bool | hasNTerminalModification () const |
| predicate which is true if the peptide is N-term modified | |
| bool | hasCTerminalModification () const |
| predicate which is true if the peptide is C-term modified | |
| bool | isModified () const |
| bool | isModified (Size index) const |
| returns true if the residue at the position is modified | |
| bool | operator== (const AASequence &rhs) const |
| equality operator | |
| bool | operator== (const String &rhs) const |
| equality operator given the peptide as a string | |
| bool | operator== (const char *rhs) const |
| equality operator given the peptide as string literal | |
| bool | operator< (const AASequence &rhs) const |
| lesser than operator which compares the C-term mods, sequence and N-term mods; can be used for maps | |
| bool | operator!= (const AASequence &rhs) const |
| inequality operator | |
| bool | operator!= (const String &rhs) const |
| inequality operator given the peptide as a string | |
| bool | operator!= (const char *rhs) const |
| inequality operator given the peptide as string literal | |
Iterators | |
| Iterator | begin () |
| ConstIterator | begin () const |
| Iterator | end () |
| ConstIterator | end () const |
Protected Member Functions | |
| void | parseString_ (std::vector< const Residue * > &sequence, const String &peptide) |
| ResidueDB * | getResidueDB_ () const |
Protected Attributes | |
| std::vector< const Residue * > | peptide_ |
| String | sequence_string_ |
| bool | valid_ |
| const ResidueModification * | n_term_mod_ |
| const ResidueModification * | c_term_mod_ |
Friends | |
Stream operators | |
| std::ostream & | operator<< (std::ostream &os, const AASequence &peptide) |
| writes a peptide to an output stream | |
| std::istream & | operator>> (std::istream &is, const AASequence &peptide) |
| reads a peptide from an input stream | |
Representation of a peptide/protein sequence.
This class represents amino acid sequences in OpenMS. Basically a AASequence instance consists of a sequence of residues. The residues are represented as instances of Residue. Each amino acid has only one instance which is accessible using the ResidueDB instance (singleton).
A critical property of amino acid sequence is that they can be modified. Which means that one or more amino acids are chemically modified, e.g. oxidized. This is represented via Residue instances which carry a ResidueModification object. This is also handled in the ResidueDB.
If one wants to specify a AASequence the easiest way is simply writing the amino acid sequence. For example AASequence seq("DFPIANGER") is sufficient to create a instance of AASequence with DFPIANGER as peptide.
Modifications are specified using a unique string identifier present in the ModificationsDB in brackets after the modified amino acid. For example AASequence seq("DFPIAM(Oxidation)GER") creates an instance of the peptide DFPIAMGER with an oxidized methionine. N-terminal modifications are specified by writing the modification as prefix to the sequence. C-terminal modifications are specified by writing the modification as suffix. C-terminal modifications are distinguished from modifications of the last amino acid by considering the specificity of the modification as stored in ModificationsDB.
Arbitrary/unknown AA's (usually due to an unknown modification) can be specified using tags: '[weight]'. This indicates a new AA with the specified weight, e.g. R[148.5]T. Note that this tag does not alter the AA's to the left or right. It represents an AA on its own. Be careful when converting AASequence to an EmpiricalFormula using .getFormula(), as tags will not be considered in this case. However, they have an influence on .getMonoWeight() and .getAverageWeight()!
If a string cannot be converted into a valid instance of AASequence, the valid flag is false. The flag can be read using the isValid() predicate. However, instances of AASequence which are not valid report wrong weights, because the weight cannot be calculated then. Also other operations might fail.
| AASequence | ( | ) |
default constructor
| AASequence | ( | const AASequence & | rhs | ) |
copy constructor
| AASequence | ( | const String & | rhs | ) |
copy constructor from a String
| AASequence | ( | const char * | rhs | ) |
copy consturctor from char* string
| virtual ~AASequence | ( | ) | [virtual] |
destructor
| Iterator begin | ( | ) | [inline] |
| ConstIterator begin | ( | ) | const [inline] |
| bool empty | ( | ) | const |
check if sequence is empty
| Iterator end | ( | ) | [inline] |
| ConstIterator end | ( | ) | const [inline] |
compute frequency table of amino acids
| DoubleReal getAverageWeight | ( | Residue::ResidueType | type = Residue::Full, |
|
| Int | charge = 0 | |||
| ) | const |
returns the average weight of the peptide
| const String& getCTerminalModification | ( | ) | const |
returns the Id of the C-term modification; an empty string is returned if none was set
| EmpiricalFormula getFormula | ( | Residue::ResidueType | type = Residue::Full, |
|
| Int | charge = 0 | |||
| ) | const |
returns the formula of the peptide
| DoubleReal getMonoWeight | ( | Residue::ResidueType | type = Residue::Full, |
|
| Int | charge = 0 | |||
| ) | const |
returns the mono isotopic weight of the peptide
Referenced by TOPPViewBase::showSpectrumGenerationDialog().
| const String& getNTerminalModification | ( | ) | const |
returns the Id of the N-term modification; an empty string is returned if none was set
counts the number of occurrences of residue given by a string
| AASequence getPrefix | ( | Size | index | ) | const |
returns a peptide sequence of the first index residues
| const Residue& getResidue | ( | SignedSize | index | ) | const |
returns a pointer to the residue, which is at position index
returns a pointer to the residue, which is at position index
| ResidueDB* getResidueDB_ | ( | ) | const [protected] |
| AASequence getSubsequence | ( | Size | index, | |
| UInt | number | |||
| ) | const |
returns a peptide sequence of number residues, beginning at position index
| AASequence getSuffix | ( | Size | index | ) | const |
returns a peptide sequence of the last index residues
| bool has | ( | const Residue & | residue | ) | const |
returns true if the peptude contains the given residue
| bool has | ( | const String & | name | ) | const |
returns true if the peptide contains the given residue
| bool hasCTerminalModification | ( | ) | const |
predicate which is true if the peptide is C-term modified
| bool hasNTerminalModification | ( | ) | const |
predicate which is true if the peptide is N-term modified
| bool hasPrefix | ( | const AASequence & | peptide | ) | const |
returns true if the peptide has the given prefix n-term mod is also checked (c-term as well, if prefix is of same length)
| bool hasPrefix | ( | const String & | peptide | ) | const |
returns true if the peptide has the given prefix n-term mod is also checked (c-term as well, if prefix is of same length)
| bool hasSubsequence | ( | const AASequence & | peptide | ) | const |
returns true if the peptide contains the given peptide
| bool hasSubsequence | ( | const String & | peptide | ) | const |
returns true if the peptide contains the given peptide
| bool hasSuffix | ( | const AASequence & | peptide | ) | const |
returns true if the peptide has the given suffix c-term mod is also checked (n-term as well, if suffix is of same length)
| bool hasSuffix | ( | const String & | peptide | ) | const |
returns true if the peptide has the given suffix c-term mod is also checked (n-term as well, if suffix is of same length)
| bool isModified | ( | ) | const |
| bool isModified | ( | Size | index | ) | const |
returns true if the residue at the position is modified
| bool isValid | ( | ) | const |
return true if the instance is valid
Valid means that a possible given sequence as string was successful converted into a real amino acid sequence which meaningful amino acids and modifications associated with it.
Referenced by TOPPViewBase::showSpectrumGenerationDialog().
| bool operator!= | ( | const AASequence & | rhs | ) | const |
inequality operator
| bool operator!= | ( | const String & | rhs | ) | const |
inequality operator given the peptide as a string
| bool operator!= | ( | const char * | rhs | ) | const |
inequality operator given the peptide as string literal
| AASequence operator+ | ( | const AASequence & | peptide | ) | const |
adds the residues of the peptide
| AASequence operator+ | ( | const String & | peptide | ) | const |
adds the residues of the peptide, which is given as a string
| AASequence operator+ | ( | const char * | rhs | ) | const |
adds the residue of the peptide, which is given as string literal
| AASequence operator+ | ( | const Residue * | residue | ) | const |
adds the residue to the peptide; the residue must be a valid residue of the ResidueDB
| AASequence& operator+= | ( | const AASequence & | ) |
adds the residues of a peptide
| AASequence& operator+= | ( | const String & | ) |
adds the residues of a peptide, which is given as a string
| AASequence& operator+= | ( | const char * | rhs | ) |
adds the residues of a peptide, which is given as string literal
| AASequence& operator+= | ( | const Residue * | residue | ) |
adds the residue to the peptide; the residue must be a valid residue of the ResidueDB
| bool operator< | ( | const AASequence & | rhs | ) | const |
lesser than operator which compares the C-term mods, sequence and N-term mods; can be used for maps
| AASequence& operator= | ( | const AASequence & | rhs | ) |
assignment operator
| bool operator== | ( | const char * | rhs | ) | const |
equality operator given the peptide as string literal
| bool operator== | ( | const AASequence & | rhs | ) | const |
equality operator
| bool operator== | ( | const String & | rhs | ) | const |
equality operator given the peptide as a string
| const Residue& operator[] | ( | SignedSize | index | ) | const |
returns a pointer to the residue at given position
| void setCTerminalModification | ( | const String & | modification | ) |
sets the C-terminal modification
set the modification of the residue at position index
| void setNTerminalModification | ( | const String & | modification | ) |
sets the N-terminal modification
| bool setStringSequence | ( | const String & | sequence | ) |
sets the string of the sequence; returns true if the conversion to real AASequence was successful, false otherwise
Referenced by TOPPViewBase::showSpectrumGenerationDialog().
| Size size | ( | ) | const |
returns the number of residues
Referenced by AAIndex::calculateGB().
| String toString | ( | ) | const |
returns the peptide as string with modifications embedded in brackets
| String toUnmodifiedString | ( | ) | const |
returns the peptide as string without any modifications
| std::ostream& operator<< | ( | std::ostream & | os, | |
| const AASequence & | peptide | |||
| ) | [friend] |
writes a peptide to an output stream
| std::istream& operator>> | ( | std::istream & | is, | |
| const AASequence & | peptide | |||
| ) | [friend] |
reads a peptide from an input stream
const ResidueModification* c_term_mod_ [protected] |
const ResidueModification* n_term_mod_ [protected] |
String sequence_string_ [protected] |
bool valid_ [protected] |
| OpenMS / TOPP release 1.10.0 | Documentation generated on Thu Mar 7 2013 09:42:50 using doxygen 1.7.1 |