libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
msrunretentiontime.h
Go to the documentation of this file.
1
2
/*******************************************************************************
3
* Copyright (c) 2019 Olivier Langella <Olivier.Langella@u-psud.fr>.
4
*
5
* This file is part of the PAPPSOms++ library.
6
*
7
* PAPPSOms++ is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
11
*
12
* PAPPSOms++ is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
19
*
20
******************************************************************************/
21
22
#pragma once
23
24
#include "
../msrunid.h
"
25
#include "
../msrunreader.h
"
26
#include <vector>
27
#include "
pappsomspp/core/processing/filters/filtermorpho.h
"
28
29
namespace
pappso
30
{
31
32
template
<
class
T>
33
struct
MsRunRetentionTimeSeamarkPoint
34
{
35
T
entityHash
;
36
double
retentionTime
;
37
double
intensity
;
38
};
39
40
41
template
<
class
T>
42
class
PMSPP_LIB_DECL
MsRunRetentionTime
43
{
44
private
:
45
struct
PeptideMs2Point
46
{
47
double
retentionTime
;
48
double
precursorIntensity
;
49
T
entityHash
;
50
};
51
52
enum class
ComputeRetentionTimeReference
53
{
54
maximum_intensity,
55
weighted_intensity,
56
last
57
};
58
59
public
:
60
MsRunRetentionTime
(
const
std::vector<double> &msrun_retention_time_line);
61
MsRunRetentionTime
(
const
MsRunRetentionTime<T>
&other);
62
~MsRunRetentionTime
();
63
64
void
setMs2MedianFilter(
const
FilterMorphoMedian
&ms2MedianFilter);
65
void
setMs2MeanFilter(
const
FilterMorphoMean
&ms2MeanFilter);
66
void
setMs1MeanFilter(
const
FilterMorphoMean
&ms1MeanFilter);
67
68
const
FilterMorphoMedian
&getMs2MedianFilter()
const
;
69
const
FilterMorphoMean
&getMs2MeanFilter()
const
;
70
const
FilterMorphoMean
&getMs1MeanFilter()
const
;
71
72
Trace
73
getCommonDeltaRt(
const
std::vector<
MsRunRetentionTimeSeamarkPoint<T>
> &other_seamarks)
const
;
74
75
/** @brief collects all peptide evidences of a given MSrun
76
* seamarks has to be converted to peptide retention time using
77
* computePeptideRetentionTimes
78
*
79
* @param peptide_id unique identifier (whichever type) of a peptide
80
* @param retentionTime retention time of this peptide observation
81
* @param precursorIntensity MS2 precursorIntensity of this peptide
82
*/
83
void
addPeptideAsSeamark(
const
T &peptide_id,
double
retentionTime,
double
precursorIntensity);
84
85
86
std::size_t getNumberOfCorrectedValues()
const
;
87
88
/** @brief align the current msrunretentiontime object using the given
89
* reference
90
* @param msrun_retention_time_reference the reference
91
* @return a trace containing aligned MS1 retention times
92
*/
93
Trace
align(
const
MsRunRetentionTime<T>
&msrun_retention_time_reference);
94
95
/** @brief get common seamarks between msrunretentiontime objects and their
96
* deltart
97
* @param msrun_retention_time_reference the reference
98
* @return a trace containing MS2 common points and their deltart
99
*/
100
Trace
getCommonSeamarksDeltaRt(
const
MsRunRetentionTime<T>
&msrun_retention_time_reference)
const
;
101
102
const
std::vector<MsRunRetentionTimeSeamarkPoint<T>> &getSeamarks()
const
;
103
104
/** @brief get aligned retention time vector
105
* @return vector of seconds (as double)
106
*/
107
const
std::vector<double> &getAlignedRetentionTimeVector()
const
;
108
109
void
setAlignedRetentionTimeVector(
const
std::vector<double> &aligned_times);
110
111
/** @brief get orginal retention time vector (not aligned)
112
* @return vector of seconds (as double)
113
*/
114
const
std::vector<double> &getMs1RetentionTimeVector()
const
;
115
116
bool
isAligned()
const
;
117
118
double
translateOriginal2AlignedRetentionTime(
double
original_retention_time)
const
;
119
120
121
double
translateAligned2OriginalRetentionTime(
double
aligned_retention_time)
const
;
122
123
/** @brief convert PeptideMs2Point into Peptide seamarks
124
* this is required before computing alignment
125
*/
126
void
computeSeamarks();
127
128
protected
:
129
double
getFrontRetentionTimeReference()
const
;
130
double
getBackRetentionTimeReference()
const
;
131
const
std::vector<MsRunRetentionTimeSeamarkPoint<T>> getSeamarksReferences()
const
;
132
133
private
:
134
/** @brief get a trace of common MS2 retention times (x values) by their
135
* deltart (y values)
136
* @param delta_rt the trace result (common MS2 retention times vs counter
137
* part deltart)
138
* @param other_seamarks seamarks of the counter part (reference)
139
*/
140
void
getCommonDeltaRt(
Trace
&delta_rt,
141
const
std::vector<
MsRunRetentionTimeSeamarkPoint<T>
> &other_seamarks)
const
;
142
void
correctNewTimeValues(
Trace
&ms1_aligned_points,
double
correction_parameter);
143
144
void
linearRegressionMs2toMs1(
Trace
&ms1_aligned_points,
const
Trace
&common_points);
145
146
private
:
147
FilterMorphoMedian
m_ms2MedianFilter
;
148
FilterMorphoMean
m_ms2MeanFilter
;
149
FilterMorphoMean
m_ms1MeanFilter
;
150
std::vector<double>
m_ms1RetentionTimeVector
;
151
std::vector<double>
m_alignedRetentionTimeVector
;
152
153
std::vector<MsRunRetentionTimeSeamarkPoint<T>>
m_seamarks
;
154
std::size_t
m_valuesCorrected
= 0;
155
156
std::vector<PeptideMs2Point>
m_allMs2Points
;
157
158
ComputeRetentionTimeReference
m_retentionTimeReferenceMethod
=
159
ComputeRetentionTimeReference::maximum_intensity
;
160
};
161
162
}
// namespace pappso
pappso::FilterMorphoMean
mean filter apply mean of y values inside the window : this results in a kind of smoothing
Definition
filtermorpho.h:225
pappso::FilterMorphoMedian
median filter apply median of y values inside the window
Definition
filtermorpho.h:205
pappso::MsRunRetentionTime
Definition
msrunretentiontime.h:43
pappso::MsRunRetentionTime::m_alignedRetentionTimeVector
std::vector< double > m_alignedRetentionTimeVector
Definition
msrunretentiontime.h:151
pappso::MsRunRetentionTime::m_allMs2Points
std::vector< PeptideMs2Point > m_allMs2Points
Definition
msrunretentiontime.h:156
pappso::MsRunRetentionTime::m_valuesCorrected
std::size_t m_valuesCorrected
Definition
msrunretentiontime.h:154
pappso::MsRunRetentionTime::MsRunRetentionTime
MsRunRetentionTime(const std::vector< double > &msrun_retention_time_line)
Definition
msrunretentiontime.cpp:37
pappso::MsRunRetentionTime::m_ms1MeanFilter
FilterMorphoMean m_ms1MeanFilter
Definition
msrunretentiontime.h:149
pappso::MsRunRetentionTime::m_ms2MeanFilter
FilterMorphoMean m_ms2MeanFilter
Definition
msrunretentiontime.h:148
pappso::MsRunRetentionTime::ComputeRetentionTimeReference
ComputeRetentionTimeReference
Definition
msrunretentiontime.h:53
pappso::MsRunRetentionTime::ComputeRetentionTimeReference::maximum_intensity
@ maximum_intensity
Definition
msrunretentiontime.h:54
pappso::MsRunRetentionTime::m_seamarks
std::vector< MsRunRetentionTimeSeamarkPoint< T > > m_seamarks
Definition
msrunretentiontime.h:153
pappso::MsRunRetentionTime::m_retentionTimeReferenceMethod
ComputeRetentionTimeReference m_retentionTimeReferenceMethod
Definition
msrunretentiontime.h:158
pappso::MsRunRetentionTime::m_ms1RetentionTimeVector
std::vector< double > m_ms1RetentionTimeVector
Definition
msrunretentiontime.h:150
pappso::MsRunRetentionTime::m_ms2MedianFilter
FilterMorphoMedian m_ms2MedianFilter
Definition
msrunretentiontime.h:147
pappso::Trace
A simple container of DataPoint instances.
Definition
trace.h:152
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition
export-import-config.h:14
filtermorpho.h
msrunid.h
msrunreader.h
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
pappso::MsRunRetentionTimeSeamarkPoint
Definition
msrunretentiontime.h:34
pappso::MsRunRetentionTimeSeamarkPoint::intensity
double intensity
Definition
msrunretentiontime.h:37
pappso::MsRunRetentionTimeSeamarkPoint::retentionTime
double retentionTime
Definition
msrunretentiontime.h:36
pappso::MsRunRetentionTimeSeamarkPoint::entityHash
T entityHash
Definition
msrunretentiontime.h:35
pappso::MsRunRetentionTime::PeptideMs2Point
Definition
msrunretentiontime.h:46
pappso::MsRunRetentionTime::PeptideMs2Point::precursorIntensity
double precursorIntensity
Definition
msrunretentiontime.h:48
pappso::MsRunRetentionTime::PeptideMs2Point::retentionTime
double retentionTime
Definition
msrunretentiontime.h:47
pappso::MsRunRetentionTime::PeptideMs2Point::entityHash
T entityHash
Definition
msrunretentiontime.h:49
pappsomspp
core
msrun
alignment
msrunretentiontime.h
Generated on
for libpappsomspp by
1.17.0