libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
massspectrumid.h
Go to the documentation of this file.
1
/*******************************************************************************
2
* Copyright (c) 2015 Olivier Langella <Olivier.Langella@moulon.inra.fr>.
3
*
4
* This file is part of the PAPPSOms++ library.
5
*
6
* PAPPSOms++ is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
10
*
11
* PAPPSOms++ is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
18
*
19
* Contributors:
20
* Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and
21
*implementation
22
******************************************************************************/
23
24
25
#pragma once
26
27
#include <cstddef>
28
#include <limits>
29
30
#include <QString>
31
32
#include "
pappsomspp/export-import-config.h
"
33
34
#include "
pappsomspp/core/msrun/msrunid.h
"
35
36
37
namespace
pappso
38
{
39
40
class
PMSPP_LIB_DECL
MassSpectrumId
41
{
42
public
:
43
MassSpectrumId
();
44
45
MassSpectrumId
(
const
MsRunIdCstSPtr
&msrun_id);
46
47
MassSpectrumId
(
const
MsRunIdCstSPtr
&msrun_id, std::size_t spectrum_index);
48
49
MassSpectrumId
(
const
MassSpectrumId
&other);
50
~MassSpectrumId
();
51
52
MassSpectrumId
&
operator=
(
const
MassSpectrumId
&other);
53
54
void
setMsRunId
(
MsRunIdCstSPtr
other);
55
const
MsRunIdCstSPtr
&
getMsRunIdCstSPtr
()
const
;
56
57
void
setNativeId
(
const
QString &native_id);
58
const
QString &
getNativeId
()
const
;
59
60
/** @brief try to find scan id in the native id string
61
* @param is_ok true if scan number is found
62
* @return integer of the scan number
63
*/
64
std::size_t
extractScanNumberFromNativeId
(
bool
*is_ok)
const
;
65
66
void
setSpectrumIndex
(std::size_t index);
67
std::size_t
getSpectrumIndex
()
const
;
68
69
bool
operator==
(
const
MassSpectrumId
&other)
const
;
70
71
bool
isValid
()
const
;
72
73
QString
toString
()
const
;
74
75
private
:
76
MsRunIdCstSPtr
mcsp_msRunId
=
nullptr
;
77
78
// This is the native id string that is stored in the mzML file. Its structure
79
// is dependent on the vendor/format of the original data. In some cases, it
80
// is possible to ask libpwiz to extract from it the scan number of the
81
// spectrum. For water/mdsciex files, this is not possible. We thus need to
82
// rely on the index of the spectrum in the spectrum list for the ms run of
83
// interest. By combining the run id and the spectrum index, it is possible to
84
// unambiguously identify a mass spectrum from a given file.
85
QString
m_nativeId
;
86
87
// The index of the mass spectrum in the spectrum list of a given ms run is
88
// used when the scan number is not easily usable (see the native id comment
89
// above).
90
std::size_t
m_spectrumIndex
= std::numeric_limits<std::size_t>::max();
91
};
92
93
94
}
// namespace pappso
pappso::MassSpectrumId::setNativeId
void setNativeId(const QString &native_id)
Definition
massspectrumid.cpp:92
pappso::MassSpectrumId::setMsRunId
void setMsRunId(MsRunIdCstSPtr other)
Definition
massspectrumid.cpp:77
pappso::MassSpectrumId::operator=
MassSpectrumId & operator=(const MassSpectrumId &other)
Definition
massspectrumid.cpp:63
pappso::MassSpectrumId::MassSpectrumId
MassSpectrumId()
Definition
massspectrumid.cpp:33
pappso::MassSpectrumId::toString
QString toString() const
Definition
massspectrumid.cpp:133
pappso::MassSpectrumId::getSpectrumIndex
std::size_t getSpectrumIndex() const
Definition
massspectrumid.cpp:113
pappso::MassSpectrumId::setSpectrumIndex
void setSpectrumIndex(std::size_t index)
Definition
massspectrumid.cpp:106
pappso::MassSpectrumId::getNativeId
const QString & getNativeId() const
Definition
massspectrumid.cpp:99
pappso::MassSpectrumId::extractScanNumberFromNativeId
std::size_t extractScanNumberFromNativeId(bool *is_ok) const
try to find scan id in the native id string
Definition
massspectrumid.cpp:145
pappso::MassSpectrumId::m_spectrumIndex
std::size_t m_spectrumIndex
Definition
massspectrumid.h:90
pappso::MassSpectrumId::isValid
bool isValid() const
Definition
massspectrumid.cpp:126
pappso::MassSpectrumId::operator==
bool operator==(const MassSpectrumId &other) const
Definition
massspectrumid.cpp:120
pappso::MassSpectrumId::mcsp_msRunId
MsRunIdCstSPtr mcsp_msRunId
Definition
massspectrumid.h:76
pappso::MassSpectrumId::m_nativeId
QString m_nativeId
Definition
massspectrumid.h:85
pappso::MassSpectrumId::getMsRunIdCstSPtr
const MsRunIdCstSPtr & getMsRunIdCstSPtr() const
Definition
massspectrumid.cpp:85
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition
export-import-config.h:14
msrunid.h
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
pappso::MsRunIdCstSPtr
std::shared_ptr< const MsRunId > MsRunIdCstSPtr
Definition
msrunid.h:46
pappsomspp
core
massspectrum
massspectrumid.h
Generated on
for libpappsomspp by
1.17.0