17#ifndef MS_MS1QUANTITATION_HPP
18#define MS_MS1QUANTITATION_HPP
27namespace msparser_internal
33namespace matrix_science
41 class ms_msquant1_mod_format;
42 class ms_cache_stream;
43 class ms_progress_info;
44 class ms_mascotresults_params;
96 MERGE_QUANT_QUERY_NUMBERS_ARE_FROM_MERGED_RESULTS = 0x0001,
97 MERGE_QUANT_MERGE_COMPONENTS_INTO_QUANT_MATCH = 0x0002,
98 MERGE_QUANT_USE_COMPONENT_FILE_INDEX_TO_FIND_XIC = 0x0004,
99 MERGE_QUANT_APPLY_THRESHOLDS_AFTER_MERGE = 0x0008,
101 MERGE_QUANT_DEFAULT_PRECURSOR_METHOD = MERGE_QUANT_APPLY_THRESHOLDS_AFTER_MERGE,
102 MERGE_QUANT_DEFAULT_REPLICATE_METHOD = (MERGE_QUANT_QUERY_NUMBERS_ARE_FROM_MERGED_RESULTS | MERGE_QUANT_MERGE_COMPONENTS_INTO_QUANT_MATCH | MERGE_QUANT_USE_COMPONENT_FILE_INDEX_TO_FIND_XIC)
125 int getNumPeptideStatuses()
const;
130 int getNumHits()
const;
135 int getNumProteinFamilies()
const;
138 int getNumMatches()
const;
153 void addMatchPeptide(
157 const std::string & matchBelongsToComponent,
178 bool loadXmlFile(
const std::string & filename,
const std::string & xmlSchemaPath);
181 bool saveXmlFile(
const std::string & xmlFilename,
bool completeReport,
bool saveTimeAlignmentData =
false);
184 bool loadCdbFile(
const std::string & cdbFilename,
const std::string & cacheFilename,
bool revalidateQualityThresholds=
true);
187 bool saveCdbFile(
const std::string & cdbFilename,
const std::string & cacheFilename,
bool createEmptyMissingComponents =
false);
196 std::string getReadableVarMods(std::string varmods);
199 std::string getReadableVarModsConcise(std::string varmods);
205 int getNumMatchesForHit(
int hitId,
int memberNumber)
const;
210 int getNumGroups()
const;
212 int getDatasourceForGroup(
int groupIndex1)
const;
215 int getNumMatchesForGroup(
int groupIndex1)
const;
220 virtual ms_protein_quant_ratio getProteinRatio(
const std::string &accession,
int dbIdx,
const std::string &ratioName)
const;
226 std::vector<double> getAllProteinRatios(
const std::string & accession,
const int dbIdx,
const std::string & ratioName)
const;
229 std::vector<std::vector<bool> > getAllProteinRatioFlags(
const std::string & accession,
const int dbIdx,
const std::string & ratioName)
const;
232 std::vector<std::vector<double> > getAllProteinRatioValues(
const std::string & accession,
const int dbIdx,
const std::string & ratioName)
const;
235 std::vector<std::string> getAllProteinRatioPepSeqs(
const std::string & accession,
const int dbIdx,
const std::string & ratioName)
const;
238 bool isAverageProtocol()
const;
240 void setAverageReferenceProtein(
const char *accession,
int dbIdx,
bool isReferenceUserSelected);
242 void setAverageNumPeptides(
unsigned int num = 3);
244 void setAverageSelection(
const char * value);
247 bool getAveragePeptideIntensity(
248 const std::string &accession,
250 double * averageIntensity,
256 bool getAveragePeptideIntensity(
257 const std::string & accession,
266 std::vector<int> getQuantitationDatasources()
const;
268 int getNumMatchedPeptideStatuses()
const;
271 void initGroupChargeStates(
272 std::set<int> * calc_chargestates,
277 void calc_complete();
280 bool isDataCached(MS1QUANT_BUGFIX_NUM bugNum)
const;
293 using ms_quantitation::countDistinctPeptides;
297 virtual int countDistinctPeptides(
const std::vector<ms_peptide_quant_key> & activeKeys)
const;
303 const std::string & cdbFilename,
304 const std::string & cacheFilename,
311 const std::string & filename,
312 const std::string & xmlSchemaPath=
"",
316 bool mergeQuantitationResults(
const std::vector<std::string> & cdbFilenames,
317 const std::vector<std::string> & cacheFilenames,
318 const MERGE_QUANT_RESULTS_FLAGS flags,
322 bool mergeQuantitationResults(
const std::vector<std::string> & xmlFilenames,
323 const MERGE_QUANT_RESULTS_FLAGS flags,
324 const std::string & xmlSchemaPath=
"",
328 static bool readResultCounters(
const std::string & cdbFile,
329 int &numMatches,
int &numHits,
int &numPepGrp,
int &numPeptideComponents);
331 static bool readResultCounters(
const std::string & cdbFile,
332 int &OUTPUT,
int &OUTPUT,
int &OUTPUT,
int &OUTPUT);
342 void initialiseAfterLoad();
345 double calculatePeptideNormalisationBase(
const std::string &ratioName)
const;
347 void normalisePeptideRatios();
352 bool saveHitToXml(msparser_internal::ms_XMLHelper & helper, msparser_internal::ms_XMLElement & element,
const matrix_science::ms_protein * protein,
int hitId,
int memberNumber);
354 void getProteinRatioOverrideKeys(
357 const std::string & ratioName,
359 int memberNumber)
const;
362 const std::string &accession,
366 void rematchInferredMatches(
const bool allowMassTimeMatches);
369 void updateMatchPeptideEvidence();
370 bool updateProteinMatches();
375 std::map<matrix_science::ms_peptide_quant_key, ms_ms1quant_peptide_status_body> getMatchedPeptideStatuses()
const;
378 std::vector<ms_ms1quant_match> getMatchesForHit(
int hitId,
int memberNumber)
const;
381 bool saveGroupToXml(msparser_internal::ms_XMLHelper & helper, msparser_internal::ms_XMLElement & element,
const matrix_science::ms_protein * protein,
int hitId,
int memberNumber)
const;
382 void reorderMatchesAfterMerge();
385 bool mergeCdbFiles(
const std::vector<std::string> & cdbFilenames,
386 const std::vector<std::string> & cacheFilenames,
387 const std::vector<std::string> & resultFilenames,
389 const std::string & cacheDirectory,
390 const MERGE_QUANT_RESULTS_FLAGS flags);
394 const std::vector<std::string> & xmlFilenames,
395 const std::vector<std::string> & resultFilenames,
396 const std::string & cacheDirectory,
397 const std::string & xmlSchemaPath,
398 const MERGE_QUANT_RESULTS_FLAGS flags);
401 void getKeyStrings(
const int dataSourceId,
const std::string & peptideStr,
const std::string & labelFreeVarMods,
const int chargeState,
402 std::string & groupKey, std::string & uniqueKey)
const;
406 std::map<ms_peptide_quant_key, ms_ms1quant_match> matches_;
408 std::map<std::string, ms_peptide_quant_key> matchKeys_;
409 std::map<std::string, std::set<ms_peptide_quant_key> > matchGroups_;
410 std::vector<std::string> matchGroupNames_;
414 std::map<ms_peptide_quant_key, ms_peptide_quant_key> inferredMatchSource_;
416 typedef std::pair<int, int> Hitkey;
417 std::vector<Hitkey> hitkeys_;
419 bool hasAverageResults_;
422 matrix_science::ms_cache_file cacheFile_;
424 mutable const ms_msquant1_mod_format * modFormat_;
426 std::vector<matrix_science::ms_cache_file *> multifileCacheFiles_;
428 std::string bugsfixed_;
Peptide and protein quantitation using custom peptide ratios and protein-peptide mappings.
Definition: ms_customquantitation.hpp:119
Class which provides constructor parameters for either ms_peptidesummary or ms_proteinsummary.
Definition: ms_mascotresults_params.hpp:32
Results specific to an 'average' type quantitation method.
Definition: ms_ms1quant_average_results.hpp:42
A peptide that has been matched, in quantitation, to a protein hit.
Definition: ms_ms1quant_match.hpp:47
An individual peptide's quantitation status.
Definition: ms_ms1quant_peptide_status.hpp:41
peptideStatus
Status codes from fitting peptides.
Definition: ms_ms1quant_peptide_status.hpp:48
Time alignment between multiple runs (raw files) is performed in Mascot Distiller for label free quan...
Definition: ms_ms1quant_time_align.hpp:47
The result of quantitation calculations applied to peptide summary.
Definition: ms_ms1quantitation.hpp:92
MERGE_QUANT_RESULTS_FLAGS
Enum for mergeQuantitationResults()
Definition: ms_ms1quantitation.hpp:95
MS1QUANT_BUGFIX_NUM
bugNum values for isDataCached().
Definition: ms_ms1quantitation.hpp:115
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
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
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 component element in quantitation.xml.
Definition: ms_quant_component.hpp:48
static const int file_index_value_not_set
A file_index value is a 1 based number. In cases where file_index values are not used (e....
Definition: ms_quant_file_index.hpp:112
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 normalisation element in quantitation.xml.
Definition: ms_quant_normalisation.hpp:42
An object of this class represent a single quality element in quantitation.xml.
Definition: ms_quant_quality.hpp:40
Wrapper for the public domain tinycdb package http://www.corpit.ru/mjt/tinycdb.html by Michael Tokare...
Definition: ms_tinycdb.hpp:124