OpenMS
Loading...
Searching...
No Matches
MSChromatogramParquetConsumer.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: Justin Sing $
6// $Authors: Justin Sing $
7// --------------------------------------------------------------------------
8
9#pragma once
10
13
14#include <memory>
15
16namespace OpenMS
17{
18 class MSChromatogramParquetConsumerImpl;
19
63 {
64 public:
73 MSChromatogramParquetConsumer(const std::string& filename,
74 UInt64 run_id,
75 const std::string& source_file,
76 const OpenSwath::LightTargetedExperiment& transition_exp);
77
80
82 void consumeSpectrum(SpectrumType& s) override;
85
91 class OPENMS_DLLAPI EncodedChromatograms
92 {
93 public:
98
100 Size size() const;
101
102 private:
104 struct Rows;
105 std::unique_ptr<Rows> rows_;
106 };
107
119 void encodeChromatogram(ChromatogramType& c, EncodedChromatograms& rows) const;
120
127 void consumeEncodedChromatograms(EncodedChromatograms& rows);
133 void finalize();
140 void setExpectedSize(Size expectedSpectra, Size expectedChromatograms) override;
146 void setExperimentalSettings(const ExperimentalSettings& exp) override;
147
148 private:
149 std::unique_ptr<MSChromatogramParquetConsumerImpl> impl_;
150 };
151} // namespace OpenMS
Description of the experimental settings.
Definition ExperimentalSettings.h:37
The interface of a consumer of spectra and chromatograms.
Definition IMSDataConsumer.h:46
Rows prepared by encodeChromatogram(), to be appended with consumeEncodedChromatograms().
Definition MSChromatogramParquetConsumer.h:92
EncodedChromatograms(EncodedChromatograms &&) noexcept
Writes chromatograms to a Parquet file with a PyProphet-compatible schema.
Definition MSChromatogramParquetConsumer.h:63
void consumeChromatogram(ChromatogramType &c) override
Consume a chromatogram and append it to the parquet output.
~MSChromatogramParquetConsumer() override
Destructor flushes pending data and closes the parquet writer.
void consumeSpectrum(SpectrumType &s) override
Consume a spectrum (no-op; spectra are ignored for chromatogram export).
MSChromatogramParquetConsumer(const std::string &filename, UInt64 run_id, const std::string &source_file, const OpenSwath::LightTargetedExperiment &transition_exp)
Construct a parquet consumer for chromatogram export.
The representation of a chromatogram.
Definition MSChromatogram.h:33
The representation of a 1D spectrum.
Definition MSSpectrum.h:44
uint64_t UInt64
Unsigned integer type (64bit)
Definition Types.h:47
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
STL namespace.
Definition TransitionExperiment.h:369