Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
ms_ms1quant_time_align.hpp
1/*
2##############################################################################
3# File: ms_ms1quant_time_align.hpp #
4# Mascot Parser toolkit #
5# Class for accessing the time alignemnt data produced by Distiller for LFQ #
6##############################################################################
7# COPYRIGHT NOTICE #
8# Copyright 1998-2022 Matrix Science Limited All Rights Reserved. #
9# #
10##############################################################################
11# $Source: parser/inc/ms_ms1quant_time_align.hpp $
12# $Author: dcreasy@matrixscience.com $
13# $Date: 2024-08-06 14:56:24 +0100 $
14# $Revision: b7e8d5f901bc33b9cf963dd992cadbcca121a891 | MSPARSER_REL_3_0_0-2024-09-24-0-g93ebaeb4f4 $
15##############################################################################
16*/
17
18#ifndef MS_MS1QUANT_TIME_ALIGN_HPP
19#define MS_MS1QUANT_TIME_ALIGN_HPP
20
21
22// Includes from the standard template library
23#include <string>
24
25namespace matrix_science
26{
27 //=========================================================================
33 class ms_ms1quant_time_align_body;
34
36
45 class MS_MASCOTRESFILE_API ms_ms1quant_time_align :
46 public ms_handle, public ms_errors
47 {
48 public:
52 enum status_t {
56 ST_TA_CALCULATED
57 };
58
60 ms_ms1quant_time_align(const int binSize = 12);
61
63 ms_ms1quant_time_align(const ms_ms1quant_time_align_body & body);
64
66 bool loadXmlFile(const std::string & xmlFilename, const std::string & schemaDirectory);
67
69 bool saveXmlFile(const std::string & xmlFilename, const std::string & schemaDirectory) const;
70
72 double getRToffset(const int myProjectId, const int otherProjectId, const double rtInOtherProject, const double mOverZ) const;
73
75 double getEstimatedFeatureWidth(const int subProjectId, const double mOverZ, const double rt) const;
76
77#ifndef SWIG
79 ms_ms1quant_time_align_limits & getCombinedLimits(const int fractionNum);
80#endif
81
83 ms_ms1quant_time_align_limits getCombinedLimits(const int fractionNum) const;
84
86 int getBinSize() const;
87
88#ifndef SWIG
90 std::vector<std::vector<std::vector<double>>> & getFinalResults();
91
93 std::vector<std::vector<std::vector<double>>>& getShiftsToConsensus();
94
96 std::vector<std::vector<std::vector<double>>>& getShiftsFromConsensus();
97#endif
99 const std::vector<std::vector<std::vector<double>>> & getFinalResults() const;
100
102 const std::vector<std::vector<std::vector<double>>>& getShiftsToConsensus() const;
103
105 const std::vector<std::vector<std::vector<double>>>& getShiftsFromConsensus() const;
106
108 typedef std::vector<std::vector<std::map<double, double>>> featureWidths_t;
109
110#ifndef SWIG
112 featureWidths_t & getFeatureWidths();
113#endif
115 void setAverageFeatureWidths(const std::vector<double> & featureWidths);
116
118 const featureWidths_t & getFeatureWidths() const;
119
120#ifndef SWIG
121 bool getEvaluation(const int subProject, double & meanErrorsRaw, double & meanErrorsAligned, double & stdevErrorsRaw, double & stdevErrorsAligned, double & pearsonCoefficientRaw, double & pearsonCoefficientAligned);
122#else // SWIG Multiple return values
123 bool getEvaluation(const int subProject, double & OUTPUT, double & OUTPUT, double & OUTPUT, double & OUTPUT, double & OUTPUT, double & OUTPUT);
124#endif
125
127 void setStatus(status_t status);
128
130 status_t getStatus(void) const;
131
133 std::string getStatusAsText(void) const;
134
136 void setAlgorithmName(const char* algorithmName);
137
139 std::string getAlgorithmName() const;
140
142 const std::vector<int> getSubProjectToFractionMap() const;
143
144#ifndef SWIG
146 ms_ms1quant_time_align_body * body();
148 const ms_ms1quant_time_align_body * body() const;
149#endif
151 typedef std::map<int, std::vector<int>> fractionToSubProject_t;
152
154 fractionToSubProject_t getFractionToSubProjectMap() const;
155
157 bool calculateFromConsensuValues(bool replaceExisting = false);
158
159
160 protected:
161 void setUpFractions(const std::vector<int> & subProjectToFraction);
162
163 void setEvaluation(int subProject, double meanErrorsRaw, double meanErrorsAligned, double stdevErrorsRaw, double stdevErrorsAligned, double pearsonCoefficientRaw, double pearsonCoefficientAligned);
164 };
165 // end of quantitation_group
167 //=========================================================================
168
169} // namespace matrix_science
170
171
172#endif // MS_MS1QUANT_TIME_ALIGN_HPP
173
174/*------------------------------- End of File -------------------------------*/
This class is used as a base class for several Mascot Parser classes.
Definition: ms_errors.hpp:696
Limits for m/z and retention time.
Definition: ms_ms1quant_time_align_limits.hpp:39
Time alignment between multiple runs (raw files) is performed in Mascot Distiller for label free quan...
Definition: ms_ms1quant_time_align.hpp:47
std::map< int, std::vector< int > > fractionToSubProject_t
the vector for each fraction contains 0 based subProject numbers and fraction numbers don't need to b...
Definition: ms_ms1quant_time_align.hpp:151
std::vector< std::vector< std::map< double, double > > > featureWidths_t
[prj][m/z bin][rt->width]
Definition: ms_ms1quant_time_align.hpp:108
status_t
Definition: ms_ms1quant_time_align.hpp:52
@ ST_TA_LOADED_FROM_XML
The time alignment data has been loaded from an xml so does not need to be recalculated.
Definition: ms_ms1quant_time_align.hpp:54
@ ST_TA_NO_DATA
No time alignment data. If the protocol is replicate, this indicates time alignment still needs to be...
Definition: ms_ms1quant_time_align.hpp:53
@ ST_TA_LOADED_FROM_CDB
The time alignment data has been loaded from a cdb file so does not need to be recalculated.
Definition: ms_ms1quant_time_align.hpp:55