OpenMS
Loading...
Searching...
No Matches
IMSExperimentRandomAccess.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
14#include <OpenMS/OpenMSConfig.h>
15
16#include <memory>
17
18namespace OpenMS
19{
20 class ExperimentalSettings;
21
36 class OPENMS_DLLAPI IMSExperimentRandomAccess
37 {
38 public:
40
42 virtual Size getNrSpectra() const = 0;
43
45 virtual Size getNrChromatograms() const = 0;
46
48 Size size() const
49 {
50 return getNrSpectra();
51 }
52
54 bool empty() const
55 {
56 return getNrSpectra() == 0;
57 }
58
65 virtual MSSpectrum getSpectrum(Size index) = 0;
66
73
83
85 virtual double getSpectrumRT(Size index) const = 0;
86
88 virtual UInt getSpectrumMSLevel(Size index) const = 0;
89
91 virtual bool isSortedByRT() const = 0;
92
101 virtual Size findFirstRT(double rt) const;
102
109
111 virtual std::shared_ptr<const ExperimentalSettings> getExperimentalSettings() const = 0;
112
118 virtual std::unique_ptr<IMSExperimentRandomAccess> clone() const = 0;
119
120 protected:
124 };
125} // namespace OpenMS
Random access to the spectra and chromatograms of an MS run that stays on disk.
Definition IMSExperimentRandomAccess.h:37
virtual MSSpectrum getSpectrumMetadata(Size index)=0
The spectrum with index index without peaks and data arrays.
virtual std::unique_ptr< IMSExperimentRandomAccess > clone() const =0
A new instance on the same data with its own file handle (for another thread).
virtual MSSpectrum getSpectrumPeaks(Size index)
Peaks and data arrays of spectrum index; other metadata may be missing.
IMSExperimentRandomAccess & operator=(const IMSExperimentRandomAccess &)=default
IMSExperimentRandomAccess(const IMSExperimentRandomAccess &)=default
virtual double getSpectrumRT(Size index) const =0
Retention time (in seconds) of spectrum index, from the index.
bool empty() const
True if there are no spectra.
Definition IMSExperimentRandomAccess.h:54
virtual MSSpectrum getSpectrum(Size index)=0
The spectrum with index index, including peaks and metadata.
virtual Size getNrSpectra() const =0
Number of spectra.
virtual Size findFirstRT(double rt) const
Index of the first spectrum with retention time >= rt.
virtual std::shared_ptr< const ExperimentalSettings > getExperimentalSettings() const =0
Run-level metadata (instrument, source files, sample, ...)
virtual UInt getSpectrumMSLevel(Size index) const =0
MS level of spectrum index, from the index.
virtual MSChromatogram getChromatogram(Size index)=0
The chromatogram with index index.
Size size() const
Alias for getNrSpectra()
Definition IMSExperimentRandomAccess.h:48
virtual Size getNrChromatograms() const =0
Number of chromatograms.
virtual bool isSortedByRT() const =0
True if the spectra are sorted by ascending retention time.
The representation of a chromatogram.
Definition MSChromatogram.h:34
The representation of a 1D spectrum.
Definition MSSpectrum.h:45
unsigned int UInt
Unsigned integer type.
Definition Types.h:64
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