Helper routines for peptide quantitation. More...
#include <ms_quant_helper.hpp>
Public Member Functions | |
ms_quant_helper (const ms_peptidesummary &pepsum, const ms_quant_method &qm, const ms_umod_configfile &umodfile, const int file_index=ms_quant_file_index::file_index_value_not_set) | |
Default constructor. | |
~ms_quant_helper () | |
Destructor. | |
void | appendErrors (const ms_errors &src) |
Copies all errors from another instance and appends them at the end of own list. | |
void | clearAllErrors () |
Remove all errors from the current list of errors. | |
void | copyFrom (const ms_errors *right) |
Use this member to make a copy of another instance. | |
int | createMissingComponents (matrix_science::ms_ms1quant_match *match) const |
Create any missing components and return the number of new components created. | |
const ms_errs * | getErrorHandler () const |
Retrive the error object using this function to get access to all errors and error parameters. | |
int | getFraction (const int file_index) const |
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. | |
int | isPeptideQualityOK (int q, int p, std::string &reasonStrRef) const |
Given a peptide, test whether it passes the quality thresholds. | |
int | isPeptideQuantifiable (int q, int p, const ms_protein *protein, int peptideIndex, std::string &reasonStrRef) const |
Given a peptide and the residues before and after, test whether it is quantifiable. | |
bool | isValid () const |
Call this function to determine if there have been any errors. | |
Helper routines for peptide quantitation.
enum PEPTIDE_QUALITY |
Possible reasons why a peptide does not pass quality tests using a given quantitation method.
Possible reasons a peptide is not quantifiable using a given quantitation method.
ms_quant_helper | ( | const ms_peptidesummary & | pepsum, |
const ms_quant_method & | qm, | ||
const ms_umod_configfile & | umodfile, | ||
const int | file_index = ms_quant_file_index::file_index_value_not_set |
||
) |
Default constructor.
The object should receive the full quantitation method, including, in particular, component definitions and peptide quality settings. If the quantitation method is missing either set of settings, the corresponding methods will return the status "unavailable".
The constructor creates a copy of the relevant bits of the quantitation method and stores those internally. If you change the quantitation method later, you must create a new ms_quant_helper object.
pepsum | Mascot results file whose peptide matches are to be tested. |
qm | Quantitation method with component definitions, peptide quality settings and report ratio definitions. |
umodfile | Unimod configuration file for looking up modification specificities. |
file_index | is used for replicate, where the samples have been prefractionated and there is a raw data file for each fraction, the method can be set up so that each component (i.e. sample) has a number of file_index values, one for each file. |
|
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. |
|
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 |
int createMissingComponents | ( | matrix_science::ms_ms1quant_match * | match | ) | const |
Create any missing components and return the number of new components created.
Only supports the "precursor" protocol. Other protocols do nothing and return 0
For precursor, this will add the 'derived' matches. For example, if there is a peptide match to the light component, it will add an expected heavy match, even though there is no search ID for the heavy match.
match | contains the peptide match to which new 'components' are to be added. |
|
inherited |
Retrive the error object using this function to get access to all errors and error parameters.
See Error Handling.
int getFraction | ( | const int | file_index | ) | const |
file_index | is used for replicate, where the samples have been prefractionated and there is a raw data file for each fraction, the method can be set up so that each component (i.e. sample) has a number of file_index values, one for each file. |
|
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 isPeptideQualityOK | ( | int | q, |
int | p, | ||
std::string & | reasonStrRef | ||
) | const |
Given a peptide, test whether it passes the quality thresholds.
The peptide identified by query q and rank p is tested against peptide quality settings in the quantitation method. If it does not pass all of the quality tests (e.g. score thresholds), the corresponding status is returned; see PEPTIDE_QUALITY for details.
The method defers loading the full peptide object until it is really needed, if at all. Significance tests and score and expect value thresholds can be conducted without loading the peptide object in its entirety. This means the method is fast both when caching is in use and without caching.
See Multiple return values in Perl, Java, Python and C#.
[in] | q | Peptide query. |
[in] | p | Peptide rank. |
[out] | reasonStrRef | is a free-text description of the return status is assigned to the variable. If status is PEPTIDE_QUALITY_IS_OK , reasonStrRef will be the empty string. If status is PEPTIDE_QUALITY_UNAVAILABLE , reasonStrRef will not be changed by this method. |
int isPeptideQuantifiable | ( | int | q, |
int | p, | ||
const ms_protein * | protein, | ||
int | peptideIndex, | ||
std::string & | reasonStrRef | ||
) | const |
Given a peptide and the residues before and after, test whether it is quantifiable.
The method first loads the peptide with query q and rank p. The peptide is tested against component definitions in the quantitation method. If it is missing required modifications, or if it contains excluded modifications, the corresponding status is returned; see PEPTIDE_QUANTIFIABILITY for details.
If the quantitation method does not contain suitable component definitions, the return status is PEPTIDE_QUANTIFIABILITY_UNAVAILABLE
.
See Multiple return values in Perl, Java, Python and C#
[in] | q | Peptide query. |
[in] | p | Peptide rank. |
[in] | protein | Protein hit to which the peptide match is assigned. This is only needed in the case where a quality parameter is specified to exclude an unmodified protein N- or C-terminus residue. In this case, this code needs to know if the flanking residue is the corresponding protein terminus. The same peptide may appear in multiple proteins, and may be at the terminus of just one of them, so if you need all peptides that may be quantifiable, pass 0 or NULL. |
[in] | peptideIndex | Integer index of the peptide match in the protein hit, between 1 and protein->getNumPeptides() . If protein is null, use 0. |
[out] | reasonStrRef | is a free-text description of the return status is assigned to the variable. If status is PEPTIDE_IS_QUANTIFIABLE , reasonStrRef will be the empty string. If status is PEPTIDE_QUANTIFIABILITY_UNAVAILABLE , reasonStrRef will not be changed by this method. |
|
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.