18#ifndef MS_QUANTITATION_HPP
19#define MS_QUANTITATION_HPP
29namespace msparser_internal
35namespace matrix_science {
37 class ms_peptide_quant_key;
38 class ms_peptide_quant_key_vector;
39 class ms_peptide_quant_ratio;
40 class ms_protein_quant_ratio;
41 class ms_quant_outliers;
42 class ms_peptidesummary;
45 class ms_progress_info;
162 void setMinNumPeptides(
int value);
177 virtual std::vector<double> getAllProteinRatios(
const std::string & accession,
const int dbIdx,
const std::string & ratioName)
const = 0;
180 virtual std::vector<std::vector<bool> > getAllProteinRatioFlags(
const std::string & accession,
const int dbIdx,
const std::string & ratioName)
const = 0;
187 double getPeptideRatioNormalisationBase(
const std::string &ratioName)
const;
190 void setPeptideRatioNormalisationBase(
const std::string &ratioName,
double b);
193 void removePeptideRatioNormalisationBase(
const std::string &ratioName);
196 void removePeptideRatioNormalisationBases();
202 void addRawFileField(
const unsigned int id,
const std::string & name,
const std::string & value);
212 virtual int countDistinctPeptides(
const std::vector<ms_peptide_quant_key> & activeKeys)
const;
222 typedef std::map<std::string, std::string> HeaderInfo_t;
223 typedef std::vector<HeaderInfo_t> RawFileInfo_t;
224 RawFileInfo_t rawFileInfo_;
225 HeaderInfo_t headerInfo_;
228 virtual void getSortedFinitePeptideRatioValues(
const std::string &ratioName,
const std::set<ms_peptide_quant_key> &keys,
const std::set<ms_peptide_quant_key> &includeKeys,
const std::set<ms_peptide_quant_key> &excludeKeys, std::vector<double> &values, std::vector<double> &weights, std::vector<ms_peptide_quant_key> &activeKeys, std::map<ms_peptide_quant_key, int> &inactiveKeys)
const = 0;
231 void getProteinRatioSample(
const std::string &accession,
int dbIdx,
const std::string &ratioName,
const std::vector<ms_peptide_quant_key> &includeKeys,
const std::vector<ms_peptide_quant_key> &excludeKeys, std::vector<double> &sample, std::vector<double> &logSample, std::vector<double> &weights, std::vector<ms_peptide_quant_key> &activeKeys, std::map<ms_peptide_quant_key, int> &inactiveKeys,
double &normalityPvalue)
const;
234 ms_protein_quant_ratio calculateMedianRatio(
const std::string &accession,
int dbIdx,
const std::string &ratioName,
const std::vector<double> &sample,
const std::vector<double> &logSample,
const std::vector<ms_peptide_quant_key> &activeKeys,
const std::map<ms_peptide_quant_key, int> &inactiveKeys,
double normalityPvalue)
const;
237 ms_protein_quant_ratio calculateGeometricMeanRatio(
const std::string &accession,
int dbIdx,
const std::string &ratioName,
const std::vector<double> &sample,
const std::vector<double> &logSample,
const std::vector<ms_peptide_quant_key> &activeKeys,
const std::map<ms_peptide_quant_key, int> &inactiveKeys,
double normalityPvalue)
const;
240 ms_protein_quant_ratio calculateWeightedGeometricMeanRatio(
const std::string &accession,
int dbIdx,
const std::string &ratioName,
const std::vector<double> &sample,
const std::vector<double> &logSample,
const std::vector<double> &weights,
const std::vector<ms_peptide_quant_key> &activeKeys,
const std::map<ms_peptide_quant_key, int> &inactiveKeys,
double normalityPvalue)
const;
242 typedef std::pair<std::string, int> protein_key_t;
243 typedef std::map< protein_key_t, std::set<ms_peptide_quant_key> > protein_to_peptide_quant_key_t;
251 int getMinNumPeptides()
const;
255 std::string encodeForXml(
const std::string & value)
const;
258 msparser_internal::ms_XMLElement createXmlRoot(msparser_internal::ms_XMLHelper & helper)
const;
261 msparser_internal::ms_XMLElement createRawFilesElement(msparser_internal::ms_XMLHelper & helper, msparser_internal::ms_XMLElement & root)
const;
264 msparser_internal::ms_XMLElement createHeaderElement(msparser_internal::ms_XMLHelper & helper, msparser_internal::ms_XMLElement & root)
const;
267 bool addQuantitationMethodXml(msparser_internal::ms_XMLHelper & helper, msparser_internal::ms_XMLElement & root)
const;
273 bool addPeptideElement(msparser_internal::ms_XMLHelper & helper, msparser_internal::ms_XMLElement & root,
const matrix_science::ms_peptide & peptide,
const std::string & component)
const;
276 bool createPeptideGroupStatusElement(msparser_internal::ms_XMLHelper & helper, msparser_internal::ms_XMLElement & hitElement,
const matrix_science::ms_peptidesummary & peptideSummary,
long q,
long p,
const std::string & status,
const std::string & component,
char residueBefore,
char residueAfter)
const;
283 std::map< std::string, double > logH0ProteinRatio_;
284 typedef std::map< std::string, double > ratio_name_to_normalisation_base_t;
285 ratio_name_to_normalisation_base_t peptideNormalisationBases_;
This class is used as a base class for several Mascot Parser classes.
Definition: ms_errors.hpp:696
A vector of peptide quant keys.
Definition: ms_peptide_quant_key_vector.hpp:47
Feature key identifying a peptide ratio.
Definition: ms_peptide_quant_key.hpp:69
Peptide abundance in one component relative to another in a quantitation experiment.
Definition: ms_peptide_quant_ratio.hpp:61
This class encapsulates a peptide from the mascot results file.
Definition: ms_peptide.hpp:57
Use this class to get peptide summary results.
Definition: ms_peptidesummary.hpp:51
Contains information of the current progress of a task being performed.
Definition: ms_progress_info.hpp:40
Protein abundance in one component relative to another in a quantitation experiment,...
Definition: ms_protein_quant_ratio.hpp:72
This class encapsulates a protein in the mascot results file.
Definition: ms_protein.hpp:57
An object of this class represent a single quantitation method from quantitation.xml.
Definition: ms_quant_method.hpp:51
An object of this class represent a single OUTLIERS element in quantitation.xml.
Definition: ms_quant_outliers.hpp:44
Base class for peptide and protein quantitation.
Definition: ms_quantitation.hpp:138
virtual bool isPeptideRatioExcluded(const ms_peptide_quant_key &key, const std::string &ratioName) const =0
Boolean flag: is the given peptide ratio globally excluded from protein ratio calculation?
protein_to_peptide_quant_key_t proteinKeys_
Protein-to-peptide mapping.
Definition: ms_quantitation.hpp:245
virtual ms_protein_quant_ratio getProteinRatio(const std::string &accession, int dbIdx, const std::string &ratioName) const =0
Given the protein accession, database ID and ratio name, return the protein ratio data.
void clearRawFileFields()
Clears any raw file header information from the result.
virtual void setQuantOutliers(const ms_quant_outliers *)=0
Set new peptide ratio outlier settings.
virtual void getSortedFinitePeptideRatioValues(const std::string &ratioName, const std::set< ms_peptide_quant_key > &keys, const std::set< ms_peptide_quant_key > &includeKeys, const std::set< ms_peptide_quant_key > &excludeKeys, std::vector< double > &values, std::vector< double > &weights, std::vector< ms_peptide_quant_key > &activeKeys, std::map< ms_peptide_quant_key, int > &inactiveKeys) const =0
Given a list of q,p values and ratio name, find the non-infinite peptide ratio values and return them...
void addHeaderField(const std::string &name, const std::string &value)
Adds an item of project or search header information.
virtual void setPeptideRatioIncluded(const ms_peptide_quant_key &key, const std::string &ratioName)=0
Globally include a particular peptide ratio in protein ratio calculation.
void clearHeaderFields()
Clears any header information from the result.
virtual ms_protein_quant_ratio getProteinRatio(const std::string &accession, int dbIdx, const std::string &ratioName, const ms_peptide_quant_key_vector &includeKeys, const ms_peptide_quant_key_vector &excludeKeys) const =0
Given the protein accession, database ID and ratio name, return the protein ratio data,...
void addRawFileField(const unsigned int id, const std::string &name, const std::string &value)
Adds an item of raw file header information.
virtual ms_peptide_quant_ratio getPeptideRatio(const ms_peptide_quant_key &key, const std::string &ratioName) const =0
Given peptide quant key and ratio name, return the corresponding peptide ratio data.
virtual bool hasPeptideRatio(const ms_peptide_quant_key &key, const std::string &ratioName) const =0
Existence check: return true if a peptide ratio with the associated peptide quant key and ratio name ...
virtual void setPeptideRatioExcluded(const ms_peptide_quant_key &key, const std::string &ratioName)=0
Globally exclude a particular peptide ratio from protein ratio calculation.
virtual void setProteinRatioType(const char *value)=0
Set the protein ratio type.