libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
massspectrumid.cpp
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#include <limits>
26
27
28#include "massspectrumid.h"
29
30namespace pappso
31{
32
33
37
38
40 : mcsp_msRunId(msRunId)
41{
42}
43
44
46 std::size_t spectrum_index)
47 : mcsp_msRunId(msRunId), m_nativeId(""), m_spectrumIndex(spectrum_index)
48{
49}
50
51
58
59
63
64
67{
68 if(&other == this)
69 return *this;
70
73 m_nativeId = other.m_nativeId;
74
75 return *this;
76}
77
78
79void
85
86
87const MsRunIdCstSPtr &
92
93
94void
95MassSpectrumId::setNativeId(const QString &native_id)
96{
97 m_nativeId = native_id;
98}
99
100
101const QString &
103{
104 return m_nativeId;
105}
106
107
108void
110{
111 m_spectrumIndex = index;
112}
113
114
115std::size_t
120
121
122bool
124{
125 return (mcsp_msRunId == other.mcsp_msRunId &&
127}
128
129bool
131{
132 return mcsp_msRunId->isValid() &&
133 m_spectrumIndex != std::numeric_limits<std::size_t>::max();
134}
135
136
137QString
139{
140 return QString(
141 "ms run id: %1 \n"
142 "native id: %2 \n"
143 "m_spectrumIndex: %3\n")
144 .arg(mcsp_msRunId != nullptr ? mcsp_msRunId->toString() : "nullptr")
145 .arg(m_nativeId)
146 .arg(m_spectrumIndex);
147}
148
149} // namespace pappso
void setNativeId(const QString &native_id)
void setMsRunId(MsRunIdCstSPtr other)
MassSpectrumId & operator=(const MassSpectrumId &other)
std::size_t getSpectrumIndex() const
void setSpectrumIndex(std::size_t index)
const QString & getNativeId() const
bool operator==(const MassSpectrumId &other) const
MsRunIdCstSPtr mcsp_msRunId
const MsRunIdCstSPtr & getMsRunIdCstSPtr() const
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
std::shared_ptr< const MsRunId > MsRunIdCstSPtr
Definition msrunid.h:46