OpenMS
Loading...
Searching...
No Matches
SpectrumAccessOnDisc.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: Julianus Pfeuffer $
6// $Authors: Julianus Pfeuffer $
7// --------------------------------------------------------------------------
8
9#pragma once
10
13
14#include <memory>
15#include <vector>
16
17namespace OpenMS
18{
44 class OPENMS_DLLAPI SpectrumAccessOnDisc :
46 {
47 public:
53 explicit SpectrumAccessOnDisc(std::shared_ptr<IMSExperimentRandomAccess> experiment);
54
63 SpectrumAccessOnDisc(std::shared_ptr<IMSExperimentRandomAccess> experiment, std::vector<Size> indices);
64
67
70
72 std::shared_ptr<OpenSwath::ISpectrumAccess> lightClone() const override;
73
76
79
87 std::vector<std::size_t> getSpectraByRT(double RT, double deltaRT) const override;
88
90 size_t getNrSpectra() const override;
91
94
96 size_t getNrChromatograms() const override;
97
99 std::string getChromatogramNativeID(int id) const override;
100
103
106
107 private:
108 struct View
109 {
110 std::vector<Size> indices;
111 std::vector<double> rts;
112 };
113 std::shared_ptr<IMSExperimentRandomAccess> experiment_;
114 std::shared_ptr<const View> view_;
115 };
116} // namespace OpenMS
Random access to the spectra and chromatograms of an MS run that stays on disk.
Definition IMSExperimentRandomAccess.h:37
OpenSwath::ISpectrumAccess on an on-disc experiment (e.g. OnDiscThermoRawExperiment or OnDiscMSExperi...
Definition SpectrumAccessOnDisc.h:46
std::shared_ptr< OpenSwath::ISpectrumAccess > lightClone() const override
A copy that can be used from another thread (see the copy constructor)
size_t getNrSpectra() const override
Number of visible spectra.
~SpectrumAccessOnDisc() override
Destructor.
Size getExperimentIndex(int id) const
Index in the experiment of visible spectrum id.
SpectrumAccessOnDisc(std::shared_ptr< IMSExperimentRandomAccess > experiment, std::vector< Size > indices)
Expose only the spectra of experiment with the given indices.
std::vector< Size > indices
experiment index of each visible spectrum
Definition SpectrumAccessOnDisc.h:110
std::shared_ptr< const View > view_
Definition SpectrumAccessOnDisc.h:114
std::vector< double > rts
and its retention time (ascending)
Definition SpectrumAccessOnDisc.h:111
SpectrumAccessOnDisc(std::shared_ptr< IMSExperimentRandomAccess > experiment)
Expose all spectra of experiment.
size_t getNrChromatograms() const override
Number of chromatograms of the experiment.
SpectrumAccessOnDisc(const SpectrumAccessOnDisc &rhs)
Copy constructor; clones the experiment (new file handle) and shares the index and subset.
OpenSwath::ChromatogramPtr getChromatogramById(int id) override
Chromatogram id of the experiment.
OpenSwath::SpectrumPtr getSpectrumById(int id) override
Peaks and data arrays of visible spectrum id (float and integer arrays, named after the array)
std::string getChromatogramNativeID(int id) const override
Native ID of chromatogram id.
std::vector< std::size_t > getSpectraByRT(double RT, double deltaRT) const override
Visible spectra with RT in [RT - deltaRT, RT + deltaRT].
std::shared_ptr< IMSExperimentRandomAccess > experiment_
Definition SpectrumAccessOnDisc.h:113
OpenSwath::SpectrumMeta getSpectrumMetaById(int id) const override
Retention time and MS level of visible spectrum id.
const IMSExperimentRandomAccess & getExperiment() const
The experiment this accessor reads from.
Definition SpectrumAccessOnDisc.h:109
The interface of a mass spectrometry experiment.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:30
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
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