OpenMS
ModificationDefinitionsSet Class Reference

Representation of a set of modification definitions. More...

#include <OpenMS/CHEMISTRY/ModificationDefinitionsSet.h>

Collaboration diagram for ModificationDefinitionsSet:
[legend]

Public Member Functions

Constructor and Destructors
 ModificationDefinitionsSet ()
 default constructor More...
 
 ModificationDefinitionsSet (const ModificationDefinitionsSet &rhs)
 copy constructor More...
 
 ModificationDefinitionsSet (const StringList &fixed_modifications, const StringList &variable_modifications)
 detailed constructor with StringLists More...
 
virtual ~ModificationDefinitionsSet ()
 destructor More...
 
Accessors
void setMaxModifications (Size max_mod)
 sets the maximal number of modifications allowed per peptide More...
 
Size getMaxModifications () const
 return the maximal number of modifications allowed per peptide More...
 
Size getNumberOfModifications () const
 returns the number of modifications stored in this set More...
 
Size getNumberOfFixedModifications () const
 returns the number of fixed modifications stored in this set More...
 
Size getNumberOfVariableModifications () const
 returns the number of variable modifications stored in this set More...
 
void addModification (const ModificationDefinition &mod_def)
 adds a modification definition to the set More...
 
void setModifications (const std::set< ModificationDefinition > &mod_defs)
 sets the modification definitions More...
 
void setModifications (const String &fixed_modifications, const String &variable_modifications)
 set the modification definitions from a string More...
 
void setModifications (const StringList &fixed_modifications, const StringList &variable_modifications)
 same as above, but using StringList instead of comma separated strings More...
 
std::set< ModificationDefinitiongetModifications () const
 returns the stored modification definitions More...
 
const std::set< ModificationDefinition > & getFixedModifications () const
 returns the stored fixed modification definitions More...
 
const std::set< ModificationDefinition > & getVariableModifications () const
 returns the stored variable modification definitions More...
 
std::set< StringgetModificationNames () const
 returns only the names of the modifications stored in the set More...
 
void getModificationNames (StringList &fixed_modifications, StringList &variable_modifications) const
 populates the output lists with the modification names (use e.g. for ProteinIdentification::SearchParameters) More...
 
std::set< StringgetFixedModificationNames () const
 returns only the names of the fixed modifications More...
 
std::set< StringgetVariableModificationNames () const
 returns only the names of the variable modifications More...
 
Assignment
ModificationDefinitionsSetoperator= (const ModificationDefinitionsSet &element)
 assignment operator More...
 

Predicates

std::set< ModificationDefinitionvariable_mods_
 
std::set< ModificationDefinitionfixed_mods_
 
Size max_mods_per_peptide_
 
bool isCompatible (const AASequence &peptide) const
 returns true if the peptide is compatible with the definitions, e.g. does not contain other modifications More...
 
bool operator== (const ModificationDefinitionsSet &rhs) const
 equality operator More...
 
bool operator!= (const ModificationDefinitionsSet &rhs) const
 inequality operator More...
 
void findMatches (std::multimap< double, ModificationDefinition > &matches, double mass, const String &residue="", ResidueModification::TermSpecificity term_spec=ResidueModification::NUMBER_OF_TERM_SPECIFICITY, bool consider_fixed=true, bool consider_variable=true, bool is_delta=true, double tolerance=0.01) const
 Finds modifications in the set that match a given (delta) mass. More...
 
void inferFromPeptides (const std::vector< PeptideIdentification > &peptides)
 Infers the sets of defined modifications from the modifications present on peptide identifications. More...
 
static void addMatches_ (std::multimap< double, ModificationDefinition > &matches, double mass, const String &residue, ResidueModification::TermSpecificity term_spec, const std::set< ModificationDefinition > &source, bool is_delta, double tolerance)
 helper function for findMatches() - finds matching modifications in source and adds them to matches More...
 

Detailed Description

Representation of a set of modification definitions.

This class enhances the modification definitions as defined in the class ModificationDefinition into a set of definitions. This is also e.g. used as input parameters in search engines.

Constructor & Destructor Documentation

◆ ModificationDefinitionsSet() [1/3]

default constructor

◆ ModificationDefinitionsSet() [2/3]

copy constructor

◆ ModificationDefinitionsSet() [3/3]

ModificationDefinitionsSet ( const StringList fixed_modifications,
const StringList variable_modifications 
)

detailed constructor with StringLists

◆ ~ModificationDefinitionsSet()

virtual ~ModificationDefinitionsSet ( )
virtual

destructor

Member Function Documentation

◆ addMatches_()

static void addMatches_ ( std::multimap< double, ModificationDefinition > &  matches,
double  mass,
const String residue,
ResidueModification::TermSpecificity  term_spec,
const std::set< ModificationDefinition > &  source,
bool  is_delta,
double  tolerance 
)
staticprotected

helper function for findMatches() - finds matching modifications in source and adds them to matches

◆ addModification()

void addModification ( const ModificationDefinition mod_def)

adds a modification definition to the set

◆ findMatches()

void findMatches ( std::multimap< double, ModificationDefinition > &  matches,
double  mass,
const String residue = "",
ResidueModification::TermSpecificity  term_spec = ResidueModification::NUMBER_OF_TERM_SPECIFICITY,
bool  consider_fixed = true,
bool  consider_variable = true,
bool  is_delta = true,
double  tolerance = 0.01 
) const

Finds modifications in the set that match a given (delta) mass.

Parameters
matchesMatching modifications (output), sorted by mass error
massQuery mass
residueQuery residue
term_specQuery term specificity
consider_variableConsider the variable modifications?
consider_fixedConsider the fixed modifications?
is_deltaIs mass a delta mass (mass difference)?
toleranceNumeric tolerance (in Da) for mass matching
Exceptions
Exception::IllegalArgumentif both consider_variable and consider_fixed are false

◆ getFixedModificationNames()

std::set<String> getFixedModificationNames ( ) const

returns only the names of the fixed modifications

◆ getFixedModifications()

const std::set<ModificationDefinition>& getFixedModifications ( ) const

returns the stored fixed modification definitions

◆ getMaxModifications()

Size getMaxModifications ( ) const

return the maximal number of modifications allowed per peptide

◆ getModificationNames() [1/2]

std::set<String> getModificationNames ( ) const

returns only the names of the modifications stored in the set

◆ getModificationNames() [2/2]

void getModificationNames ( StringList fixed_modifications,
StringList variable_modifications 
) const

populates the output lists with the modification names (use e.g. for ProteinIdentification::SearchParameters)

◆ getModifications()

std::set<ModificationDefinition> getModifications ( ) const

returns the stored modification definitions

◆ getNumberOfFixedModifications()

Size getNumberOfFixedModifications ( ) const

returns the number of fixed modifications stored in this set

◆ getNumberOfModifications()

Size getNumberOfModifications ( ) const

returns the number of modifications stored in this set

◆ getNumberOfVariableModifications()

Size getNumberOfVariableModifications ( ) const

returns the number of variable modifications stored in this set

◆ getVariableModificationNames()

std::set<String> getVariableModificationNames ( ) const

returns only the names of the variable modifications

◆ getVariableModifications()

const std::set<ModificationDefinition>& getVariableModifications ( ) const

returns the stored variable modification definitions

◆ inferFromPeptides()

void inferFromPeptides ( const std::vector< PeptideIdentification > &  peptides)

Infers the sets of defined modifications from the modifications present on peptide identifications.

◆ isCompatible()

bool isCompatible ( const AASequence peptide) const

returns true if the peptide is compatible with the definitions, e.g. does not contain other modifications

◆ operator!=()

bool operator!= ( const ModificationDefinitionsSet rhs) const

inequality operator

◆ operator=()

ModificationDefinitionsSet& operator= ( const ModificationDefinitionsSet element)

assignment operator

◆ operator==()

bool operator== ( const ModificationDefinitionsSet rhs) const

equality operator

◆ setMaxModifications()

void setMaxModifications ( Size  max_mod)

sets the maximal number of modifications allowed per peptide

◆ setModifications() [1/3]

void setModifications ( const std::set< ModificationDefinition > &  mod_defs)

sets the modification definitions

◆ setModifications() [2/3]

void setModifications ( const String fixed_modifications,
const String variable_modifications 
)

set the modification definitions from a string

The strings should contain a comma separated list of modifications. The names can be PSI-MOD identifier or any other unique name supported by PSI-MOD. TermSpec definitions and other specific definitions are given by the modifications themselves.

◆ setModifications() [3/3]

void setModifications ( const StringList fixed_modifications,
const StringList variable_modifications 
)

same as above, but using StringList instead of comma separated strings

Member Data Documentation

◆ fixed_mods_

std::set<ModificationDefinition> fixed_mods_
protected

◆ max_mods_per_peptide_

Size max_mods_per_peptide_
protected

◆ variable_mods_

std::set<ModificationDefinition> variable_mods_
protected