OpenMS
Loading...
Searching...
No Matches
openms/include/OpenMS/INTERFACES/ISpectrumAccess.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, Witold Wolski $
7// --------------------------------------------------------------------------
8
9#pragma once
10
12
13#include <vector>
14#include <string>
15#include <memory>
16
17namespace OpenMS
18{
19namespace Interfaces
20{
21
25 class OPENMS_DLLAPI ISpectraReader
26 {
27public:
28 virtual ~ISpectraReader() {}
30 virtual SpectrumPtr getSpectrumById(int id) const = 0;
32 virtual SpectrumPtr getSpectrumById(const std::string& id) const = 0;
34 virtual std::vector<std::size_t> getSpectraByRT(double RT, double deltaRT) const = 0;
36 virtual size_t getNrSpectra() const = 0;
38 virtual SpectrumMetaPtr getSpectrumMetaById(int id) const = 0;
39
40 /*
41 * Do we need an Iterator here?
42 * We would have to provide our own iterator wrapper class because we don't
43 * know whether all the spectra are loaded at any given timepoint
44 typedef SpectrumPtr const ConstSpectraIterator;
45 ConstSpectraIterator beginSpectra() const;
46 ConstSpectraIterator endSpectra() const;
47 */
48 };
49 typedef std::shared_ptr<ISpectraReader> SpectraReaderPtr;
50
51
55 class OPENMS_DLLAPI IChromatogramsReader
56 {
57public:
60 virtual ChromatogramPtr getChromatogramById(int id) const = 0;
62 virtual ChromatogramPtr getChromatogramById(const std::string& id) const = 0;
64 virtual std::vector<std::size_t> getChromatogramByPrecursorMZ(double mz, double deltaMZ) const = 0;
66 virtual std::size_t getNrChromatograms() const = 0;
69
70 /*
71 * Do we need an Iterator here?
72 * We would have to provide our own iterator wrapper class because we don't
73 * know whether all the chromatograms are loaded at any given timepoint
74 ConstChromatogramIterator beginChromatograms() const;
75 ConstChromatogramIterator endChromatograms() const;
76 */
77 };
78 typedef std::shared_ptr<IChromatogramsReader> ChromatogramsReaderPtr;
79
80
81 class OPENMS_DLLAPI ISpectraWriter
82 {
83public:
84 virtual ~ISpectraWriter() {}
86 virtual void appendSpectrum(SpectrumPtr spectrum, bool write_through=false) = 0;
88 virtual void flush() = 0;
89 };
90 typedef std::shared_ptr<ISpectraWriter> SpectraWriterPtr;
91
92
93 class OPENMS_DLLAPI IChromatogramsWriter
94 {
95public:
98 virtual void appendChromatogram(ChromatogramPtr chromatogram, bool write_through=false) = 0;
100 virtual void flush() = 0;
101 };
102 typedef std::shared_ptr<IChromatogramsWriter> ChromatogramsWriterPtr;
103
104} //end namespace Interfaces
105} //end namespace OpenMS
The interface of read-access to a list of chromatograms.
Definition openms/include/OpenMS/INTERFACES/ISpectrumAccess.h:56
virtual std::vector< std::size_t > getChromatogramByPrecursorMZ(double mz, double deltaMZ) const =0
Return a vector of ids of chromatograms that are within mz +/- deltaMz.
virtual ~IChromatogramsReader()
Definition openms/include/OpenMS/INTERFACES/ISpectrumAccess.h:58
virtual ChromatogramMetaPtr getChromatogramMetaById(int id) const =0
Returns the meta information for a chromatogram.
virtual std::size_t getNrChromatograms() const =0
Returns the number of chromatograms available.
virtual ChromatogramPtr getChromatogramById(int id) const =0
Return a pointer to a chromatogram at the given id.
virtual ChromatogramPtr getChromatogramById(const std::string &id) const =0
Return a pointer to a chromatogram at the given string id.
Definition openms/include/OpenMS/INTERFACES/ISpectrumAccess.h:94
virtual void appendChromatogram(ChromatogramPtr chromatogram, bool write_through=false)=0
Append a chromatogram to the end.
virtual void flush()=0
write all cached data to disk
virtual ~IChromatogramsWriter()
Definition openms/include/OpenMS/INTERFACES/ISpectrumAccess.h:96
The interface of read-access to a list of spectra.
Definition openms/include/OpenMS/INTERFACES/ISpectrumAccess.h:26
virtual std::vector< std::size_t > getSpectraByRT(double RT, double deltaRT) const =0
Return a vector of ids of spectra that are within RT +/- deltaRT.
virtual ~ISpectraReader()
Definition openms/include/OpenMS/INTERFACES/ISpectrumAccess.h:28
virtual size_t getNrSpectra() const =0
Returns the number of spectra available.
virtual SpectrumPtr getSpectrumById(int id) const =0
Return a pointer to a spectrum at the given id.
virtual SpectrumPtr getSpectrumById(const std::string &id) const =0
Return a pointer to a spectrum at the given string id.
virtual SpectrumMetaPtr getSpectrumMetaById(int id) const =0
Returns the meta information for a spectrum.
Definition openms/include/OpenMS/INTERFACES/ISpectrumAccess.h:82
virtual ~ISpectraWriter()
Definition openms/include/OpenMS/INTERFACES/ISpectrumAccess.h:84
virtual void flush()=0
write all cached data to disk
virtual void appendSpectrum(SpectrumPtr spectrum, bool write_through=false)=0
Append a spectrum to the end.
std::shared_ptr< Chromatogram > ChromatogramPtr
Definition openms/include/OpenMS/INTERFACES/DataStructures.h:130
std::shared_ptr< IChromatogramsWriter > ChromatogramsWriterPtr
Definition openms/include/OpenMS/INTERFACES/ISpectrumAccess.h:102
std::shared_ptr< ISpectraReader > SpectraReaderPtr
Definition openms/include/OpenMS/INTERFACES/ISpectrumAccess.h:49
std::shared_ptr< IChromatogramsReader > ChromatogramsReaderPtr
Definition openms/include/OpenMS/INTERFACES/ISpectrumAccess.h:78
std::shared_ptr< ChromatogramMeta > ChromatogramMetaPtr
Definition openms/include/OpenMS/INTERFACES/DataStructures.h:73
std::shared_ptr< Spectrum > SpectrumPtr
Definition openms/include/OpenMS/INTERFACES/DataStructures.h:210
std::shared_ptr< SpectrumMeta > SpectrumMetaPtr
Definition openms/include/OpenMS/INTERFACES/DataStructures.h:153
std::shared_ptr< ISpectraWriter > SpectraWriterPtr
Definition openms/include/OpenMS/INTERFACES/ISpectrumAccess.h:90
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19