OpenMS
Loading...
Searching...
No Matches
SpectrumAccessOpenMSInMemory.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Hannes Roest $
6// $Authors: Hannes Roest $
7// --------------------------------------------------------------------------
8
9#pragma once
10
15
17
18#include <memory>
19
20namespace OpenMS
21{
45 class OPENMS_DLLAPI SpectrumAccessOpenMSInMemory :
47 {
48public:
52
65
68
79
89 std::shared_ptr<OpenSwath::ISpectrumAccess> lightClone() const override;
90
99
108
122 std::vector<std::size_t> getSpectraByRT(double RT, double deltaRT) const override;
123
125 size_t getNrSpectra() const override;
126
136
138 size_t getNrChromatograms() const override;
139
148 std::string getChromatogramNativeID(int id) const override;
149
150private:
151
152 std::vector< OpenSwath::SpectrumPtr > spectra_;
153 std::vector< OpenSwath::SpectrumMeta > spectra_meta_;
154
155 std::vector< OpenSwath::ChromatogramPtr > chromatograms_;
156 std::vector< std::string > chromatogram_ids_;
157
158 };
159
160} //end namespace OpenMS
161
The representation of a chromatogram.
Definition MSChromatogram.h:30
In-Memory representation of a mass spectrometry run.
Definition MSExperiment.h:49
The representation of a 1D spectrum.
Definition MSSpectrum.h:44
OpenSwath::ISpectrumAccess implementation that holds the complete spectrum / chromatogram payload in ...
Definition SpectrumAccessOpenMSInMemory.h:47
std::shared_ptr< OpenSwath::ISpectrumAccess > lightClone() const override
Return a clone of this accessor as a new OpenSwath::ISpectrumAccess.
OpenMS::PeakMap MSExperimentType
Definition SpectrumAccessOpenMSInMemory.h:49
size_t getNrSpectra() const override
Number of spectra cached in memory.
~SpectrumAccessOpenMSInMemory() override
Destructor.
OpenMS::MSSpectrum MSSpectrumType
Definition SpectrumAccessOpenMSInMemory.h:50
SpectrumAccessOpenMSInMemory(const SpectrumAccessOpenMSInMemory &rhs)
Copy constructor (light copy).
size_t getNrChromatograms() const override
Number of chromatograms cached in memory.
OpenMS::MSChromatogram MSChromatogramType
Definition SpectrumAccessOpenMSInMemory.h:51
std::vector< OpenSwath::ChromatogramPtr > chromatograms_
Chromatogram payloads captured at construction; shared with light clones.
Definition SpectrumAccessOpenMSInMemory.h:155
OpenSwath::ChromatogramPtr getChromatogramById(int id) override
Look up one chromatogram by index.
std::vector< std::string > chromatogram_ids_
Parallel chromatogram native-id cache keyed on the same index.
Definition SpectrumAccessOpenMSInMemory.h:156
std::vector< OpenSwath::SpectrumPtr > spectra_
Spectrum payloads captured at construction; shared with light clones.
Definition SpectrumAccessOpenMSInMemory.h:152
OpenSwath::SpectrumPtr getSpectrumById(int id) override
Look up one spectrum by index.
std::vector< OpenSwath::SpectrumMeta > spectra_meta_
Parallel metadata cache (native id, RT, MS level) keyed on the same index.
Definition SpectrumAccessOpenMSInMemory.h:153
std::string getChromatogramNativeID(int id) const override
Native id of one cached chromatogram.
std::vector< std::size_t > getSpectraByRT(double RT, double deltaRT) const override
Indices of cached spectra whose RT lies in [RT - deltaRT, RT + deltaRT].
SpectrumAccessOpenMSInMemory(OpenSwath::ISpectrumAccess &origin)
Construct by reading every spectrum and chromatogram from origin into memory.
OpenSwath::SpectrumMeta getSpectrumMetaById(int id) const override
Look up one spectrum's metadata by index.
The interface of a mass spectrometry experiment.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:30
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
std::shared_ptr< Chromatogram > ChromatogramPtr
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:153
std::shared_ptr< Spectrum > SpectrumPtr
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:291
Identifying information for a spectrum.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:157