OpenMS
Residue Class Reference

Representation of an amino acid residue. More...

#include <OpenMS/CHEMISTRY/Residue.h>

Collaboration diagram for Residue:
[legend]

Public Member Functions

Constructors
 Residue ()
 Default constructor (needed by pyOpenMS) More...
 
 Residue (const Residue &)=default
 Copy constructor. More...
 
 Residue (Residue &&)=default
 Move constructor. More...
 
 Residue (const String &name, const String &three_letter_code, const String &one_letter_code, const EmpiricalFormula &formula, double pka=0, double pkb=0, double pkc=-1, double gb_sc=0, double gb_bb_l=0, double gb_bb_r=0, const std::set< String > &synonyms=std::set< String >())
 
virtual ~Residue ()
 Destructor. More...
 
Assignment
Residueoperator= (const Residue &)=default
 Assignment operator. More...
 
Residueoperator= (Residue &&) &=default
 Move assignment operator. More...
 
Accessors
void setName (const String &name)
 sets the name of the residue More...
 
const StringgetName () const
 returns the name of the residue More...
 
void setSynonyms (const std::set< String > &synonyms)
 sets the synonyms More...
 
void addSynonym (const String &synonym)
 adds a synonym More...
 
const std::set< String > & getSynonyms () const
 returns the synonyms More...
 
void setThreeLetterCode (const String &three_letter_code)
 sets the name of the residue as three letter code (String of size 3) More...
 
const StringgetThreeLetterCode () const
 returns the name of the residue as three letter code (String of size 3) More...
 
void setOneLetterCode (const String &one_letter_code)
 sets the name as one letter code (String of size 1) More...
 
const StringgetOneLetterCode () const
 returns the name as one letter code (String of size 1) More...
 
void addLossFormula (const EmpiricalFormula &)
 adds a neutral loss formula More...
 
void setLossFormulas (const std::vector< EmpiricalFormula > &)
 sets the neutral loss formulas More...
 
void addNTermLossFormula (const EmpiricalFormula &)
 adds N-terminal losses More...
 
void setNTermLossFormulas (const std::vector< EmpiricalFormula > &)
 sets the N-terminal losses More...
 
const std::vector< EmpiricalFormula > & getLossFormulas () const
 returns the neutral loss formulas More...
 
const std::vector< EmpiricalFormula > & getNTermLossFormulas () const
 returns N-terminal loss formulas More...
 
void setLossNames (const std::vector< String > &name)
 set the neutral loss molecule name More...
 
void setNTermLossNames (const std::vector< String > &name)
 sets the N-terminal loss names More...
 
void addLossName (const String &name)
 add neutral loss molecule name More...
 
void addNTermLossName (const String &name)
 adds a N-terminal loss name More...
 
const std::vector< String > & getLossNames () const
 gets neutral loss name (if there is one, else returns an empty string) More...
 
const std::vector< String > & getNTermLossNames () const
 returns the N-terminal loss names More...
 
void setFormula (const EmpiricalFormula &formula)
 set empirical formula of the residue (must be full, with N and C-terminus) More...
 
EmpiricalFormula getFormula (ResidueType res_type=Full) const
 returns the empirical formula of the residue More...
 
void setAverageWeight (double weight)
 sets average weight of the residue (must be full, with N and C-terminus) More...
 
double getAverageWeight (ResidueType res_type=Full) const
 returns average weight of the residue More...
 
void setMonoWeight (double weight)
 sets monoisotopic weight of the residue (must be full, with N and C-terminus) More...
 
double getMonoWeight (ResidueType res_type=Full) const
 returns monoisotopic weight of the residue More...
 
const ResidueModificationgetModification () const
 returns a pointer to the modification, or a null pointer if none is set More...
 
void setModification (const String &name)
 sets the modification by name; the mod should be present in ModificationsDB More...
 
void setModification (const ResidueModification *mod)
 sets the modification by existing ResMod (make sure it exists in ModificationsDB) More...
 
void setModification (const ResidueModification &mod)
 
void setModificationByDiffMonoMass (double diffMonoMass)
 
const StringgetModificationName () const
 returns the name (ID) of the modification, or an empty string if none is set More...
 
void setLowMassIons (const std::vector< EmpiricalFormula > &low_mass_ions)
 sets the low mass marker ions as a vector of formulas More...
 
const std::vector< EmpiricalFormula > & getLowMassIons () const
 returns a vector of formulas with the low mass markers of the residue More...
 
void setResidueSets (const std::set< String > &residues_sets)
 sets the residue sets the amino acid is contained in (e.g. Natural20) More...
 
void addResidueSet (const String &residue_sets)
 adds a residue set to the residue sets (e.g. Natural20) More...
 
const std::set< String > & getResidueSets () const
 returns the residue sets this residue is contained in (e.g. Natural20) More...
 
double getPka () const
 returns the pka of the residue More...
 
double getPkb () const
 returns the pkb of the residue More...
 
double getPkc () const
 returns the pkc of the residue if it exists otherwise -1 More...
 
double getPiValue () const
 calculates the isoelectric point using the pk* values More...
 
void setPka (double value)
 sets the pka of the residue More...
 
void setPkb (double value)
 sets the pkb of the residue More...
 
void setPkc (double value)
 sets the pkc of the residue More...
 
double getSideChainBasicity () const
 returns the side chain basicity More...
 
void setSideChainBasicity (double gb_sc)
 sets the side chain basicity More...
 
double getBackboneBasicityLeft () const
 returns the backbone basicity if located in N-terminal direction More...
 
void setBackboneBasicityLeft (double gb_bb_l)
 sets the N-terminal direction backbone basicity More...
 
double getBackboneBasicityRight () const
 returns the C-terminal direction backbone basicity More...
 
void setBackboneBasicityRight (double gb_bb_r)
 sets the C-terminal direction backbone basicity More...
 

Static Public Member Functions

Formula conversion

Computes empirical formula required to add to the desired type

Computes the empirical formula required to be added to convert an internal residue (inside an AA sequence) to that of a residue of the desired type. For example, to obtain the conversion formula for an internal ion to a "y ion", use getInternalToYTerm().

Formulae that need to be added to the internal residues to get to fragment type from http://www.matrixscience.com/help/fragmentation_help.html

Which means that we follow Biemann nomenclature. For a small description of the differernt ion types, see the enum ResidueType.

static const EmpiricalFormulagetInternalToFull ()
 
static const EmpiricalFormulagetInternalToNTerm ()
 
static const EmpiricalFormulagetInternalToCTerm ()
 
static const EmpiricalFormulagetInternalToAIon ()
 
static const EmpiricalFormulagetInternalToBIon ()
 
static const EmpiricalFormulagetInternalToCIon ()
 
static const EmpiricalFormulagetInternalToXIon ()
 
static const EmpiricalFormulagetInternalToYIon ()
 
static const EmpiricalFormulagetInternalToZIon ()
 
static const EmpiricalFormulagetInternalToZp1Ion ()
 
static const EmpiricalFormulagetInternalToZp2Ion ()
 

Friends

class ResidueDB
 

Enums

enum  ResidueType {
  Full = 0 , Internal , NTerminal , CTerminal ,
  AIon , BIon , CIon , XIon ,
  YIon , ZIon , Zp1Ion , Zp2Ion ,
  Precursor , BIonMinusH20 , YIonMinusH20 , BIonMinusNH3 ,
  YIonMinusNH3 , NonIdentified , Unannotated , SizeOfResidueType
}
 
static String getResidueTypeName (const ResidueType res_type)
 returns the ion name given as a residue type More...
 

Predicates

std::ostream & operator<< (std::ostream &os, const Residue &residue)
 ostream iterator to write the residue to a stream More...
 
String name_
 the name of the residue More...
 
std::set< Stringsynonyms_
 
String three_letter_code_
 
String one_letter_code_
 
EmpiricalFormula formula_
 
EmpiricalFormula internal_formula_
 
double average_weight_
 
double mono_weight_
 
const ResidueModificationmodification_
 pointer to the modification More...
 
std::vector< Stringloss_names_
 
std::vector< EmpiricalFormulaloss_formulas_
 
std::vector< StringNTerm_loss_names_
 
std::vector< EmpiricalFormulaNTerm_loss_formulas_
 
double loss_average_weight_
 
double loss_mono_weight_
 
std::vector< EmpiricalFormulalow_mass_ions_
 low mass markers like immonium ions More...
 
double pka_
 
double pkb_
 
double pkc_
 
double gb_sc_
 SideChainBasicity. More...
 
double gb_bb_l_
 BackboneBasicityLeft. More...
 
double gb_bb_r_
 BackboneBasicityRight. More...
 
std::set< Stringresidue_sets_
 residue sets this amino acid is contained in More...
 
static const double internal_to_full_monoweight_
 
static const double internal_to_nterm_monoweight_
 
static const double internal_to_cterm_monoweight_
 
static const double internal_to_a_monoweight_
 
static const double internal_to_b_monoweight_
 
static const double internal_to_c_monoweight_
 
static const double internal_to_x_monoweight_
 
static const double internal_to_y_monoweight_
 
static const double internal_to_z_monoweight_
 
static const double internal_to_zp1_monoweight_
 
static const double internal_to_zp2_monoweight_
 
static std::string residueTypeToIonLetter (const ResidueType &res_type)
 helper for mapping residue types to letters for Text annotations and labels More...
 
bool hasNeutralLoss () const
 true if the residue has neutral loss More...
 
bool hasNTermNeutralLosses () const
 true if N-terminal neutral losses are set More...
 
bool operator== (const Residue &residue) const
 equality operator More...
 
bool operator!= (const Residue &residue) const
 inequality operator More...
 
bool operator== (char one_letter_code) const
 equality operator for one letter code More...
 
bool operator!= (char one_letter_code) const
 equality operator for one letter code More...
 
bool isModified () const
 true if the residue is a modified one More...
 
bool isInResidueSet (const String &residue_set)
 true if the residue is contained in the set More...
 
String toString () const
 

Detailed Description

Representation of an amino acid residue.

This class represents an amino acid. These can have many different attributes, like the formula physico-chemical values of properties and so on.

A very important property of amino acid residues are their modifications. By default no modification is present. Any modification which is present in the ModificationsDB can be applied, if appropriate.

Member Enumeration Documentation

◆ ResidueType

Residue types: Note that all weights and elemental compositions of fragment "ions" are given for their neutral forms. Furthermore, all fragment ion types are based on the Biemann nomenclature (http://www.matrixscience.com/help/fragmentation_help.html) See https://github.com/OpenMS/OpenMS/issues/7219 for a discussion with more details and links.

Enumerator
Full 

with N-terminus and C-terminus

Internal 

internal residue, without any termini

NTerminal 

only N-terminus

CTerminal 

only C-terminus

AIon 

MS:1001229 N-terminus up to the C-alpha/carbonyl carbon bond.

BIon 

MS:1001224 N-terminus up to the peptide bond.

CIon 

MS:1001231 N-terminus up to the amide/C-alpha bond.

XIon 

MS:1001228 amide/C-alpha bond up to the C-terminus.

YIon 

MS:1001220 peptide bond up to the C-terminus.

ZIon 

MS:1001230 C-alpha/carbonyl carbon bond [CID fragment].

Zp1Ion 

MS:1001230 C-alpha/carbonyl carbon bond (free radical, z+1 "ion") [main EAD fragment].

Zp2Ion 

MS:1001230 C-alpha/carbonyl carbon bond (free radical, z+2 "ion" with additional abstracted hydrogen) [EAD fragment at higher precursor charges].

Precursor 

MS:1001523 Precursor ion.

BIonMinusH20 

MS:1001222 b ion without water.

YIonMinusH20 

MS:1001223 y ion without water.

BIonMinusNH3 

MS:1001232 b ion without ammonia.

YIonMinusNH3 

MS:1001233 y ion without ammonia.

NonIdentified 

MS:1001240 Non-identified ion.

Unannotated 

no stored annotation

SizeOfResidueType 

Constructor & Destructor Documentation

◆ Residue() [1/4]

Residue ( )

Default constructor (needed by pyOpenMS)

◆ Residue() [2/4]

Residue ( const Residue )
default

Copy constructor.

◆ Residue() [3/4]

Residue ( Residue &&  )
default

Move constructor.

◆ Residue() [4/4]

Residue ( const String name,
const String three_letter_code,
const String one_letter_code,
const EmpiricalFormula formula,
double  pka = 0,
double  pkb = 0,
double  pkc = -1,
double  gb_sc = 0,
double  gb_bb_l = 0,
double  gb_bb_r = 0,
const std::set< String > &  synonyms = std::set< String >() 
)

◆ ~Residue()

virtual ~Residue ( )
virtual

Destructor.

Member Function Documentation

◆ addLossFormula()

void addLossFormula ( const EmpiricalFormula )

adds a neutral loss formula

◆ addLossName()

void addLossName ( const String name)

add neutral loss molecule name

◆ addNTermLossFormula()

void addNTermLossFormula ( const EmpiricalFormula )

adds N-terminal losses

◆ addNTermLossName()

void addNTermLossName ( const String name)

adds a N-terminal loss name

◆ addResidueSet()

void addResidueSet ( const String residue_sets)

adds a residue set to the residue sets (e.g. Natural20)

◆ addSynonym()

void addSynonym ( const String synonym)

adds a synonym

◆ getAverageWeight()

double getAverageWeight ( ResidueType  res_type = Full) const

returns average weight of the residue

◆ getBackboneBasicityLeft()

double getBackboneBasicityLeft ( ) const

returns the backbone basicity if located in N-terminal direction

◆ getBackboneBasicityRight()

double getBackboneBasicityRight ( ) const

returns the C-terminal direction backbone basicity

◆ getFormula()

EmpiricalFormula getFormula ( ResidueType  res_type = Full) const

returns the empirical formula of the residue

◆ getInternalToAIon()

static const EmpiricalFormula& getInternalToAIon ( )
inlinestatic

◆ getInternalToBIon()

static const EmpiricalFormula& getInternalToBIon ( )
inlinestatic

◆ getInternalToCIon()

static const EmpiricalFormula& getInternalToCIon ( )
inlinestatic

◆ getInternalToCTerm()

static const EmpiricalFormula& getInternalToCTerm ( )
inlinestatic

◆ getInternalToFull()

static const EmpiricalFormula& getInternalToFull ( )
inlinestatic

◆ getInternalToNTerm()

static const EmpiricalFormula& getInternalToNTerm ( )
inlinestatic

◆ getInternalToXIon()

static const EmpiricalFormula& getInternalToXIon ( )
inlinestatic

◆ getInternalToYIon()

static const EmpiricalFormula& getInternalToYIon ( )
inlinestatic

◆ getInternalToZIon()

static const EmpiricalFormula& getInternalToZIon ( )
inlinestatic

◆ getInternalToZp1Ion()

static const EmpiricalFormula& getInternalToZp1Ion ( )
inlinestatic

◆ getInternalToZp2Ion()

static const EmpiricalFormula& getInternalToZp2Ion ( )
inlinestatic

◆ getLossFormulas()

const std::vector<EmpiricalFormula>& getLossFormulas ( ) const

returns the neutral loss formulas

◆ getLossNames()

const std::vector<String>& getLossNames ( ) const

gets neutral loss name (if there is one, else returns an empty string)

◆ getLowMassIons()

const std::vector<EmpiricalFormula>& getLowMassIons ( ) const

returns a vector of formulas with the low mass markers of the residue

◆ getModification()

const ResidueModification* getModification ( ) const

returns a pointer to the modification, or a null pointer if none is set

◆ getModificationName()

const String& getModificationName ( ) const

returns the name (ID) of the modification, or an empty string if none is set

◆ getMonoWeight()

double getMonoWeight ( ResidueType  res_type = Full) const

returns monoisotopic weight of the residue

◆ getName()

const String& getName ( ) const

returns the name of the residue

◆ getNTermLossFormulas()

const std::vector<EmpiricalFormula>& getNTermLossFormulas ( ) const

returns N-terminal loss formulas

◆ getNTermLossNames()

const std::vector<String>& getNTermLossNames ( ) const

returns the N-terminal loss names

◆ getOneLetterCode()

const String& getOneLetterCode ( ) const

returns the name as one letter code (String of size 1)

Referenced by AAIndex::calculateGB().

◆ getPiValue()

double getPiValue ( ) const

calculates the isoelectric point using the pk* values

◆ getPka()

double getPka ( ) const

returns the pka of the residue

◆ getPkb()

double getPkb ( ) const

returns the pkb of the residue

◆ getPkc()

double getPkc ( ) const

returns the pkc of the residue if it exists otherwise -1

◆ getResidueSets()

const std::set<String>& getResidueSets ( ) const

returns the residue sets this residue is contained in (e.g. Natural20)

◆ getResidueTypeName()

static String getResidueTypeName ( const ResidueType  res_type)
static

returns the ion name given as a residue type

◆ getSideChainBasicity()

double getSideChainBasicity ( ) const

returns the side chain basicity

◆ getSynonyms()

const std::set<String>& getSynonyms ( ) const

returns the synonyms

◆ getThreeLetterCode()

const String& getThreeLetterCode ( ) const

returns the name of the residue as three letter code (String of size 3)

◆ hasNeutralLoss()

bool hasNeutralLoss ( ) const

true if the residue has neutral loss

◆ hasNTermNeutralLosses()

bool hasNTermNeutralLosses ( ) const

true if N-terminal neutral losses are set

◆ isInResidueSet()

bool isInResidueSet ( const String residue_set)

true if the residue is contained in the set

◆ isModified()

bool isModified ( ) const

true if the residue is a modified one

◆ operator!=() [1/2]

bool operator!= ( char  one_letter_code) const

equality operator for one letter code

◆ operator!=() [2/2]

bool operator!= ( const Residue residue) const

inequality operator

◆ operator=() [1/2]

Residue& operator= ( const Residue )
default

Assignment operator.

◆ operator=() [2/2]

Residue& operator= ( Residue &&  ) &
default

Move assignment operator.

◆ operator==() [1/2]

bool operator== ( char  one_letter_code) const

equality operator for one letter code

◆ operator==() [2/2]

bool operator== ( const Residue residue) const

equality operator

◆ residueTypeToIonLetter()

static std::string residueTypeToIonLetter ( const ResidueType res_type)
static

helper for mapping residue types to letters for Text annotations and labels

◆ setAverageWeight()

void setAverageWeight ( double  weight)

sets average weight of the residue (must be full, with N and C-terminus)

◆ setBackboneBasicityLeft()

void setBackboneBasicityLeft ( double  gb_bb_l)

sets the N-terminal direction backbone basicity

◆ setBackboneBasicityRight()

void setBackboneBasicityRight ( double  gb_bb_r)

sets the C-terminal direction backbone basicity

◆ setFormula()

void setFormula ( const EmpiricalFormula formula)

set empirical formula of the residue (must be full, with N and C-terminus)

◆ setLossFormulas()

void setLossFormulas ( const std::vector< EmpiricalFormula > &  )

sets the neutral loss formulas

◆ setLossNames()

void setLossNames ( const std::vector< String > &  name)

set the neutral loss molecule name

◆ setLowMassIons()

void setLowMassIons ( const std::vector< EmpiricalFormula > &  low_mass_ions)

sets the low mass marker ions as a vector of formulas

◆ setModification() [1/3]

void setModification ( const ResidueModification mod)

sets the modification by looking for an exact match in the DB first, otherwise creating a new entry

◆ setModification() [2/3]

void setModification ( const ResidueModification mod)

sets the modification by existing ResMod (make sure it exists in ModificationsDB)

◆ setModification() [3/3]

void setModification ( const String name)

sets the modification by name; the mod should be present in ModificationsDB

◆ setModificationByDiffMonoMass()

void setModificationByDiffMonoMass ( double  diffMonoMass)

sets a modification by monoisotopic mass difference. Searches in DBs first with a tolerance. If not found, creates a new entry with name = OneLetterResidueCode[+/-diffMonoMass] and adds this as user-defined mod.

◆ setMonoWeight()

void setMonoWeight ( double  weight)

sets monoisotopic weight of the residue (must be full, with N and C-terminus)

◆ setName()

void setName ( const String name)

sets the name of the residue

◆ setNTermLossFormulas()

void setNTermLossFormulas ( const std::vector< EmpiricalFormula > &  )

sets the N-terminal losses

◆ setNTermLossNames()

void setNTermLossNames ( const std::vector< String > &  name)

sets the N-terminal loss names

◆ setOneLetterCode()

void setOneLetterCode ( const String one_letter_code)

sets the name as one letter code (String of size 1)

◆ setPka()

void setPka ( double  value)

sets the pka of the residue

◆ setPkb()

void setPkb ( double  value)

sets the pkb of the residue

◆ setPkc()

void setPkc ( double  value)

sets the pkc of the residue

◆ setResidueSets()

void setResidueSets ( const std::set< String > &  residues_sets)

sets the residue sets the amino acid is contained in (e.g. Natural20)

◆ setSideChainBasicity()

void setSideChainBasicity ( double  gb_sc)

sets the side chain basicity

◆ setSynonyms()

void setSynonyms ( const std::set< String > &  synonyms)

sets the synonyms

◆ setThreeLetterCode()

void setThreeLetterCode ( const String three_letter_code)

sets the name of the residue as three letter code (String of size 3)

◆ toString()

String toString ( ) const

Write as Origin+Modification, e.g. M(Oxidation), or X[945.34] or N[+14.54] for user-defined mods. This requires the Residue to have a valid OneLetterCode and an optional (but valid) ResidueModification (see ResidueModification::toString())

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const Residue residue 
)
friend

ostream iterator to write the residue to a stream

◆ ResidueDB

friend class ResidueDB
friend

Member Data Documentation

◆ average_weight_

double average_weight_
protected

◆ formula_

EmpiricalFormula formula_
protected

◆ gb_bb_l_

double gb_bb_l_
protected

BackboneBasicityLeft.

◆ gb_bb_r_

double gb_bb_r_
protected

BackboneBasicityRight.

◆ gb_sc_

double gb_sc_
protected

SideChainBasicity.

◆ internal_formula_

EmpiricalFormula internal_formula_
protected

◆ internal_to_a_monoweight_

const double internal_to_a_monoweight_
staticprotected

◆ internal_to_b_monoweight_

const double internal_to_b_monoweight_
staticprotected

◆ internal_to_c_monoweight_

const double internal_to_c_monoweight_
staticprotected

◆ internal_to_cterm_monoweight_

const double internal_to_cterm_monoweight_
staticprotected

◆ internal_to_full_monoweight_

const double internal_to_full_monoweight_
staticprotected

◆ internal_to_nterm_monoweight_

const double internal_to_nterm_monoweight_
staticprotected

◆ internal_to_x_monoweight_

const double internal_to_x_monoweight_
staticprotected

◆ internal_to_y_monoweight_

const double internal_to_y_monoweight_
staticprotected

◆ internal_to_z_monoweight_

const double internal_to_z_monoweight_
staticprotected

◆ internal_to_zp1_monoweight_

const double internal_to_zp1_monoweight_
staticprotected

◆ internal_to_zp2_monoweight_

const double internal_to_zp2_monoweight_
staticprotected

◆ loss_average_weight_

double loss_average_weight_
protected

◆ loss_formulas_

std::vector<EmpiricalFormula> loss_formulas_
protected

◆ loss_mono_weight_

double loss_mono_weight_
protected

◆ loss_names_

std::vector<String> loss_names_
protected

◆ low_mass_ions_

std::vector<EmpiricalFormula> low_mass_ions_
protected

low mass markers like immonium ions

◆ modification_

const ResidueModification* modification_
protected

pointer to the modification

◆ mono_weight_

double mono_weight_
protected

◆ name_

String name_
protected

the name of the residue

◆ NTerm_loss_formulas_

std::vector<EmpiricalFormula> NTerm_loss_formulas_
protected

◆ NTerm_loss_names_

std::vector<String> NTerm_loss_names_
protected

◆ one_letter_code_

String one_letter_code_
protected

◆ pka_

double pka_
protected

◆ pkb_

double pkb_
protected

◆ pkc_

double pkc_
protected

◆ residue_sets_

std::set<String> residue_sets_
protected

residue sets this amino acid is contained in

◆ synonyms_

std::set<String> synonyms_
protected

◆ three_letter_code_

String three_letter_code_
protected