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: 2025-01-12 19:32:12 +0000 $
14# $Revision: fe1e6417cc2b0f4dc9283fa86a1c13c112ed1988 | MSPARSER_REL_3_1_0-2025-07-27-0-gea47708fac $
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
67 TA_WM_LAST
68 };
69
71 ms_ms1quant_time_align(const int binSize = 12);
72
74 ms_ms1quant_time_align(const ms_ms1quant_time_align_body & body);
75
77 bool loadXmlFile(const std::string & xmlFilename, const std::string & schemaDirectory);
78
80 bool saveXmlFile(const std::string & xmlFilename, const std::string & schemaDirectory) const;
81
83 double getRToffset(const int myProjectId, const int otherProjectId, const double rtInOtherProject, const double mOverZ) const;
84
86 double getEstimatedFeatureWidth(const int subProjectId, const double mOverZ, const double rt) const;
87
88#ifndef SWIG
90 ms_ms1quant_time_align_limits & getCombinedLimits(const int fractionNum);
91#endif
92
94 ms_ms1quant_time_align_limits getCombinedLimits(const int fractionNum) const;
95
97 int getBinSize() const;
98
99#ifndef SWIG
101 std::vector<std::vector<std::vector<double>>> & getFinalResults();
102
104 std::vector<std::vector<std::vector<double>>>& getShiftsToConsensus();
105
107 std::vector<std::vector<std::vector<double>>>& getShiftsFromConsensus();
108#endif
110 const std::vector<std::vector<std::vector<double>>> & getFinalResults() const;
111
113 const std::vector<std::vector<std::vector<double>>>& getShiftsToConsensus() const;
114
116 const std::vector<std::vector<std::vector<double>>>& getShiftsFromConsensus() const;
117
119 typedef std::vector<std::vector<std::map<double, double>>> featureWidths_t;
120
121#ifndef SWIG
123 featureWidths_t & getFeatureWidths();
124#endif
126 void setAverageFeatureWidths(const std::vector<double> & featureWidths);
127
129 const featureWidths_t & getFeatureWidths() const;
130
131#ifndef SWIG
132 bool getEvaluation(const int subProject, double & meanErrorsRaw, double & meanErrorsAligned, double & stdevErrorsRaw, double & stdevErrorsAligned, double & pearsonCoefficientRaw, double & pearsonCoefficientAligned);
133#else // SWIG Multiple return values
134 bool getEvaluation(const int subProject, double & OUTPUT, double & OUTPUT, double & OUTPUT, double & OUTPUT, double & OUTPUT, double & OUTPUT);
135#endif
136
138 void setStatus(status_t status);
139
141 status_t getStatus(void) const;
142
144 std::string getStatusAsText(void) const;
145
147 void setAlgorithmName(const char* algorithmName);
148
150 std::string getAlgorithmName() const;
151
153 const std::vector<int> getSubProjectToFractionMap() const;
154
155#ifndef SWIG
157 ms_ms1quant_time_align_body * body();
159 const ms_ms1quant_time_align_body * body() const;
160#endif
162 typedef std::map<int, std::vector<int>> fractionToSubProject_t;
163
165 fractionToSubProject_t getFractionToSubProjectMap() const;
166
168 bool calculateFromConsensuValues(bool replaceExisting = false);
169
171 int getNumSharedPeptides(const int subProject1, const int subProject2) const;
172
174 void setNumSharedPeptides(const int subProject1, const int subProject2, int count);
175
177 int getMaxPossibleSharedPeptides(const int fractionNum) const;
178
180 void setMaxPossibleSharedPeptides(const int fractionNum, const int value);
181
183 std::string getWarningMessages(const warningMessage_t messageType, const int fractionNum) const;
184
186 void setWarningMessages(const warningMessage_t messageType, const int fractionNum, const std::string& message);
187
188 protected:
189 void setUpFractions(const std::vector<int> & subProjectToFraction);
190
191 void setEvaluation(int subProject, double meanErrorsRaw, double meanErrorsAligned, double stdevErrorsRaw, double stdevErrorsAligned, double pearsonCoefficientRaw, double pearsonCoefficientAligned);
192 };
193 // end of quantitation_group
195 //=========================================================================
196
197} // namespace matrix_science
198
199
200#endif // MS_MS1QUANT_TIME_ALIGN_HPP
201
202/*------------------------------- 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
warningMessage_t
Definition: ms_ms1quant_time_align.hpp:62
@ TA_WM_SUBPRJ_HAS_NO_SHARED_PEPTIDES
Supervised time alignment will fail because one or more subprojects have shared peptides with any oth...
Definition: ms_ms1quant_time_align.hpp:65
@ TA_WM_LOW_NUM_SHARED_PEPTIDES_BETWEEN_P1_AND_P2
Supervised time alignment may fail because low number of shared peptides between two subprojects.
Definition: ms_ms1quant_time_align.hpp:64
@ TA_WM_USER_SPEC_AUTO_BUT_USING_UNSUPERVISED
Message to give the user as to why time alignment has defaulted to unsupervised.
Definition: ms_ms1quant_time_align.hpp:66
@ TA_WM_NO_SHARED_PEPTIDES_BETWEEN_P1_AND_P2
Supervised time alignment may fail because no shared peptides between two subprojects.
Definition: ms_ms1quant_time_align.hpp:63
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:162
std::vector< std::vector< std::map< double, double > > > featureWidths_t
[prj][m/z bin][rt->width]
Definition: ms_ms1quant_time_align.hpp:119
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