Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
ms_modification Class Reference

The class represents a single modification-entry in mod_file. More...

#include <ms_modfile.hpp>

Inheritance diagram for ms_modification:
Collaboration diagram for ms_modification:

Public Member Functions

 ms_modification (const ms_masses *massFile=NULL)
 Default constructor.
 
 ms_modification (const ms_modification &src)
 Copying constructor.
 
 ~ms_modification ()
 Destructor.
 
void appendIgnoreMass (const double massMono, const double massAve)
 Appends a new ignore mass pair.
 
void appendModifiedResidue (const char residue, const double massMono, const double massAve)
 Adds one more residue that can be modified together with its new mass.
 
void appendProperty (const char *name, const char *value, const char *delimiter, const bool bFirstPlace=false)
 Adds a new property with the given parameters.
 
void appendText (const char *line, const bool bFirstPlace=false)
 Adds a new non-parsed property.
 
void clearIgnoreMasses ()
 Deletes all ignore-masses.
 
void clearModifiedResidues ()
 Deletes all residues modified together with their masses and deltas.
 
void copyFrom (const ms_customproperty *src)
 Copies all properties and comments from another instance.
 
void copyFrom (const ms_modification *src)
 Copies modification configuration from another instance.
 
void copyMassFile (const ms_masses *massFile)
 
void defaultValues ()
 Re-initialises the object.
 
void delNonEmpty ()
 Deletes all non-comment properties.
 
void delProp (const char *name)
 Deletes all properties with the specified name.
 
void delPropByNumber (const int index)
 Deletes a single property with the specified number only.
 
void delPropStart (const char *nameBeginning)
 Deletes all properties whose names start with the given string.
 
int findProperty (const char *name, const int startFrom=0) const
 Searches the list for a property with the given name.
 
int findPropertyBeginning (const char *nameBeginning, const int startFrom=0) const
 Searches the list for a property with the partially matching name.
 
std::string getClassification () const
 Returns the value of the classification attribute.
 
std::string getCode () const
 Return the monolink code.
 
double getCTerminusMass (const MASS_TYPE massType) const
 Returns the mass of modified C-terminus.
 
std::string getDefaultDelimiter () const
 Return current default delimiter string used for parsing/storing properties.
 
std::string getDelimiterByNumber (const int index) const
 Returns a specific delimiter used for the property.
 
double getDelta (const MASS_TYPE massType) const
 Returns delta (in Da) value for the given mass type.
 
bool getFromUnimod (const char *modName, const ms_umod_configfile *umod_file)
 Retrieves modification from the Unimod file object by its mod_file-style name.
 
double getIgnoreMass (const MASS_TYPE massType, const int idx) const
 Returns the value of the ith ignore mass. See getNumberOfIgnoreMasses() for more explanations.
 
const ms_massesgetMassFile () const
 Returns a pointer to ms_masses instance held internally.
 
int getModificationType () const
 Returns the type (or class) of modification.
 
char getModifiedResidue (const int n) const
 Traverse the modified residues list.
 
std::string getMonoLinkTitle () const
 Return the modification title with monolink code appended.
 
ms_vectorDouble getNeutralLoss (const MASS_TYPE massType) const
 Return neutral loss delta.
 
ms_vectorBool getNeutralLossRequired () const
 Returns a vector of boolean values (required/not required) for each neutral loss value.
 
double getNTerminusMass (const MASS_TYPE massType) const
 Returns the mass of modified N-terminus.
 
int getNumberOfIgnoreMasses () const
 Returns the number of masses to be ignored.
 
int getNumberOfModifiedResidues () const
 Returns a total number of modified residue for a residue-specific modification.
 
int getNumberOfProperties () const
 Returns a total number of property/comment entries.
 
std::string getPairsWith () const
 Return the monolink codes this monolink pairs with.
 
ms_vectorDouble getPepNeutralLoss (const MASS_TYPE massType) const
 Returns a vector of PepNeutralLoss-values.
 
std::string getPreceedingComments () const
 Returns any comments preceeding the section.
 
std::string getPropertyName (const int index) const
 Returns a property name for a given index.
 
std::string getPropValStringByName (const char *name) const
 Retrieves property value by name.
 
std::string getPropValStringByNumber (const int index) const
 Retrieves property raw text values by number.
 
ms_vectorDouble getReqPepNeutralLoss (const MASS_TYPE massType) const
 Returns a vector of RepPepNeutralLoss-values.
 
double getResidueMass (const MASS_TYPE massType, const char residue) const
 Returns a mass of modified residue.
 
std::string getTitle () const
 Returns the modification title.
 
bool inErrorTolerant () const
 Returns whether this modification should be used in error tolerant searches.
 
bool inLongList () const
 Returns whether this modification is flagged to appear in the search form long list.
 
bool inShortList () const
 Returns whether this modification is flagged to appear in the search form short list.
 
bool isGeneratedMonoLinker () const
 Return true if this is a monolink modification.
 
bool isHidden () const
 Returns value of the Hidden parameter.
 
bool isLoopLinker () const
 Return true if this is a monolink modification whose delta corresponds to the intact link mass.
 
bool isResidueModified (const char residue) const
 Check a single residue.
 
bool isSubstitution () const
 Returns TRUE if the modification is derived from the substitutions file.
 
ms_modificationoperator= (const ms_modification &right)
 C++ style assignment operator.
 
void setCTerminusMass (const double massMono, const double massAve)
 Sets the mass of modified C-terminus.
 
void setDefaultDelimiter (const char *delim)
 Allows to set a specific delimiter string to be used when no property-specific delimiter is supplied.
 
void setDelta (const double massMono, const double massAve)
 Changes delta value for the given mass type.
 
void setHidden (const bool value)
 Sets the value of Hidden parameter.
 
void setInErrorTolerant (const bool value)
 Sets whether this modification should be used in error tolerant searches.
 
void setInLongList (const bool value)
 Sets whether this modification is flagged to appear in the search form long list.
 
void setInShortList (const bool value)
 Sets whether this modification is flagged to appear in the search form short list.
 
void setMassFile (const ms_masses *massFile)
 Stores pointer to the external ms_masses object to refer later.
 
void setModificationType (const int type)
 Sets the modification type parameter into the supplied value.
 
void setNeutralLoss (const ms_vectorDouble massMono, const ms_vectorDouble massAve, const ms_vectorBool required)
 Returns a vector of corresponding frequencies for each neutral loss value.
 
void setNTerminusMass (const double massMono, const double massAve)
 Sets the mass of modified N-terminus.
 
void setPepNeutralLoss (const ms_vectorDouble valuesMono, const ms_vectorDouble valuesAve)
 Set the vector of PepNeutralLoss-values.
 
void setPreceedingComments (const std::string &comments)
 Sets any comments preceeding the section.
 
void setPropertyName (const int index, const char *name)
 Changes name of the property with the given index.
 
void setPropValBoolByName (const char *name, const bool value, const bool bFirstPlace=false)
 Changes a boolean value of the first entry with the given name or creates a new property if it is not found.
 
void setPropValCharByName (const char *name, const char value, const bool bFirstPlace=false)
 Changes a single character value of the first entry with the given name or creates a new property if it is not found.
 
void setPropValFloatByName (const char *name, const double value, const bool bFirstPlace=false)
 Changes an floating point value of the first entry with the given name or creates a new property if it is not found.
 
void setPropValInt64ByName (const char *name, const INT64 value, const bool bFirstPlace=false)
 Changes a long 64-bit integer value of the first entry with the given name or creates a new property if it is not found.
 
void setPropValIntByName (const char *name, const int value, const bool bFirstPlace=false)
 Changes an integer value of the first entry with the given name or creates a new property if it is not found.
 
void setPropValStringByName (const char *name, const char *value, const bool bFirstPlace=false)
 Changes a string value of the first entry with the given name or creates a new property if it is not found.
 
void setPropValStringByNumber (const int index, const char *value)
 Changes an string value of an existing property with the given index.
 
void setReqPepNeutralLoss (const ms_vectorDouble valuesMono, const ms_vectorDouble valuesAve)
 Set the vector of RepPepNeutralLoss-values.
 
void setTitle (const char *value)
 Change the title for the modification.
 
void setTitleSource (const char *unimodName, const char *specString)
 
bool uncommentProp (const int index, const char *delimeter=0)
 Uncomments a line in the configuration file.
 

Detailed Description

The class represents a single modification-entry in mod_file.

Instances of this class are created in ms_modfile when parsing mod_file. It should be used in read-only mode. But if you really want to create a custom modification from scratch then specify modification type and supply the mass file object first and set residue masses or deltas second.

Modifications that only apply to a specific residue at a specific terminus need to be handled with care. An example is the conversion of Methionine to Homoserine lactone. This is defined in mod_file as follows:

   Title:Hse_lact (C-term M)
   ResiduesCterm:M -31.000631 -31.1002

These mods are always processed as variable mods, even if they were originally specified as fixed mods. Mascot Parser implicitly treats them as terminal group mods, so that the return values from Mascot Parser for this modification are as follows:

     ms_modification::getResidueMass(matrix_science::MASS_TYPE_MONO, "M") returns 0
     ms_modification::getDelta(matrix_science::MASS_TYPE_MONO) returns -48.003370665
     ms_modification::isResidueModified("M") returns TRUE
     ms_modification::getCTerminusMass(matrix_science::MASS_TYPE_MONO) returns -31.000631
     ms_masses::getResidueMass(matrix_science::MASS_TYPE_MONO, "M") returns 131.04048
     ms_masses::isResidueModified("M") returns FALSE
     ms_masses::getCtermDelta(matrix_science::MASS_TYPE_MONO) returns 0
     ms_masses::getCterminalMass(matrix_science::MASS_TYPE_MONO) returns 17.002739665

When writing code, you may wish to categorise such cases as residue mods. If so, in the case of Hse_lact, the mass of the modified residue would be the sum of the return values from ms_modification::getDelta() and ms_masses::getResidueMass().

Also get yourselves acquainted with the base class ms_customproperty. It facilitates the following tasks:

  • Retrieving an unsupported property.
  • Retrieving a raw/text/XML property representation.
  • Checking for existence of a certain property rather than dealing with its default value.
  • Accessing commented lines in a section.

More functionality is described in the documentation for ms_customproperty.

Examples
config_modfile.cpp, and tools_aahelper.cpp.

Constructor & Destructor Documentation

◆ ms_modification() [1/2]

ms_modification ( const ms_masses massFile = NULL)

Default constructor.

Not normally called from client applications.

Parameters
massFileOptional parameter to specify the source file for this modification.

◆ ms_modification() [2/2]

ms_modification ( const ms_modification src)

Copying constructor.

Not normally called from client applications.

Parameters
srcreference to an ms_modification object

Member Function Documentation

◆ appendIgnoreMass()

void appendIgnoreMass ( const double  massMono,
const double  massAve 
)

Appends a new ignore mass pair.

See also
getNumberOfIgnoreMasses(), getIgnoreMass(), clearIgnoreMasses()
Parameters
massMonois the mono-isotopic mass of the fragment to be ignored.
massAveis the average mass of the fragment to be ignored.

◆ appendModifiedResidue()

void appendModifiedResidue ( const char  residue,
const double  massMono,
const double  massAve 
)

Adds one more residue that can be modified together with its new mass.

If you call this method for terminal residue modifications, the supplied masses are ignored, only the modified flag for the residue will be set and the total number of residues will be increased. However, if you need to set modified terminal masses for terminal modifications (residue-specific or not) use setNTerminusMass() and setCTerminusMass().

Parameters
residueneeds to be a residue A-Z (or a-z).
massMonois the mono-isotopic mass of the modified residue.
massAveis the average mass of the modified residue.

◆ appendProperty()

void appendProperty ( const char *  name,
const char *  value,
const char *  delimiter,
const bool  bFirstPlace = false 
)
inherited

Adds a new property with the given parameters.

Parameters
namea property name to use.
valuea property value to use.
delimitera specific delimiter or an empty string for a default one to be used.
bFirstPlaceforces a new property to be put on top of the list.

◆ appendText()

void appendText ( const char *  l,
const bool  bFirstPlace = false 
)
inherited

Adds a new non-parsed property.

All property elements will be retrieved from the first parameter. Before calling this method, a specific default delimiter can be set using setDefaultDelimiter().

Parameters
lraw text representation of the property to be parsed.
bFirstPlaceforces a new property to be put on top of the list.

◆ clearIgnoreMasses()

void clearIgnoreMasses ( )

Deletes all ignore-masses.

See also
getNumberOfIgnoreMasses(), getIgnoreMass(), appendIgnoreMass()

◆ clearModifiedResidues()

void clearModifiedResidues ( )

Deletes all residues modified together with their masses and deltas.

Values returned by getDelta() and getNeutralLoss() are not cleared.

◆ copyFrom()

void copyFrom ( const ms_modification src)

Copies modification configuration from another instance.

Parameters
srcis the source modification to be copied.

◆ copyMassFile()

void copyMassFile ( const ms_masses massFile)
Deprecated:
Do not use.
Parameters
massFilepointer to a ms_masses object

◆ defaultValues()

void defaultValues ( )

Re-initialises the object.

Call this member if you want to re-use the instance by resetting all values to defaults.

◆ delProp()

void delProp ( const char *  str)
inherited

Deletes all properties with the specified name.

Parameters
strProperty name to find a match and then delete.

◆ delPropStart()

void delPropStart ( const char *  str)
inherited

Deletes all properties whose names start with the given string.

Parameters
strBeginning a first part of the property name to delete.

◆ findProperty()

int findProperty ( const char *  name,
const int  startFrom = 0 
) const
inherited

Searches the list for a property with the given name.

If no property found with the given name -1 will be returned. There may be several property entries in the list with the same name.

Parameters
namea property name to be found.
startFroma minimal property index to start search from.
Returns
a property index or -1 if no property found.

◆ findPropertyBeginning()

int findPropertyBeginning ( const char *  nameBeginning,
const int  startFrom = 0 
) const
inherited

Searches the list for a property with the partially matching name.

If no property found with the given name part -1 will be returned. There may be several property entries in the list whose names start with the given string.

Parameters
nameBeginningfirst part of a property name to be found.
startFroma minimal property index to start search from.
Returns
a property index or -1 if no property found.

◆ getClassification()

std::string getClassification ( ) const

Returns the value of the classification attribute.

Returns
the value of the classification attribute

◆ getCode()

std::string getCode ( ) const

Return the monolink code.

The monolink code is a single letter identifier, like A or W.

See also
ms_mascotresfilebase::getMonoLinkModification
Returns
Empty string if no code is defined, or a string containing one letter.

◆ getCTerminusMass()

double getCTerminusMass ( const MASS_TYPE  massType) const

Returns the mass of modified C-terminus.

Call this method only for terminal modifications (irrespective of whether it is residue-specific or not). Residue modifications will always return zero.

Parameters
massTypeshould be matrix_science::MASS_TYPE_MONO or matrix_science::MASS_TYPE_AVE.
Returns
mass of C-Terminus

◆ getDefaultDelimiter()

std::string getDefaultDelimiter ( ) const
inherited

Return current default delimiter string used for parsing/storing properties.

Returns
default delimiter

◆ getDelimiterByNumber()

std::string getDelimiterByNumber ( const int  index) const
inherited

Returns a specific delimiter used for the property.

Parameters
indexIndex for which to get a delimiter
Returns
corresponding delimiter

◆ getDelta()

double getDelta ( const MASS_TYPE  massType) const

Returns delta (in Da) value for the given mass type.

By default all values are equal to zero.

Parameters
massTypeshould be matrix_science::MASS_TYPE_MONO or matrix_science::MASS_TYPE_AVE.
Returns
difference between unmodified and modified mass.

◆ getFromUnimod()

bool getFromUnimod ( const char *  modName,
const ms_umod_configfile umod_file 
)

Retrieves modification from the Unimod file object by its mod_file-style name.

Parameters
modNamemodification name in a mod_file style, such as "Acetyl (C)".
umod_filea pointer to a Unimod file object where the modification is retrieved from.
Returns
TRUE if the modification is successfully retrieved and FALSE if it is not found in the the Unimod file.

◆ getIgnoreMass()

double getIgnoreMass ( const MASS_TYPE  massType,
const int  idx 
) const

Returns the value of the ith ignore mass. See getNumberOfIgnoreMasses() for more explanations.

See also
getNumberOfIgnoreMasses(), clearIgnoreMasses(), appendIgnoreMass()
Parameters
massTypeshould be matrix_science::MASS_TYPE_MONO or matrix_science::MASS_TYPE_AVE.
idxindex of the mass to be ignored and can be one of 0..(getNumberOfIgnoreMasses()-1).
Returns
The mass in Daltons.

◆ getMassFile()

const ms_masses * getMassFile ( ) const

Returns a pointer to ms_masses instance held internally.

See also
setMassFile()
Returns
A pointer to the ms_masses object used. See Maintaining object references: two rules of thumb.

◆ getModificationType()

int getModificationType ( ) const

Returns the type (or class) of modification.

By default this is a residue modification.

Returns
One of the enumeration MOD_TYPES values.

◆ getModifiedResidue()

char getModifiedResidue ( const int  n) const

Traverse the modified residues list.

Parameters
nresidue number that can be one of 0..(getNumberOfModifiedResidues()-1).
Returns
a letter encoding an amino acid.

◆ getMonoLinkTitle()

std::string getMonoLinkTitle ( ) const

Return the modification title with monolink code appended.

The monolink title consists of the Unimod name followed by the monolink code in square brackets. For example, the W monolink of Xlink:DSS (K) has monolink title "Xlink:DSS[W] (K)".

If this object is not a monolink (isGeneratedMonoLink() returns false), or if the modification was not generated from a Unimod entry, the monolink title is the same as ms_modification::getTitle().

Returns
modification title containing the monolink code, in modfile-style format.

◆ getNeutralLoss()

ms_vectorDouble getNeutralLoss ( const MASS_TYPE  massType) const

Return neutral loss delta.

By default there is no neutral loss for the modification (zero).

Parameters
massTypeshould be matrix_science::MASS_TYPE_MONO or matrix_science::MASS_TYPE_AVE.
Returns
A vector of neutral loss values. For example, for phosphorylation three different netutral loss values may be specified.

◆ getNeutralLossRequired()

ms_vectorBool getNeutralLossRequired ( ) const

Returns a vector of boolean values (required/not required) for each neutral loss value.

Returns
The values in the vector have a one to one correspondence with the values returned by in getNeutralLoss().

◆ getNTerminusMass()

double getNTerminusMass ( const MASS_TYPE  massType) const

Returns the mass of modified N-terminus.

Call this method only for terminal modifications (irrespective of whether it is residue-specific or not). Residue modifications will always return zero.

Parameters
massTypeshould be matrix_science::MASS_TYPE_MONO or matrix_science::MASS_TYPE_AVE.
Returns
mass of N-Terminus

◆ getNumberOfIgnoreMasses()

int getNumberOfIgnoreMasses ( ) const

Returns the number of masses to be ignored.

If a modification gives rise to intense, predictable non-sequence ion peaks, Mascot can be instructed to ignore these artefacts by means of "ignore masses". Initially, there is no ignore-masses in the list.

Returns
The number of masses in the 'ignore' list.

◆ getNumberOfModifiedResidues()

int getNumberOfModifiedResidues ( ) const

Returns a total number of modified residue for a residue-specific modification.

By default the internal list of residues is empty.

Returns
The number of modified residues.

◆ getNumberOfProperties()

int getNumberOfProperties ( ) const
inherited

Returns a total number of property/comment entries.

Returns
Number of property/comment entries

◆ getPairsWith()

std::string getPairsWith ( ) const

Return the monolink codes this monolink pairs with.

The pairsWith attribute is a string of single letter identifiers. These are typically used when pairing up peptide matches with MS-cleavable linkers.

See also
ms_mascotresfilebase::getMonoLinkModification
Returns
Empty string if no codes are defined, or a string containing one or more letters.

◆ getPepNeutralLoss()

ms_vectorDouble getPepNeutralLoss ( const MASS_TYPE  massType) const

Returns a vector of PepNeutralLoss-values.

Parameters
massTypeshould be matrix_science::MASS_TYPE_MONO or matrix_science::MASS_TYPE_AVE.
Returns
vector of PepNeutralLoss values

◆ getPreceedingComments()

std::string getPreceedingComments ( ) const
inherited

Returns any comments preceeding the section.

Sections in the mascot.dat file may have comments preceeding them. In most cases, these comments need to stay 'attached' to the section.

Multiple line comments are supported by having a single string with newline characters

See also
setPreceedingComments()
Returns
any comments preceeding the section

◆ getPropertyName()

std::string getPropertyName ( const int  index) const
inherited

Returns a property name for a given index.

Parameters
indexproperty number from 0 to (getNumberOfProperties()-1).
Returns
Rroperty name of an empty string for comments.

◆ getPropValStringByName()

std::string getPropValStringByName ( const char *  name) const
inherited

Retrieves property value by name.

Don't use this method for comments as they all have empty name. Also note that there might be several entries corresponding to the same name . – only the first value will be returned. If in doubt use findProperty() and getPropValStringByNumber() instead.

Parameters
nameName for which to get a property value
Returns
corresponding property value

◆ getPropValStringByNumber()

std::string getPropValStringByNumber ( const int  index) const
inherited

Retrieves property raw text values by number.

Parameters
indexIndex for which to get a property value
Returns
corresponding property value

◆ getReqPepNeutralLoss()

ms_vectorDouble getReqPepNeutralLoss ( const MASS_TYPE  massType) const

Returns a vector of RepPepNeutralLoss-values.

Parameters
massTypeshould be matrix_science::MASS_TYPE_MONO or matrix_science::MASS_TYPE_AVE.
Returns
vector of RepPepNeutralLoss values

◆ getResidueMass()

double getResidueMass ( const MASS_TYPE  massType,
const char  residue 
) const

Returns a mass of modified residue.

Only modified residues will have non-zero mass. So, the default value returned by this function is zero.

Parameters
massTypeshould be matrix_science::MASS_TYPE_MONO or matrix_science::MASS_TYPE_AVE.
residuea letter encoding an amino acid.
Returns
modification delta + absolute mass of the residue, in Daltons, or 0 if the residue is not modified.

◆ getTitle()

std::string getTitle ( ) const

Returns the modification title.

A text string that is used to identify the modification in forms and reports. By default this is empty.

Returns
The title.
Examples
config_modfile.cpp, and tools_aahelper.cpp.

◆ inErrorTolerant()

bool inErrorTolerant ( ) const

Returns whether this modification should be used in error tolerant searches.

Returns whether this modification should be used in error tolerant searches.

◆ inLongList()

bool inLongList ( ) const

Returns whether this modification is flagged to appear in the search form long list.

Returns whether this modification is flagged to appear in the search form long list.

◆ inShortList()

bool inShortList ( ) const

Returns whether this modification is flagged to appear in the search form short list.

Returns whether this modification is flagged to appear in the search form short list.

◆ isGeneratedMonoLinker()

bool isGeneratedMonoLinker ( ) const

Return true if this is a monolink modification.

A Unimod linker definition encodes monolinks as neutral losses. A monolink modification has the same title as the linker, but the delta is (linker mass - monolink NL).

See also
ms_mascotresfilebase::getMonoLinkModification
Returns
whether this modification is a monolink generated from a linker definition.

◆ isHidden()

bool isHidden ( ) const

Returns value of the Hidden parameter.

If you wish to include modifications in mod_file without having them appear in a search form, the property Hidden should be set to TRUE.

By default this is not hidden.

Returns
TRUE is the modification is hidden.

◆ isLoopLinker()

bool isLoopLinker ( ) const

Return true if this is a monolink modification whose delta corresponds to the intact link mass.

A Unimod linker definition encodes monolinks as neutral losses. A looplink modification is like a monolink modification, except its delta is the same as the intact linker mass.

See also
ms_mascotresfilebase::getMonoLinkModification
Returns
whether this modification is a looplink generated from a linker definition.

◆ isResidueModified()

bool isResidueModified ( const char  residue) const

Check a single residue.

By default FALSE is returned for each residue, meaning "residue not modified".

Parameters
residuea letter encoding an amino acid.
Returns
TRUE if the residue is modified.

◆ isSubstitution()

bool isSubstitution ( ) const

Returns TRUE if the modification is derived from the substitutions file.

If the modification is AA-substitution then this method will return TRUE.

Returns
true if the modification is from substitution

◆ operator=()

ms_modification & operator= ( const ms_modification right)

C++ style assignment operator.

Parameters
rightis the source modification to be copied.
Returns
reference to the current object

◆ setCTerminusMass()

void setCTerminusMass ( const double  massMono,
const double  massAve 
)

Sets the mass of modified C-terminus.

The method only has an effect for c-terminus modifications. This method will also override the delta value depending on the terminus mass supplied with the mass file object. However, if the mass file object has some fixed modifications applied, the delta will reflect this fact (not the terminus mass itself).

Parameters
massMonomass mono-isotopic
massAveaverage mass

◆ setDefaultDelimiter()

void setDefaultDelimiter ( const char *  delim)
inherited

Allows to set a specific delimiter string to be used when no property-specific delimiter is supplied.

Parameters
delimString to set the default delimiter

◆ setDelta()

void setDelta ( const double  massMono,
const double  massAve 
)

Changes delta value for the given mass type.

By default all values are equal to zero.

Parameters
massMonois the delta using 12C monoisotopic masses.
massAveis the delta using average masses.

◆ setHidden()

void setHidden ( const bool  value)

Sets the value of Hidden parameter.

If you wish to include modifications in mod_file without having them appear in a search form, the property Hidden should be set to TRUE.

By default this is not hidden.

Parameters
valueshould be set to TRUE if the modification is to be hidden.
Examples
config_modfile.cpp.

◆ setInErrorTolerant()

void setInErrorTolerant ( const bool  value)

Sets whether this modification should be used in error tolerant searches.

Sets whether this modification should be used in error tolerant searches.

◆ setInLongList()

void setInLongList ( const bool  value)

Sets whether this modification is flagged to appear in the search form long list.

Sets whether this modification is flagged to appear in the search form long list.

◆ setInShortList()

void setInShortList ( const bool  value)

Sets whether this modification is flagged to appear in the search form short list.

Sets whether this modification is flagged to appear in the search form short list.

◆ setMassFile()

void setMassFile ( const ms_masses massFile)

Stores pointer to the external ms_masses object to refer later.

If no external ms_masses instance is supplied, then the modification object will create an internal ms_masses instance filled with default values. Create an instance of ms_masses class, call its ms_masses::read_file() member and then call this function to supply the instance as a parameter. Alternatively, you can use copyMassFile() for content copying instead of pointer-copying.

Remember to keep massFile in memory for as long as you use this class object. See Memory management conventions.

Parameters
massFilemust be a valid pointer to an ms_masses object. See Maintaining object references: two rules of thumb.

◆ setModificationType()

void setModificationType ( const int  type)

Sets the modification type parameter into the supplied value.

Parameters
typeshould be one of the MOD_TYPES values.

◆ setNeutralLoss()

void setNeutralLoss ( const ms_vectorDouble  massMono,
const ms_vectorDouble  massAve,
const ms_vectorBool  required 
)

Returns a vector of corresponding frequencies for each neutral loss value.

Change neutral loss delta.

All three arrays must be the same length or the function will fail.

Parameters
massMonois an array of mono-isotopic mass neutral losses.
massAveis an array of average mass neutral losses.
requiredis an array of booleans to specify if fragments with the loss must be seen for the series to be scored.

◆ setNTerminusMass()

void setNTerminusMass ( const double  massMono,
const double  massAve 
)

Sets the mass of modified N-terminus.

The method only has an effect for n-terminus modifications. This method will also override the delta value depending on the terminus mass supplied with the mass file object. However, if the mass file object has some fixed modifications applied, the delta will reflect this fact (not the terminus mass itself).

Parameters
massMonomass mono-isotopic
massAveaverage mass

◆ setPreceedingComments()

void setPreceedingComments ( const std::string &  comments)
inherited

Sets any comments preceeding the section.

Sections in the mascot.dat file may have comments preceeding them. In most cases, these comments need to stay 'attached' to the section.

Multiple line comments are supported by having a single string with newline characters

See also
getPreceedingComments()
Parameters
commentsany comments preceeding the section

◆ setPropertyName()

void setPropertyName ( const int  index,
const char *  name 
)
inherited

Changes name of the property with the given index.

Parameters
indexproperty number from 0 to (getNumberOfProperties()-1).
namenew name to be given to the property.

◆ setPropValBoolByName()

void setPropValBoolByName ( const char *  name,
const bool  value,
const bool  bFirstPlace = false 
)
inherited

Changes a boolean value of the first entry with the given name or creates a new property if it is not found.

A new value will be converted into 1 (for TRUE) or 0 (for FALSE) character.

Parameters
namea name of the property to find or add.
valuea new boolean value for the property.
bFirstPlaceif not found a new property can be put on top of the list.

◆ setPropValCharByName()

void setPropValCharByName ( const char *  name,
const char  value,
const bool  bFirstPlace = false 
)
inherited

Changes a single character value of the first entry with the given name or creates a new property if it is not found.

Parameters
namea name of the property to find or add.
valuea new single character value for the property.
bFirstPlaceif not found a new property can be put on top of the list.

◆ setPropValFloatByName()

void setPropValFloatByName ( const char *  name,
const double  value,
const bool  bFirstPlace = false 
)
inherited

Changes an floating point value of the first entry with the given name or creates a new property if it is not found.

Parameters
namea name of the property to find or add.
valuea new floating point value for the property.
bFirstPlaceif not found a new property can be put on top of the list.

◆ setPropValInt64ByName()

void setPropValInt64ByName ( const char *  name,
const INT64  value,
const bool  bFirstPlace = false 
)
inherited

Changes a long 64-bit integer value of the first entry with the given name or creates a new property if it is not found.

Parameters
namea name of the property to find or add.
valuea new long 64-bit integer value for the property.
bFirstPlaceif not found a new property can be put on top of the list.

◆ setPropValIntByName()

void setPropValIntByName ( const char *  name,
const int  value,
const bool  bFirstPlace = false 
)
inherited

Changes an integer value of the first entry with the given name or creates a new property if it is not found.

Parameters
namea name of the property to find or add.
valuea new integer value for the property.
bFirstPlaceif not found a new property can be put on top of the list.

◆ setPropValStringByName()

void setPropValStringByName ( const char *  name,
const char *  value,
const bool  bFirstPlace = false 
)
inherited

Changes a string value of the first entry with the given name or creates a new property if it is not found.

Parameters
namea name of the property to find or add.
valuea new string value for the property.
bFirstPlaceif not found a new property can be put on top of the list.

◆ setPropValStringByNumber()

void setPropValStringByNumber ( const int  index,
const char *  str 
)
inherited

Changes an string value of an existing property with the given index.

Parameters
indexan index of an existing property.
strString value for the property.

◆ setTitle()

void setTitle ( const char *  value)

Change the title for the modification.

See getTitle() for more information.

Parameters
valueis a string value for the new title.

◆ setTitleSource()

void setTitleSource ( const char *  unimodName,
const char *  specString 
)
Parameters
unimodNameis the Unimod name of the source definition.
specStringis the specification string with a leading space, e.g. " (K)".

◆ uncommentProp()

bool uncommentProp ( const int  index,
const char *  delimeter = 0 
)
inherited

Uncomments a line in the configuration file.

Removes a # and any white space. Finds the delimeter and extracts the property name and value.

Parameters
indexmust be a value between 0 and getNumberOfProperties().
delimeterwill often be a space. If not supplied, the default delimeter will be used.
Returns
true if the delimiter was found, false otherwise

The documentation for this class was generated from the following files: