libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
massspectrum.h
Go to the documentation of this file.
1
/**
2
* \file pappsomspp/massspectrum/massspectrum.h
3
* \date 15/3/2015
4
* \author Olivier Langella
5
* \brief basic mass spectrum
6
*/
7
8
/*******************************************************************************
9
* Copyright (c) 2015 Olivier Langella <Olivier.Langella@moulon.inra.fr>.
10
*
11
* This file is part of the PAPPSOms++ library.
12
*
13
* PAPPSOms++ is free software: you can redistribute it and/or modify
14
* it under the terms of the GNU General Public License as published by
15
* the Free Software Foundation, either version 3 of the License, or
16
* (at your option) any later version.
17
*
18
* PAPPSOms++ is distributed in the hope that it will be useful,
19
* but WITHOUT ANY WARRANTY; without even the implied warranty of
20
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
* GNU General Public License for more details.
22
*
23
* You should have received a copy of the GNU General Public License
24
* along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
25
*
26
* Contributors:
27
* Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and
28
*implementation
29
******************************************************************************/
30
31
#pragma once
32
33
#include <vector>
34
#include <memory>
35
36
#include <QDataStream>
37
38
#include "
pappsomspp/export-import-config.h
"
39
40
#include "
pappsomspp/core/mzrange.h
"
41
#include "
pappsomspp/core/trace/trace.h
"
42
43
44
namespace
pappso
45
{
46
47
// Forward declaration.
48
class
MassSpectrum
;
49
50
PMSPP_LIB_DECL
QDataStream &
operator<<
(QDataStream &out,
const
MassSpectrum
&spectrum);
51
PMSPP_LIB_DECL
QDataStream &
operator>>
(QDataStream &out,
MassSpectrum
&spectrum);
52
53
typedef
std::shared_ptr<MassSpectrum>
MassSpectrumSPtr
;
54
typedef
std::shared_ptr<const MassSpectrum>
MassSpectrumCstSPtr
;
55
56
class
MassSpectrumCombinerInterface;
57
58
59
//! Class to represent a mass spectrum.
60
/*!
61
* A mass spectrum is a collection of DataPoint instances. Moreover, it has
62
* internal data that represent the context of the acquisition of the data:
63
* retention time and drift time (if the experiment was an ion mobility mass
64
* spectrometry experiment).
65
*
66
* A MassSpectrum cannot perform combinations. For combination of mass
67
* spectra, the class to use is MassSpectrumCombinator.
68
*/
69
class
PMSPP_LIB_DECL
MassSpectrum
:
public
Trace
70
{
71
72
public
:
73
MassSpectrum
();
74
MassSpectrum
(std::vector<std::pair<pappso_double, pappso_double>> &data_point_vector);
75
MassSpectrum
(std::vector<DataPoint> &data_point_vector);
76
77
MassSpectrum
(
const
MapTrace
&other);
78
MassSpectrum
(
const
Trace
&other);
79
MassSpectrum
(
Trace
&&other);
// move constructor
80
81
MassSpectrum
(
const
MassSpectrum
&other);
82
MassSpectrum
(
MassSpectrum
&&other);
// move constructor
83
84
virtual
~MassSpectrum
();
85
86
virtual
MassSpectrum
&
operator=
(
const
MassSpectrum
&other);
87
virtual
MassSpectrum
&
operator=
(
MassSpectrum
&&other);
88
89
using
Trace::operator=;
90
91
MassSpectrumSPtr
makeMassSpectrumSPtr
()
const
;
92
MassSpectrumCstSPtr
makeMassSpectrumCstSPtr
()
const
;
93
94
/** @brief apply a filter on this MassSpectrum
95
* @param filter to process the MassSpectrum
96
* @return reference on the modified MassSpectrum
97
*/
98
virtual
MassSpectrum
&
massSpectrumFilter
(
const
MassSpectrumFilterInterface
&
filter
)
final
;
99
100
pappso_double
totalIonCurrent
()
const
;
101
// Alias for totalIonCurrent().
102
pappso_double
tic
()
const
;
103
pappso_double
tic
(
double
mzStart,
double
mzEnd);
104
105
const
DataPoint
&
maxIntensityDataPoint
()
const
;
106
107
const
DataPoint
&
minIntensityDataPoint
()
const
;
108
109
void
sortMz
();
110
111
bool
equals
(
const
MassSpectrum
&other,
PrecisionPtr
precision)
const
;
112
113
MassSpectrum
filterSum
(
const
MzRange
&mass_range)
const
;
114
115
116
// friend QDataStream& operator<<(QDataStream& out, const MassSpectrum&
117
// massSpectrum);
118
// friend QDataStream& operator>>(QDataStream& out, MassSpectrum&
119
// massSpectrum);
120
121
void
debugPrintValues
()
const
;
122
};
123
124
125
}
// namespace pappso
126
127
128
Q_DECLARE_METATYPE
(
pappso::MassSpectrum
);
129
Q_DECLARE_METATYPE
(
pappso::MassSpectrum
*);
130
131
extern
int
massSpectrumMetaTypeId
;
132
extern
int
massSpectrumPtrMetaTypeId
;
pappso::MapTrace
Definition
maptrace.h:36
pappso::MassSpectrumFilterInterface
generic interface to apply a filter on a MassSpectrum This is the same as FilterInterface,...
Definition
filterinterface.h:56
pappso::MassSpectrum
Class to represent a mass spectrum.
Definition
massspectrum.h:70
pappso::MassSpectrum::sortMz
void sortMz()
Sort the DataPoint instances of this spectrum.
Definition
massspectrum.cpp:204
pappso::MassSpectrum::debugPrintValues
void debugPrintValues() const
Definition
massspectrum.cpp:327
pappso::MassSpectrum::makeMassSpectrumCstSPtr
MassSpectrumCstSPtr makeMassSpectrumCstSPtr() const
Definition
massspectrum.cpp:135
pappso::MassSpectrum::equals
bool equals(const MassSpectrum &other, PrecisionPtr precision) const
Tells if this MassSpectrum is equal to massSpectrum.
Definition
massspectrum.cpp:221
pappso::MassSpectrum::makeMassSpectrumSPtr
MassSpectrumSPtr makeMassSpectrumSPtr() const
Definition
massspectrum.cpp:128
pappso::MassSpectrum::tic
pappso_double tic() const
Compute the total ion current of this mass spectrum.
Definition
massspectrum.cpp:161
pappso::MassSpectrum::MassSpectrum
MassSpectrum()
Definition
massspectrum.cpp:59
pappso::MassSpectrum::minIntensityDataPoint
const DataPoint & minIntensityDataPoint() const
Find the DataPoint instance having the smallest intensity (y) value.
Definition
massspectrum.cpp:192
pappso::MassSpectrum::massSpectrumFilter
virtual MassSpectrum & massSpectrumFilter(const MassSpectrumFilterInterface &filter) final
apply a filter on this MassSpectrum
Definition
massspectrum.cpp:394
pappso::MassSpectrum::filterSum
MassSpectrum filterSum(const MzRange &mass_range) const
Definition
massspectrum.cpp:261
pappso::MassSpectrum::operator=
virtual MassSpectrum & operator=(const MassSpectrum &other)
Definition
massspectrum.cpp:110
pappso::MassSpectrum::totalIonCurrent
pappso_double totalIonCurrent() const
Compute the total ion current of this mass spectrum.
Definition
massspectrum.cpp:150
pappso::MassSpectrum::maxIntensityDataPoint
const DataPoint & maxIntensityDataPoint() const
Find the DataPoint instance having the greatest intensity (y) value.
Definition
massspectrum.cpp:180
pappso::MzRange
Definition
mzrange.h:46
pappso::Trace::filter
virtual Trace & filter(const FilterInterface &filter) final
apply a filter on this trace
Definition
trace.cpp:1184
pappso::Trace::Trace
Trace()
Definition
trace.cpp:455
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition
export-import-config.h:14
massSpectrumPtrMetaTypeId
int massSpectrumPtrMetaTypeId
Definition
massspectrum.cpp:52
massSpectrumMetaTypeId
int massSpectrumMetaTypeId
Definition
massspectrum.cpp:51
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(pappso::MassSpectrum)
mzrange.h
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
pappso::operator<<
QDataStream & operator<<(QDataStream &outstream, const MassSpectrum &massSpectrum)
Definition
massspectrum.cpp:339
pappso::operator>>
QDataStream & operator>>(QDataStream &instream, MassSpectrum &massSpectrum)
Definition
massspectrum.cpp:353
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition
types.h:60
pappso::MassSpectrumCstSPtr
std::shared_ptr< const MassSpectrum > MassSpectrumCstSPtr
Definition
massspectrum.h:54
pappso::PrecisionPtr
const PrecisionBase * PrecisionPtr
Definition
precision.h:122
pappso::MassSpectrumSPtr
std::shared_ptr< MassSpectrum > MassSpectrumSPtr
Definition
massspectrum.h:53
pappso::DataPoint
Definition
datapoint.h:22
trace.h
pappsomspp
core
massspectrum
massspectrum.h
Generated on
for libpappsomspp by
1.17.0