The class represents a single modification-entry in mod_file
.
More...
#include <ms_modfile.hpp>
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 | clearIgnoreMasses () |
Deletes all ignore-masses. | |
void | clearModifiedResidues () |
Deletes all residues modified together with their masses and deltas. | |
void | copyFrom (const ms_modification *src) |
Copies modification configuration from another instance. | |
void | copyMassFile (const ms_masses *massFile) |
void | defaultValues () |
Re-initialises the object. | |
std::string | getCode () const |
Return the monolink code. | |
double | getCTerminusMass (const MASS_TYPE massType) const |
Returns the mass of modified C-terminus. | |
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_masses * | getMassFile () 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. | |
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. | |
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_modification & | operator= (const ms_modification &right) |
C++ style assignment operator. | |
void | setCTerminusMass (const double massMono, const double massAve) |
Sets the mass of modified C-terminus. | |
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 | 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) |
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:
More functionality is described in the documentation for ms_customproperty.
ms_modification | ( | const ms_masses * | massFile = NULL ) |
Default constructor.
Not normally called from client applications.
massFile | Optional parameter to specify the source file for this modification. |
ms_modification | ( | const ms_modification & | src ) |
Copying constructor.
Not normally called from client applications.
src | reference to an ms_modification object |
void appendIgnoreMass | ( | const double | massMono, |
const double | massAve | ||
) |
Appends a new ignore mass pair.
massMono | is the mono-isotopic mass of the fragment to be ignored. |
massAve | is the average mass of the fragment to be ignored. |
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().
residue | needs to be a residue A-Z (or a-z). |
massMono | is the mono-isotopic mass of the modified residue. |
massAve | is the average mass of the modified residue. |
void clearIgnoreMasses | ( | ) |
Deletes all ignore-masses.
void clearModifiedResidues | ( | ) |
Deletes all residues modified together with their masses and deltas.
Values returned by getDelta() and getNeutralLoss() are not cleared.
void copyFrom | ( | const ms_modification * | src ) |
Copies modification configuration from another instance.
src | is the source modification to be copied. |
void copyMassFile | ( | const ms_masses * | massFile ) |
massFile | pointer to a ms_masses object |
void defaultValues | ( | ) |
Re-initialises the object.
Call this member if you want to re-use the instance by resetting all values to defaults.
Reimplemented from ms_customproperty.
std::string getCode | ( | ) | const |
Return the monolink code.
The monolink code is a single letter identifier, like A or W.
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.
massType | should be matrix_science::MASS_TYPE_MONO or matrix_science::MASS_TYPE_AVE. |
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.
massType | should be matrix_science::MASS_TYPE_MONO or matrix_science::MASS_TYPE_AVE. |
bool getFromUnimod | ( | const char * | modName, |
const ms_umod_configfile * | umod_file | ||
) |
Retrieves modification from the Unimod file object by its mod_file-style name.
modName | modification name in a mod_file style, such as "Acetyl (C)". |
umod_file | a pointer to a Unimod file object where the modification is retrieved from. |
double getIgnoreMass | ( | const MASS_TYPE | massType, |
const int | idx | ||
) | const |
Returns the value of the ith ignore mass. See getNumberOfIgnoreMasses() for more explanations.
massType | should be matrix_science::MASS_TYPE_MONO or matrix_science::MASS_TYPE_AVE. |
idx | index of the mass to be ignored and can be one of 0..(getNumberOfIgnoreMasses()-1). |
const ms_masses * getMassFile | ( | ) | const |
Returns a pointer to ms_masses instance held internally.
int getModificationType | ( | ) | const |
Returns the type (or class) of modification.
By default this is a residue modification.
char getModifiedResidue | ( | const int | n ) | const |
Traverse the modified residues list.
n | residue number that can be one of 0..(getNumberOfModifiedResidues()-1). |
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().
ms_vectorDouble getNeutralLoss | ( | const MASS_TYPE | massType ) | const |
Return neutral loss delta.
By default there is no neutral loss for the modification (zero).
massType | should be matrix_science::MASS_TYPE_MONO or matrix_science::MASS_TYPE_AVE. |
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.
Call this method only for terminal modifications (irrespective of whether it is residue-specific or not). Residue modifications will always return zero.
massType | should be matrix_science::MASS_TYPE_MONO or matrix_science::MASS_TYPE_AVE. |
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.
int getNumberOfModifiedResidues | ( | ) | const |
Returns a total number of modified residue for a residue-specific modification.
By default the internal list of residues is empty.
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.
ms_vectorDouble getPepNeutralLoss | ( | const MASS_TYPE | massType ) | const |
Returns a vector of PepNeutralLoss-values.
massType | should be matrix_science::MASS_TYPE_MONO or matrix_science::MASS_TYPE_AVE. |
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
ms_vectorDouble getReqPepNeutralLoss | ( | const MASS_TYPE | massType ) | const |
Returns a vector of RepPepNeutralLoss-values.
massType | should be matrix_science::MASS_TYPE_MONO or matrix_science::MASS_TYPE_AVE. |
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.
massType | should be matrix_science::MASS_TYPE_MONO or matrix_science::MASS_TYPE_AVE. |
residue | a letter encoding an amino acid. |
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.
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).
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.
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.
bool isResidueModified | ( | const char | residue ) | const |
Check a single residue.
By default FALSE is returned for each residue, meaning "residue not modified".
residue | a letter encoding an amino acid. |
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.
ms_modification & operator= | ( | const ms_modification & | right ) |
C++ style assignment operator.
right | is the source modification to be copied. |
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).
massMono | mass mono-isotopic |
massAve | average mass |
void setDelta | ( | const double | massMono, |
const double | massAve | ||
) |
Changes delta value for the given mass type.
By default all values are equal to zero.
massMono | is the delta using 12C monoisotopic masses. |
massAve | is the delta using average masses. |
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.
value | should be set to TRUE if the modification is to be hidden. |
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.
massFile | must be a valid pointer to an ms_masses object. See Maintaining object references: two rules of thumb. |
void setModificationType | ( | const int | type ) |
Sets the modification type parameter into the supplied value.
type | should be one of the MOD_TYPES values. |
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.
massMono | is an array of mono-isotopic mass neutral losses. |
massAve | is an array of average mass neutral losses. |
required | is an array of booleans to specify if fragments with the loss must be seen for the series to be scored. |
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).
massMono | mass mono-isotopic |
massAve | average mass |
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
comments | any comments preceeding the section |
void setTitle | ( | const char * | value ) |
Change the title for the modification.
See getTitle() for more information.
value | is a string value for the new title. |
void setTitleSource | ( | const char * | unimodName, |
const char * | specString | ||
) |
unimodName | is the Unimod name of the source definition. |
specString | is the specification string with a leading space, e.g. " (K)". |
Copyright © 2022 Matrix Science Ltd. All Rights Reserved. Generated on Thu Mar 31 2022 01:12:34 |