![]() |
OpenMS
|
Writes Mobilograms (ion-mobility traces) to a Parquet file using a PyProphet-compatible-like schema. More...
#include <OpenMS/FORMAT/DATAACCESS/MobilogramParquetConsumer.h>
Public Member Functions | |
| MobilogramParquetConsumer (const String &filename, UInt64 run_id, const String &source_file, const OpenSwath::LightTargetedExperiment &transition_exp) | |
| Construct a parquet consumer for mobilogram export. | |
| ~MobilogramParquetConsumer () | |
| Destructor flushes pending data and closes the parquet writer. | |
| void | consumeMobilogram (const Mobilogram &m, const String &mobilogram_type="", Int64 ms_level=-1, Int64 transition_id=-1, const String &transition_native_id="", double feature_rt=std::numeric_limits< double >::quiet_NaN(), Int64 feature_id=-1) |
| Consume a mobilogram and write it to the parquet file. | |
| void | finalize () |
| Finalize and write the parquet file. Call to surface write errors. | |
| void | setExpectedSize (Size expectedMobilograms) |
| Reserve storage for expected number of mobilograms. | |
Private Attributes | |
| std::unique_ptr< MobilogramParquetConsumerImpl > | impl_ |
Writes Mobilograms (ion-mobility traces) to a Parquet file using a PyProphet-compatible-like schema.
| MobilogramParquetConsumer | ( | const String & | filename, |
| UInt64 | run_id, | ||
| const String & | source_file, | ||
| const OpenSwath::LightTargetedExperiment & | transition_exp | ||
| ) |
Construct a parquet consumer for mobilogram export.
| [in] | filename | Output parquet filename. |
| [in] | run_id | Run identifier to store with each mobilogram. |
| [in] | source_file | Source mzML filename to store with each mobilogram. |
| [in] | transition_exp | Optional transition experiment used to annotate mobilograms. Note: the signature takes a const reference, so a caller that does not want any transition annotations must pass an empty OpenSwath::LightTargetedExperiment (i.e. one with no compounds/transitions). A null pointer is not accepted. |
Destructor flushes pending data and closes the parquet writer.
| void consumeMobilogram | ( | const Mobilogram & | m, |
| const String & | mobilogram_type = "", |
||
| Int64 | ms_level = -1, |
||
| Int64 | transition_id = -1, |
||
| const String & | transition_native_id = "", |
||
| double | feature_rt = std::numeric_limits< double >::quiet_NaN(), |
||
| Int64 | feature_id = -1 |
||
| ) |
Consume a mobilogram and write it to the parquet file.
| [in] | m | The mobilogram to consume (read-only; the caller retains ownership and the mobilogram is not modified) |
| [in] | mobilogram_type | The type of the mobilogram (e.g. "precursor" or "fragment") |
| [in] | ms_level | The MS level of the mobilogram (e.g. 1 for precursor, 2 for fragment) |
| [in] | transition_id | The id of the corresponding transition in the transition experiment (nullable: -1 means not set) |
| [in] | transition_native_id | The native id of the corresponding transition in the transition experiment (nullable: empty string means not set) |
| [in] | feature_rt | Optional retention time apex that the mobilogram corresponds to (nullable: NaN means not set) |
| [in] | feature_id | Optional feature id associated with the mobilogram (nullable: -1 means not set) |
| void finalize | ( | ) |
Finalize and write the parquet file. Call to surface write errors.
| void setExpectedSize | ( | Size | expectedMobilograms | ) |
Reserve storage for expected number of mobilograms.
Must be called before any concurrent consumeMobilogram() calls (e.g. from an OpenMP parallel loop). Calling it after concurrent writes have started is undefined behaviour.
| [in] | expectedMobilograms | The expected number of mobilograms |
|
private |