Represent a single entry in the enzymes
file.
More...
#include <ms_enzyme.hpp>
Public Types | |
enum | cuttertype { UNDEFINED_CUTTER = 0x0000 , NTERM_CUTTER = 0x0001 , CTERM_CUTTER = 0x0002 } |
Definitions for types of cutter. More... | |
Public Member Functions | |
ms_enzyme () | |
Default constructor. | |
ms_enzyme (const ms_enzyme &src) | |
Copying constructor. | |
~ms_enzyme () | |
Destructor. | |
void | addCutter (const cuttertype type, const char *cleaveAtStr, const char *restrictStr) |
Adds an cutter to the enzyme. | |
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. | |
bool | canCleave (const int cutterNum, const char leftResidue, const char rightResidue) const |
Returns TRUE if the cutter can cut between the two residues. | |
void | clearAllCutters () |
Deletes all cutters from the list. | |
void | copyFrom (const ms_customproperty *src) |
Copies all properties and comments from another instance. | |
void | copyFrom (const ms_enzyme *right) |
Can be used to create a clone. | |
void | defaultValues () |
Use this member to re-initialise an instance to default values. | |
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 | getCleave (const int cutterNum) const |
Returns the list of cleavage points for a cutter. | |
ms_enzyme::cuttertype | getCutterType (const int cutterNum) const |
Return the number of cutters that make up the enzyme definition. | |
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. | |
int | getNumberOfCutters () const |
Returns the number of cutters. | |
int | getNumberOfProperties () const |
Returns a total number of property/comment entries. | |
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. | |
std::string | getRestrict (const int cutterNum) const |
Returns the list of restriction points for a cutter. | |
std::string | getTitle () const |
Returns a name of the enzyme as appears in the file. | |
bool | isIndependent () const |
Check whether multiple enzymes have been applied independently. | |
bool | isSemiSpecific () const |
Returns TRUE if the enzyme is semi-specific. | |
bool | isValid () const |
Use this method to do basic check on a newly created object. | |
ms_enzyme & | operator= (const ms_enzyme &right) |
C++ style operator= for copying. | |
void | setDefaultDelimiter (const char *delim) |
Allows to set a specific delimiter string to be used when no property-specific delimiter is supplied. | |
void | setIndependent (const bool bit) |
Sets the flag that specifies whether multiple enzymes have been applied independently. | |
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 | setSemiSpecific (const bool value) |
Sets a new value for the semi specific flag. | |
void | setTitle (const char *str) |
Sets a new title for the enzyme. | |
bool | uncommentProp (const int index, const char *delimeter=0) |
Uncomments a line in the configuration file. | |
bool | verifyEnzyme (ms_errs *errObj) const |
Tries to detect any inconsistencies in the enzyme definition. | |
Represent a single entry in the enzymes
file.
An instance of this class is normally be created by calling matrix_science::ms_enzymefile::getEnzymeByNumber() or matrix_science::ms_enzymefile::getEnzymeByName() and should then only be used in 'read-only' mode.
As well as 'simple' enzymes, the following cases are supported:
In case of independent enzymes an instance contains several enzyme definitions that can be iterated through. Otherwise several enzymes with mixed-term cutting are combined together.
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.
enum cuttertype |
Definitions for types of cutter.
See Using enumerated values and static const ints in Perl, Java, Python and C#.
ms_enzyme | ( | ) |
Default constructor.
An enzyme object should normally be created using matrix_science::ms_enzymefile::getEnzymeByNumber() or matrix_science::ms_enzymefile::getEnzymeByName().
Copying constructor.
src | is the enzyme to make a copy of. |
~ms_enzyme | ( | ) |
Destructor.
Called automatically from C++ and other languages.
void addCutter | ( | const cuttertype | type, |
const char * | cleaveAtStr, | ||
const char * | restrictStr | ||
) |
Adds an cutter to the enzyme.
This function doesn't perform any checks for valid residues etc, so the verifyEnzyme() function should be called after adding a cutter.
type | is either ms_enzyme::NTERM_CUTTER or ms_enzyme::CTERM_CUTTER. |
cleaveAtStr | One or more residue letters which are the potential cleavage points. |
restrictStr | Zero or more residue letters that are restriction points. |
|
inherited |
Adds a new property with the given parameters.
name | a property name to use. |
value | a property value to use. |
delimiter | a specific delimiter or an empty string for a default one to be used. |
bFirstPlace | forces a new property to be put on top of the list. |
|
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().
l | raw text representation of the property to be parsed. |
bFirstPlace | forces a new property to be put on top of the list. |
bool canCleave | ( | const int | cutterNum, |
const char | leftResidue, | ||
const char | rightResidue | ||
) | const |
Returns TRUE if the cutter can cut between the two residues.
Gives an answer for the question: Will the enzyme cut at the this position or not?
This function doesn't take into account the semi specific flag.
cutterNum | must be in the range 0..getNumberOfCutters()-1. |
leftResidue | amino acid letter representing a residue before the cutting point. |
rightResidue | amino acid letter representing a residue after the cutting point. |
void clearAllCutters | ( | ) |
Deletes all cutters from the list.
Only useful when defining enzymes 'on the fly'.
void copyFrom | ( | const ms_enzyme * | right | ) |
Can be used to create a clone.
Simply create an instance of the class using the default constructor and call this method.
right | pointer to another instance to copy from. |
void defaultValues | ( | ) |
Use this member to re-initialise an instance to default values.
The default values are no cutters, no title, independent = false and semiSpecific = false.
|
inherited |
Deletes all properties with the specified name.
str | Property name to find a match and then delete. |
|
inherited |
Deletes all properties whose names start with the given string.
str | Beginning a first part of the property name to delete. |
|
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.
name | a property name to be found. |
startFrom | a minimal property index to start search from. |
|
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.
nameBeginning | first part of a property name to be found. |
startFrom | a minimal property index to start search from. |
std::string getCleave | ( | const int | cutterNum | ) | const |
Returns the list of cleavage points for a cutter.
Returns the residues after which an enzyme may cut (for a CTERM_CUTTER) or before which an enzyme may cut (for an NTERM_CUTTER).
cutterNum | must be in the range 0..getNumberOfCutters()-1. |
ms_enzyme::cuttertype getCutterType | ( | const int | cutterNum | ) | const |
Return the number of cutters that make up the enzyme definition.
cutterNum | must be in the range 0..getNumberOfCutters()-1. |
|
inherited |
Return current default delimiter string used for parsing/storing properties.
|
inherited |
Returns a specific delimiter used for the property.
index | Index for which to get a delimiter |
int getNumberOfCutters | ( | ) | const |
Returns the number of cutters.
For most enzymes, there will be just one cutter. See isIndependent() for details of multiple cutters in an enzyme.
The limit of 5 cutters per enzyme was raised to a limit of 20 cutters per enzyme in Parser 2.3.01.
|
inherited |
Returns a total number of property/comment entries.
|
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
|
inherited |
Returns a property name for a given index.
index | property number from 0 to (getNumberOfProperties()-1). |
|
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.
name | Name for which to get a property value |
|
inherited |
Retrieves property raw text values by number.
index | Index for which to get a property value |
std::string getRestrict | ( | const int | cutterNum | ) | const |
Returns the list of restriction points for a cutter.
Returns the residues after which an enzyme may cut (for a CTERM_CUTTER) or before which an enzyme may cut (for an NTERM_CUTTER).
cutterNum | must be in the range 0..getNumberOfCutters()-1. |
bool isIndependent | ( | ) | const |
Check whether multiple enzymes have been applied independently.
In cases where a single enzyme has been used, the 'independent' flag has no meaning and would normally be set to false. Where multiple enzymes are used on a single sample, these can have been applied in two different ways:
bool isSemiSpecific | ( | ) | const |
Returns TRUE if the enzyme is semi-specific.
Enzymes don't function perfectly all the time. In most cases where they fail to cut at the specified cleavage point, this only affects one terminus. In Mascot, when a semi specific enzyme is defined, peptides only need to conform to the cleavage specificity at one end.
All enzymes represented by the entry have to be either semi-specific or not.
bool isValid | ( | ) | const |
Use this method to do basic check on a newly created object.
This function calls verifyEnzyme() and is merely provided to give a consistently available function interface to the object. To determine the cause of any inconsistencies or errors, call verifyEnzyme() with an error object.
C++ style operator= for copying.
Acts identically to copyFrom().
right | is the enzyme definition to copy from. |
|
inherited |
Allows to set a specific delimiter string to be used when no property-specific delimiter is supplied.
delim | String to set the default delimiter |
void setIndependent | ( | const bool | bit | ) |
Sets the flag that specifies whether multiple enzymes have been applied independently.
In cases where a single enzyme has been used, the 'independent' flag has no meaning and would normally be set to false. Where multiple enzymes are used on a single sample, these can have been applied in two different ways:
bit | is the new value. |
|
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 |
|
inherited |
Changes name of the property with the given index.
index | property number from 0 to (getNumberOfProperties()-1). |
name | new name to be given to the property. |
|
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.
name | a name of the property to find or add. |
value | a new boolean value for the property. |
bFirstPlace | if not found a new property can be put on top of the list. |
|
inherited |
Changes a single character value of the first entry with the given name or creates a new property if it is not found.
name | a name of the property to find or add. |
value | a new single character value for the property. |
bFirstPlace | if not found a new property can be put on top of the list. |
|
inherited |
Changes an floating point value of the first entry with the given name or creates a new property if it is not found.
name | a name of the property to find or add. |
value | a new floating point value for the property. |
bFirstPlace | if not found a new property can be put on top of the list. |
|
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.
name | a name of the property to find or add. |
value | a new long 64-bit integer value for the property. |
bFirstPlace | if not found a new property can be put on top of the list. |
|
inherited |
Changes an integer value of the first entry with the given name or creates a new property if it is not found.
name | a name of the property to find or add. |
value | a new integer value for the property. |
bFirstPlace | if not found a new property can be put on top of the list. |
|
inherited |
Changes a string value of the first entry with the given name or creates a new property if it is not found.
name | a name of the property to find or add. |
value | a new string value for the property. |
bFirstPlace | if not found a new property can be put on top of the list. |
|
inherited |
Changes an string value of an existing property with the given index.
index | an index of an existing property. |
str | String value for the property. |
void setSemiSpecific | ( | const bool | value | ) |
Sets a new value for the semi specific flag.
C++ If you load an enzyme using matrix_science::ms_enzymefile::getEnzymeByNumber() or matrix_science::ms_enzymefile::getEnzymeByName(), you will not be able to call this member because those functions return a const pointer.
Calling this function will not affect the enzymes file. See ms_enzymefile::updateByNumber() and ms_enzymefile::updateByName().
Enzymes don't function perfectly all the time. In most cases where they fail to cut at the specified cleavage point, this only affects one terminus. In Mascot, when a semi specific enzyme is defined, peptides only need to conform to the cleavage specificity at one end.
All enzymes represented by the entry have to be either semi-specific or not.
value | is the new flag to specify if the enzyme is semi specific. |
void setTitle | ( | const char * | str | ) |
Sets a new title for the enzyme.
C++: If you load an enzyme using matrix_science::ms_enzymefile::getEnzymeByNumber() or matrix_science::ms_enzymefile::getEnzymeByName(), you will not be able to call this member because those functions return a const pointer.
Calling this will not affect the enzymes
file. See ms_enzymefile::updateByNumber() and ms_enzymefile::updateByName().
str | is the new name for the enzyme. |
|
inherited |
Uncomments a line in the configuration file.
Removes a # and any white space. Finds the delimeter and extracts the property name and value.
index | must be a value between 0 and getNumberOfProperties(). |
delimeter | will often be a space. If not supplied, the default delimeter will be used. |
bool verifyEnzyme | ( | ms_errs * | errObj | ) | const |
Tries to detect any inconsistencies in the enzyme definition.
If errors are found in the enzyme definition, the ms_errs::ERR_MSP_ENZYME_DEFINITION_PROBLEM error will be set, once for each error. Each error message will also include one of following additional text strings.
The reason or method required to 'fix' the error are the following:
errObj | passed error-object to store error messages. |