This class facilitates creation of peptides and calculation of MS-fragment masses. More...
#include <ms_aahelper.hpp>
Public Types | |
enum | FRAG_NL { FRAG_NL_PRIMARY = 0x0001 , FRAG_NL_SECONDARY = 0x0010 } |
Flag for controlling iteration over multiple neutral losses. More... | |
Public Member Functions | |
ms_aahelper () | |
Default constructor. | |
ms_aahelper (const ms_aahelper &right) | |
Copying constructor. | |
ms_aahelper (const ms_mascotresfilebase &resfile, const char *enzymeFileName, const char *quantSchemaFilePath="http://www.matrixscience.com/xmlns/schema/quantitation_2 ../html/xmlns/schema/quantitation_2/quantitation_2.xsd http://www.matrixscience.com/xmlns/schema/quantitation_1 ../html/xmlns/schema/quantitation_1/quantitation_1.xsd", const char *unimodSchemaFilePath="http://www.unimod.org/xmlns/schema/unimod_2 ../html/xmlns/schema/unimod_2/unimod_2.xsd") | |
Constructor from results file. | |
ms_aahelper (const ms_mascotresults &summary, const char *enzymeFileName, const char *quantSchemaFilePath="http://www.matrixscience.com/xmlns/schema/quantitation_2 ../html/xmlns/schema/quantitation_2/quantitation_2.xsd http://www.matrixscience.com/xmlns/schema/quantitation_1 ../html/xmlns/schema/quantitation_1/quantitation_1.xsd", const char *unimodSchemaFilePath="http://www.unimod.org/xmlns/schema/unimod_2 ../html/xmlns/schema/unimod_2/unimod_2.xsd") | |
Constructor from peptide summary or protein summary. | |
~ms_aahelper () | |
Destructor. | |
void | appendErrors (const ms_errors &src) |
Copies all errors from another instance and appends them at the end of own list. | |
std::vector< double > | calcFragments (const ms_peptide *peptide, const int seriesID, const bool doubleCharged, const double minMass, const double maxMass, const MASS_TYPE massType, ms_fragmentvector *fragments, ms_errs *err, const FRAG_NL fragNlType=FRAG_NL_PRIMARY) const |
Returns a vector of ion masses for the given series and peptide. | |
std::vector< double > | calcFragments (const ms_peptide *peptide, const int seriesID, const bool doubleCharged, const double minMass, const double maxMass, const MASS_TYPE massType, std::vector< ms_fragment > *fragments, ms_errs *err, const FRAG_NL fragNlType=FRAG_NL_PRIMARY) const |
Returns a vector of ion masses for the given series and peptide. | |
bool | calcFragmentsEx (const ms_peptide *peptide, const int seriesID, const int fragCharge, const double minMass, const double maxMass, const MASS_TYPE massType, ms_fragmentvector *fragments, ms_errs *err, const FRAG_NL fragNlType=FRAG_NL_PRIMARY) const |
Returns a vector of ion masses for the given series and peptide. | |
bool | calcFragmentsEx (const ms_peptide *peptide, const int seriesID, const int fragCharge, const double minMass, const double maxMass, const MASS_TYPE massType, std::vector< ms_fragment > *fragments, ms_errs *err, const FRAG_NL fragNlType=FRAG_NL_PRIMARY) const |
Returns a vector of ion masses for the given series and peptide. | |
double | calcPeptideMZ (const char *proteinStr, const int proteinLen, const int startPos, const int endPos, const std::vector< int > numThatMustBeModded, const int charge, const MASS_TYPE massType, ms_errs *err) const |
Calculates and returns a peptide m/z (or Mr) value without specifying exact positions of modified residues. | |
void | clearAllErrors () |
Remove all errors from the current list of errors. | |
void | copyFrom (const ms_aahelper *right) |
Copies all data from another instance of the class. | |
void | copyFrom (const ms_errors *right) |
Use this member to make a copy of another instance. | |
ms_peptide | createCrosslinkedPeptide (const ms_peptide &pepAlpha, const ms_peptide &pepBeta, const ms_linker_site_vector &linkedSites, ms_errs *err) const |
Creates and returns a crosslinked peptide object. | |
ms_peptide | createPeptide (const char *proteinStr, const int proteinLen, const int startPos, const int endPos, const std::vector< int > varMods, const std::vector< int > varModsWhichNl, const int charge, const MASS_TYPE massType, ms_errs *err) const |
Creates and returns a peptide object. | |
ms_peptide | createPeptide (const char *proteinStr, const int proteinLen, const int startPos, const int endPos, const std::vector< int > varMods, const std::vector< int > varModsWhichNl, const std::vector< int > summedMods, const std::vector< int > summedModsWhichNl, const int charge, const MASS_TYPE massType, ms_errs *err) const |
Creates and returns a peptide object. | |
void | defaultValues () |
Initialises the instance. | |
const ms_enzyme * | getEnzyme () const |
Returns a pointer to the current enzyme. | |
const ms_errs * | getErrorHandler () const |
Retrive the error object using this function to get access to all errors and error parameters. | |
ms_modvector | getFixedMods () const |
Returns a list of fixed modifications that have been successfully applied i.e. don't have conflicts. | |
int | getLastError () const |
Return the error description of the last error that occurred. | |
std::string | getLastErrorString () const |
Return the error description of the last error that occurred. | |
const ms_masses * | getMasses () const |
Returns a pointer to the internal copy of the masses file. | |
int | getMissed () const |
Returns number of missed cleavage sites for the current peptide. | |
bool | getNextPeptide () |
Call to iterate to the next peptide. | |
int | getPepEnd () const |
Returns the last position of the current peptide. | |
int | getPepStart () const |
Returns the first position of the current peptide. | |
ms_modvector | getVarMods () const |
Returns a list of variable modifications that have no conflicts with fixed modifications. | |
bool | isValid () const |
Call this function to determine if there have been any errors. | |
ms_aahelper & | operator= (const ms_aahelper &right) |
Assignment operator. | |
void | setAvailableModifications (const ms_modvector *fixedModVector, const ms_modvector *varModVector) |
Applies fixed modifications to residue masses and stores variable modifications for later use. | |
void | setEnzyme (const ms_enzyme *enzyme) |
Sets an enzyme to use. | |
void | setMasses (const ms_masses *masses) |
Copies all residue and chemical element masses from the masses file instance. | |
void | startIteratePeptides (const char *sequenceProtein, const int sizeProtein, const int pfa) |
Initialises internal members in preparation for generating peptides. | |
void | stopIteratePeptides () |
Stop iterating. | |
This class facilitates creation of peptides and calculation of MS-fragment masses.
enum FRAG_NL |
Flag for controlling iteration over multiple neutral losses.
If any modification has multiple neutral losses, ms_aahelper::calcFragments() and ms_aahelper::calcFragmentsEx() default to calculating fragments for the primary neutral loss. The primary NL choice is encoded in the peptide's neutral loss string (ms_peptide::getPrimaryNlStr()) – or strings if the peptide has some combination of variable mods, summed mods, ET mods or local mods.
Enumerator | |
---|---|
FRAG_NL_PRIMARY | Calculate fragments for primary neutral loss. |
FRAG_NL_SECONDARY | Calculate fragments for non-primary neutral losses. |
ms_aahelper | ( | const ms_mascotresfilebase & | resfile, |
const char * | enzymeFileName, | ||
const char * | quantSchemaFilePath = "http://www.matrixscience.com/xmlns/schema/quantitation_2 ../html/xmlns/schema/quantitation_2/quantitation_2.xsd http://www.matrixscience.com/xmlns/schema/quantitation_1 ../html/xmlns/schema/quantitation_1/quantitation_1.xsd" , |
||
const char * | unimodSchemaFilePath = "http://www.unimod.org/xmlns/schema/unimod_2 ../html/xmlns/schema/unimod_2/unimod_2.xsd" |
||
) |
Constructor from results file.
This constructor extracts the enzyme information if available from the passed results file object. The masses
information is loaded from the file using the matrix_science::ms_mascotresfilebase::getMasses() function. The modifications are read from the results file and added using setAvailableModifications().
Results files prior to Mascot 2.2 did not include specificity information. If the enzyme definition is not in the results file, the function attempts to load the enzymes file and find the correct enzyme defintion. It then calls the setEnzyme() function. Also, the modification information in the results file doesn't record specificities unambiguously, so these are derived when calcFragmentsEx() or similar are called.
The application should call isValid() after creating the object. If isValid() returns false, error messages are available, see Error Handling
resfile | needs to be a valid resfile object. |
enzymeFileName | will only be used for Mascot results files from versions prior to Mascot 2.2 which don't have the specificities in the results file. |
quantSchemaFilePath | is required for when the results file contains a quantitation method that needs to be loaded and validated against a schema. There are three possible values for this function:
|
unimodSchemaFilePath | is required for results files from Mascot 2.2 and later where the modification information is in the results file in XML format and needs a schema for validation. There are three possible values for this function:
|
ms_aahelper | ( | const ms_mascotresults & | summary, |
const char * | enzymeFileName, | ||
const char * | quantSchemaFilePath = "http://www.matrixscience.com/xmlns/schema/quantitation_2 ../html/xmlns/schema/quantitation_2/quantitation_2.xsd http://www.matrixscience.com/xmlns/schema/quantitation_1 ../html/xmlns/schema/quantitation_1/quantitation_1.xsd" , |
||
const char * | unimodSchemaFilePath = "http://www.unimod.org/xmlns/schema/unimod_2 ../html/xmlns/schema/unimod_2/unimod_2.xsd" |
||
) |
Constructor from peptide summary or protein summary.
This constructor is similar to ms_aahelper(const ms_mascotresfilebase&, const char*, const char*, const char*), but additionally allows ms_aahelper::calcFragmentsEx() to look up error tolerant modifications and spectral library modifications from the results file.
The constructor extracts the enzyme information if available from the passed results file object. The masses
information is loaded from the file using the matrix_science::ms_mascotresfilebase::getMasses() function. The modifications are read from the results file and added using setAvailableModifications().
Results files prior to Mascot 2.2 did not include specificity information. If the enzyme definition is not in the results file, the function attempts to load the enzymes file and find the correct enzyme defintion. It then calls the setEnzyme() function. Also, the modification information in the results file doesn't record specificities unambiguously, so these are derived when calcFragmentsEx() or similar are called.
The application should call isValid() after creating the object. If isValid() returns false, error messages are available, see Error Handling
summary | needs to be a valid ms_mascotresults object, either ms_peptidesummary or ms_proteinsummary. |
enzymeFileName | will only be used for Mascot results files from versions prior to Mascot 2.2 which don't have the specificities in the results file. |
quantSchemaFilePath | is required for when the results file contains a quantitation method that needs to be loaded and validated against a schema. There are three possible values for this function:
|
unimodSchemaFilePath | is required for results files from Mascot 2.2 and later where the modification information is in the results file in XML format and needs a schema for validation. There are three possible values for this function:
|
|
inherited |
Copies all errors from another instance and appends them at the end of own list.
src | The object to copy the errors across from. See Maintaining object references: two rules of thumb. |
std::vector< double > calcFragments | ( | const ms_peptide * | peptide, |
const int | seriesID, | ||
const bool | doubleCharged, | ||
const double | minMass, | ||
const double | maxMass, | ||
const MASS_TYPE | massType, | ||
ms_fragmentvector * | fragments, | ||
ms_errs * | err, | ||
const FRAG_NL | fragNlType = FRAG_NL_PRIMARY |
||
) | const |
Returns a vector of ion masses for the given series and peptide.
For 'regular' sequence type ions, the final fragment mass (approximately the peptide mass less the terminus) will not be returned.
Note that this method does not take the peptide object's seriesUsedStr
into account (see ms_peptide::getSeriesUsedStr()). The rules in Mascot state that fragments for neutral loss series (A_MINUS_NH3
, A_MINUS_H2O
, and corresponding series for B and Y) should only be generated if the peptide match has a statistically significant number of matches to the corresponding singly charged parent ion series (e.g. A_MINUS_NH3
requires enough matches to singly charged A series fragments). You can take this into account by testing whether seriesUsedStr
contains 1 or 2 for the singly charged parent ion series. See ms_peptide::getSeriesUsedStr().
peptide | peptide object to generate ion masses for. |
seriesID | series number from ms_fragmentationrules::FRAG_SERIES_TYPE. |
doubleCharged | some ion series allow double charged fragment; supply TRUE if you want to get mass over charge values for double charged ions only. Otherwise single charged ions will be generated. If the given series doesn't allow double charged ions then an empty list will be returned and err will reflect the inconsistency. |
minMass | minimal possible mass value to return. |
maxMass | maximal possible mass value to return. |
massType | Specify matrix_science::MASS_TYPE_MONO or matrix_science::MASS_TYPE_AVE. |
fragments | a vector of items with more detailed information about each peptide fragment. Any existing items in the fragment vector will be overwritten by this function. |
err | error object that accumulates messages without affecting the object validity. |
fragNlType | (optional) Either ms_aahelper::FRAG_NL_PRIMARY or ms_aahelper::FRAG_NL_SECONDARY. Default is FRAG_NL_PRIMARY. |
std::vector< double > calcFragments | ( | const ms_peptide * | peptide, |
const int | seriesID, | ||
const bool | doubleCharged, | ||
const double | minMass, | ||
const double | maxMass, | ||
const MASS_TYPE | massType, | ||
std::vector< ms_fragment > * | fragments, | ||
ms_errs * | err, | ||
const FRAG_NL | fragNlType = FRAG_NL_PRIMARY |
||
) | const |
Returns a vector of ion masses for the given series and peptide.
For 'regular' sequence type ions, the final fragment mass (approximately the peptide mass less the terminus) will not be returned.
Note that this method does not take the peptide object's seriesUsedStr
into account (see ms_peptide::getSeriesUsedStr()). The rules in Mascot state that fragments for neutral loss series (A_MINUS_NH3
, A_MINUS_H2O
, and corresponding series for B and Y) should only be generated if the peptide match has a statistically significant number of matches to the corresponding singly charged parent ion series (e.g. A_MINUS_NH3
requires enough matches to singly charged A series fragments). You can take this into account by testing whether seriesUsedStr
contains 1 or 2 for the singly charged parent ion series. See ms_peptide::getSeriesUsedStr().
peptide | peptide object to generate ion masses for. |
seriesID | series number from ms_fragmentationrules::FRAG_SERIES_TYPE. |
doubleCharged | some ion series allow double charged fragment; supply TRUE if you want to get mass over charge values for double charged ions only. Otherwise single charged ions will be generated. If the given series doesn't allow double charged ions then an empty list will be returned and err will reflect the inconsistency. |
minMass | minimal possible mass value to return. |
maxMass | maximal possible mass value to return. |
massType | Specify matrix_science::MASS_TYPE_MONO or matrix_science::MASS_TYPE_AVE. |
fragments | a vector of items with more detailed information about each peptide fragment. Any existing items in the fragment vector will be overwritten by this function. |
err | error object that accumulates messages without affecting the object validity. |
fragNlType | (optional) Either ms_aahelper::FRAG_NL_PRIMARY or ms_aahelper::FRAG_NL_SECONDARY. Default is FRAG_NL_PRIMARY. |
bool calcFragmentsEx | ( | const ms_peptide * | peptide, |
const int | seriesID, | ||
const int | fragCharge, | ||
const double | minMass, | ||
const double | maxMass, | ||
const MASS_TYPE | massType, | ||
ms_fragmentvector * | fragments, | ||
ms_errs * | err, | ||
const FRAG_NL | fragNlType = FRAG_NL_PRIMARY |
||
) | const |
Returns a vector of ion masses for the given series and peptide.
The difference to calcFragments() is that you can specify explicitly what charge state should all the generated fragments be. The charge state of the peptide-object is ignored then completely. When you need to obtain fragment m/z values for several different charge states just call this method several times and merge the results. For 'regular' sequence type ions, the final fragment mass (approximately the peptide mass less the terminus) will not be returned.
Note that this method does not take the peptide object's seriesUsedStr
into account (see ms_peptide::getSeriesUsedStr()). The rules in Mascot state that fragments for neutral loss series (A_MINUS_NH3
, A_MINUS_H2O
, and corresponding series for B and Y) should only be generated if the peptide match has a statistically significant number of matches to the corresponding singly charged parent ion series (e.g. A_MINUS_NH3
requires enough matches to singly charged A series fragments). You can take this into account by testing whether seriesUsedStr
contains 1 or 2 for the singly charged parent ion series. See ms_peptide::getSeriesUsedStr().
peptide | peptide object to generate ion masses for. |
seriesID | series number from: ms_fragmentationrules::FRAG_SERIES_TYPE. |
fragCharge | explicit charge state of the fragments being generated (peptide charge is ignored), zero value for this parameter means "Mr". |
minMass | minimal possible mass value to return. |
maxMass | maximal possible mass value to return. |
massType | Specify matrix_science::MASS_TYPE_MONO or matrix_science::MASS_TYPE_AVE. |
fragments | a vector of items with more detailed information about each peptide fragment. Any items in the fragment vector are overwritten by this function. |
err | error object that accumulates messages without affecting the object validity. |
fragNlType | (optional) Either ms_aahelper::FRAG_NL_PRIMARY or ms_aahelper::FRAG_NL_SECONDARY. Default is FRAG_NL_PRIMARY. |
bool calcFragmentsEx | ( | const ms_peptide * | peptide, |
const int | seriesID, | ||
const int | fragCharge, | ||
const double | minMass, | ||
const double | maxMass, | ||
const MASS_TYPE | massType, | ||
std::vector< ms_fragment > * | fragments, | ||
ms_errs * | err, | ||
const FRAG_NL | fragNlType = FRAG_NL_PRIMARY |
||
) | const |
Returns a vector of ion masses for the given series and peptide.
The difference to calcFragments() is that you can specify explicitly what charge state should all the generated fragments be. The charge state of the peptide-object is ignored then completely. When you need to obtain fragment m/z values for several different charge states just call this method several times and merge the results. For 'regular' sequence type ions, the final fragment mass (approximately the peptide mass less the terminus) will not be returned.
Note that this method does not take the peptide object's seriesUsedStr
into account (see ms_peptide::getSeriesUsedStr()). The rules in Mascot state that fragments for neutral loss series (A_MINUS_NH3
, A_MINUS_H2O
, and corresponding series for B and Y) should only be generated if the peptide match has a statistically significant number of matches to the corresponding singly charged parent ion series (e.g. A_MINUS_NH3
requires enough matches to singly charged A series fragments). You can take this into account by testing whether seriesUsedStr
contains 1 or 2 for the singly charged parent ion series. See ms_peptide::getSeriesUsedStr().
peptide | peptide object to generate ion masses for. |
seriesID | series number from: ms_fragmentationrules::FRAG_SERIES_TYPE. |
fragCharge | explicit charge state of the fragments being generated (peptide charge is ignored), zero value for this parameter means "Mr". |
minMass | minimal possible mass value to return. |
maxMass | maximal possible mass value to return. |
massType | Specify matrix_science::MASS_TYPE_MONO or matrix_science::MASS_TYPE_AVE. |
fragments | a vector of items with more detailed information about each peptide fragment. Any items in the fragment vector are overwritten by this function. |
err | error object that accumulates messages without affecting the object validity. |
fragNlType | (optional) Either ms_aahelper::FRAG_NL_PRIMARY or ms_aahelper::FRAG_NL_SECONDARY. Default is FRAG_NL_PRIMARY. |
double calcPeptideMZ | ( | const char * | proteinStr, |
const int | proteinLen, | ||
const int | startPos, | ||
const int | endPos, | ||
const std::vector< int > | numThatMustBeModded, | ||
const int | charge, | ||
const MASS_TYPE | massType, | ||
ms_errs * | err | ||
) | const |
Calculates and returns a peptide m/z (or Mr) value without specifying exact positions of modified residues.
This method can be called when only minimal (e.g. PMF search) information is available:
Before calling this function, call setAvailableModifications() to set up any modifications.
This function does not currently support Multiple modifications for the same site
numThatMustBeModded is a vector of integers. Each element of the vector corresponds to a variable modification. The first element corresponds to the first variable modification pushed onto the vector. So, pushing three values, 3,0,2 onto the vector would specify that 3 residues are modified by the first variable mod, and 2 residues are modified by the third variable mod. The size of this vector can be less than the number of available variable modifications - missing elements are assumed to be zeros.
The err object should be checked after calling this function to see if there are inconsistencies.
proteinStr | a protein sequence string. C++: it does not need to be null terminated. |
proteinLen | protein sequence length. |
startPos | the first peptide position. Specify 1 for the peptide to start at the first amino acid. |
endPos | the last peptide position. For example, startPos=1 and endPos=3 would give a peptide 3 residues long. |
numThatMustBeModded | is a vector of integers. See above, and also Using STL vector classes vectori, vectord and VectorString in Perl, Java, Python and C#. |
charge | 0 for de-charged mass, n for n-charged peptides. |
massType | should be matrix_science::MASS_TYPE_MONO or matrix_science::MASS_TYPE_AVE. |
err | error object that accumulates messages without affecting the object validity |
|
inherited |
Remove all errors from the current list of errors.
The list of 'errors' can include fatal errors, warning messages, information messages and different levels of debugging messages.
All messages are accumulated into a list in this object, until clearAllErrors() is called.
See Error Handling.
|
inherited |
Use this member to make a copy of another instance.
right | is the source to initialise from |
ms_peptide createCrosslinkedPeptide | ( | const ms_peptide & | pepAlpha, |
const ms_peptide & | pepBeta, | ||
const ms_linker_site_vector & | linkedSites, | ||
ms_errs * | err | ||
) | const |
Creates and returns a crosslinked peptide object.
The following conditions are checked. If any one is not satisfied, the method sets a corresponding error and returns an "empty" ms_peptide object.
Standard terminology recommends that alpha should be the longer or heavier molecule than beta, but there is no check for this.
Linker mass can be positive, zero or negative, although typically it is positive.
pepAlpha | is the alpha peptide. |
pepBeta | is the beta peptide. |
linkedSites | is the vector of links between alpha and beta. |
err | is an error object that accumulates messages without affecting the object validity. |
ms_peptide createPeptide | ( | const char * | proteinStr, |
const int | proteinLen, | ||
const int | startPos, | ||
const int | endPos, | ||
const std::vector< int > | varMods, | ||
const std::vector< int > | varModsWhichNl, | ||
const int | charge, | ||
const MASS_TYPE | massType, | ||
ms_errs * | err | ||
) | const |
Creates and returns a peptide object.
This method can be called if full peptide information is available. It creates and returns a peptide object instance that can then be passed to the calcFragments() method. Only available modifications will be applied
varMods is a vector of integers. It has the same content as modification strings in result files. The first element specifies how N-terminus of the peptide is modified. The next one corresponds to the first residue in the peptide etc. The last element refers to the C-terminus. Each element contain either '0' for non-modified positions or a variable modification number to apply. The size of this vector can also be less than (peptide length + 2) – missing elements are assumed to be zeros.
varModsWhichNl is also a vector of integers. There is one entry in the vector for each terminus and each residue. For a residue not modified by a modification with neutral loss(es), the value should be zero. For a site modified by a modification with neutral loss(es), a one-based index of neutral loss value to use for this peptide should be supplied. If a value of 0 is specified for a modification with a neutral loss, then the first neutral loss is assumed.
The err object should be checked after calling this function to see if there are inconsistencies.
proteinStr | a protein sequence string. C++: it does not need to be null-terminated. |
proteinLen | protein sequence length . |
startPos | the first peptide position. Specify 1 for the peptide to start at the first amino acid. |
endPos | the last peptide position. For example, startPos=1 and endPos=3 would give a peptide 3 residues long. |
varMods | is a vector of modified positions. See above and also Using STL vector classes vectori, vectord and VectorString in Perl, Java, Python and C#. |
varModsWhichNl | is a similar vector to varMods. See above and also Using STL vector classes vectori, vectord and VectorString in Perl, Java, Python and C#. |
charge | charge state of the peptide. |
massType | should be matrix_science::MASS_TYPE_MONO or matrix_science::MASS_TYPE_AVE. |
err | error object that accumulates messages without affecting the object validity |
ms_peptide createPeptide | ( | const char * | proteinStr, |
const int | proteinLen, | ||
const int | startPos, | ||
const int | endPos, | ||
const std::vector< int > | varMods, | ||
const std::vector< int > | varModsWhichNl, | ||
const std::vector< int > | summedMods, | ||
const std::vector< int > | summedModsWhichNl, | ||
const int | charge, | ||
const MASS_TYPE | massType, | ||
ms_errs * | err | ||
) | const |
Creates and returns a peptide object.
This method can be called if full peptide information is available. It creates and returns a peptide object instance that can then be passed to the calcFragments() method. Only available modifications will be applied
varMods is a vector of integers. It has the same content as modification strings in result files. The first element specifies how N-terminus of the peptide is modified. The next one corresponds to the first residue in the peptide etc. The last element refers to the C-terminus. Each element contain either '0' for non-modified positions or a variable modification number to apply. The size of this vector can also be less than (peptide length + 2) – missing elements are assumed to be zeros.
varModsWhichNl is also a vector of integers. There is one entry in the vector for each terminus and each residue. For a residue not modified by a modification with neutral loss(es), the value should be zero. For a site modified by a modification with neutral loss(es), a one-based index of neutral loss value to use for this peptide should be supplied. If a value of 0 is specified for a modification with a neutral loss, then the first neutral loss is assumed.
summedMods and summedModsWhichNl are identical to varMods and varModsWhichNl except that they apply to Multiple modifications for the same site
The err object should be checked after calling this function to see if there are inconsistencies.
proteinStr | a protein sequence string. C++: it does not need to be null-terminated. |
proteinLen | protein sequence length . |
startPos | the first peptide position. Specify 1 for the peptide to start at the first amino acid. |
endPos | the last peptide position. For example, startPos=1 and endPos=3 would give a peptide 3 residues long. |
varMods | is a vector of modified positions. See above and also Using STL vector classes vectori, vectord and VectorString in Perl, Java, Python and C#. |
varModsWhichNl | is a similar vector to varMods. See above and also Using STL vector classes vectori, vectord and VectorString in Perl, Java, Python and C#. |
summedMods | is a vector of modified positions. See above and also Using STL vector classes vectori, vectord and VectorString in Perl, Java, Python and C#. |
summedModsWhichNl | is a similar vector to varMods. See above and also Using STL vector classes vectori, vectord and VectorString in Perl, Java, Python and C#. |
charge | charge state of the peptide. |
massType | should be matrix_science::MASS_TYPE_MONO or matrix_science::MASS_TYPE_AVE. |
err | error object that accumulates messages without affecting the object validity |
|
inherited |
Retrive the error object using this function to get access to all errors and error parameters.
See Error Handling.
ms_modvector getFixedMods | ( | ) | const |
Returns a list of fixed modifications that have been successfully applied i.e. don't have conflicts.
Every member of the vector returned is a non-empty modification object. All conflicting modifications have been rejected.
|
inherited |
Return the error description of the last error that occurred.
All errors are accumulated into a list in this object, until clearAllErrors() is called. This function returns the last error that occurred.
See Error Handling.
|
inherited |
Return the error description of the last error that occurred.
All errors are accumulated into a list in this object, until clearAllErrors() is called. This function returns the last error that occurred.
See Error Handling.
int getMissed | ( | ) | const |
Returns number of missed cleavage sites for the current peptide.
This will return 0 if getNextPeptide() returned false or if stopIteratePeptides() has been called.
bool getNextPeptide | ( | ) |
Call to iterate to the next peptide.
Finds a new unique peptide. Call getPepStart() and getPepEnd() to get the new peptide start and end positions.
int getPepEnd | ( | ) | const |
Returns the last position of the current peptide.
This will return -1 if getNextPeptide() returned false or if stopIteratePeptides() has been called.
int getPepStart | ( | ) | const |
Returns the first position of the current peptide.
This will return -1 if getNextPeptide() returned false or if stopIteratePeptides() has been called.
ms_modvector getVarMods | ( | ) | const |
Returns a list of variable modifications that have no conflicts with fixed modifications.
The vector returned contains null pointers in place of conflicting modifications. The reason for that is to keep the original order of modifications.
|
inherited |
Call this function to determine if there have been any errors.
This will return true unless there have been any fatal errors.
See Error Handling.
void setAvailableModifications | ( | const ms_modvector * | fixedModVector, |
const ms_modvector * | varModVector | ||
) |
Applies fixed modifications to residue masses and stores variable modifications for later use.
The object should be checked for validity after calling this method.
No checking for overlapping modifications is performed.
It is important to remember the order of modifications submitted here as all future calcPeptideMZ(), createPeptide() and calcFragments() method calls will refer to this original order. The modifications are numbered from 1 to n.
There is no need to call this function if an ms_mascotresfilebase object is passed to the relevant ms_aahelper constructor. When that constructor is called, the mapping of the numbers is exactly as in the deltaX lines of the masses section in the results file. To retrieve the relevant names, use ms_searchparams::getVarModsName() with num=X. The numbers in the strings returned from ms_peptide::getVarModsStr() then correspond to the modification numbers supplied to this function.
If a fixed modification and a variable modification are applied to the same residue or terminus, then the fixed modification is substituted with the variable modification.
fixedModVector | A valid pointer to a vector of fixed modifications |
varModVector | A valid pointer to a vector of variable modifications |
void setMasses | ( | const ms_masses * | masses | ) |
Copies all residue and chemical element masses from the masses
file instance.
An ms_umod_configfile object can also be used as a source of masses. In that case call the corresponding method ms_masses::copyFrom() and supply an ms_umod_configfile instance as a parameter.
masses | A valid pointer to an ms_masses object |
void startIteratePeptides | ( | const char * | sequenceProtein, |
const int | sizeProtein, | ||
const int | pfa | ||
) |
Initialises internal members in preparation for generating peptides.
The first peptide ends are not available after calling this method. You have to call getNextPeptide() and check its returned value before calling getPepStart(), getPepEnd(), getMissed().
sequenceProtein | protein sequence string (not null-terminated) |
sizeProtein | length of the protein string |
pfa | maximal number of missed cleavages |
void stopIteratePeptides | ( | ) |
Stop iterating.
Call this method after you have finished retrieving peptides. All calls to getPepStart(), getPepEnd() will return -1 as invalid peptide ends, and getNextPeptide() will return only FALSE until the iteration mechanism is re-initiated with startIteratePeptides().