OpenMS
Loading...
Searching...
No Matches
XIPMParquetConsumer Class Reference

Writes targeted mz/RT/IM peak maps to a Parquet file (.xipm). More...

#include <OpenMS/FORMAT/DATAACCESS/XIPMParquetConsumer.h>

Collaboration diagram for XIPMParquetConsumer:
[legend]

Public Member Functions

 XIPMParquetConsumer (const std::string &filename, const OpenSwath::LightTargetedExperiment &transition_exp)
 Construct a parquet writer for targeted peak-map export.
 
 ~XIPMParquetConsumer ()
 Destructor flushes pending rows and closes the parquet writer.
 
void consumePeakMap (const PeakMapExtractor::ExtractedPeakMap &peak_map, UInt64 run_id, const std::string &source_file, Int64 ms_level)
 Consume one targeted peak map.
 
void finalize ()
 Finalize and write the parquet file.
 
void setExpectedSize (Size expectedPeakMaps)
 Reserve storage for the expected number of peak maps.
 

Private Attributes

std::unique_ptr< XIPMParquetConsumerImpl > impl_
 

Detailed Description

Writes targeted mz/RT/IM peak maps to a Parquet file (.xipm).

The schema includes run metadata, precursor/transition annotations, extraction window metadata, compressed mz/RT/ion mobility/intensity arrays, and compression flags.

The Parquet output has the following columns (one row per extracted peak map):

Column Type Description
RUN_ID int64 Run identifier
SOURCE_FILE string (nullable) Input source filename
MS_LEVEL int64 MS level (1 for precursor peak maps, 2 for fragment peak maps)
PEAKMAP_TYPE string Peak-map type (precursor or transition)
PRECURSOR_ID int64 (nullable) Precursor id
TRANSITION_ID int64 (nullable) Transition id
MODIFIED_SEQUENCE string (nullable) Modified peptide sequence
PRECURSOR_CHARGE int64 (nullable) Precursor charge
PRODUCT_CHARGE int64 (nullable) Product charge
DETECTING_TRANSITION int64 (nullable) Detecting transition flag
PRECURSOR_DECOY int64 (nullable) Precursor decoy flag
PRODUCT_DECOY int64 (nullable) Product decoy flag
TRANSITION_ORDINAL int64 (nullable) Transition ordinal
TRANSITION_TYPE string (nullable) Transition type (e.g. y, b)
ANNOTATION string (nullable) Transition annotation (e.g. y3^1) or precursor annotation
TARGET_MZ float64 Extraction target m/z
TARGET_RT float64 (nullable) Extraction target RT in the run coordinate system
TARGET_ION_MOBILITY float64 (nullable) Extraction target ion mobility
RT_START float64 (nullable) Extraction window start in RT
RT_END float64 (nullable) Extraction window end in RT
MZ_DATA binary Compressed mz array
RT_DATA binary Compressed RT array
MOBILITY_DATA binary Compressed ion mobility array
INTENSITY_DATA binary Compressed intensity array
MZ_COMPRESSION int64 m/z compression scheme id
RT_COMPRESSION int64 RT compression scheme id
MOBILITY_COMPRESSION int64 Ion mobility compression scheme id
INTENSITY_COMPRESSION int64 Intensity compression scheme id

Compression identifiers:

Column Value Description
MZ_COMPRESSION 0 No compression (raw doubles)
MZ_COMPRESSION 1 Zlib-compressed raw doubles
MZ_COMPRESSION 5 MSNumpress (linear) with lossy compression
RT_COMPRESSION 0 No compression (raw doubles)
RT_COMPRESSION 1 Zlib-compressed raw doubles
RT_COMPRESSION 5 MSNumpress (linear) with lossy compression
MOBILITY_COMPRESSION 0 No compression (raw doubles)
MOBILITY_COMPRESSION 1 Zlib-compressed raw doubles
MOBILITY_COMPRESSION 5 MSNumpress (linear) with lossy compression
INTENSITY_COMPRESSION 0 No compression (raw doubles)
INTENSITY_COMPRESSION 1 Zlib-compressed raw doubles
INTENSITY_COMPRESSION 6 MSNumpress (short logged float) with lossy compression

Constructor & Destructor Documentation

◆ XIPMParquetConsumer()

XIPMParquetConsumer ( const std::string &  filename,
const OpenSwath::LightTargetedExperiment transition_exp 
)

Construct a parquet writer for targeted peak-map export.

Parameters
[in]filenameOutput parquet filename
[in]transition_expTransition metadata used to annotate rows

◆ ~XIPMParquetConsumer()

Destructor flushes pending rows and closes the parquet writer.

Member Function Documentation

◆ consumePeakMap()

void consumePeakMap ( const PeakMapExtractor::ExtractedPeakMap peak_map,
UInt64  run_id,
const std::string &  source_file,
Int64  ms_level 
)

Consume one targeted peak map.

Parameters
[in]peak_mapExtracted peak map to append
[in]run_idRun identifier
[in]source_fileSource mzML / raw file name
[in]ms_levelMS level of the extraction (1 = precursor, 2 = fragment)

◆ finalize()

void finalize ( )

Finalize and write the parquet file.

◆ setExpectedSize()

void setExpectedSize ( Size  expectedPeakMaps)

Reserve storage for the expected number of peak maps.

Parameters
[in]expectedPeakMapsThe expected number of rows

Member Data Documentation

◆ impl_

std::unique_ptr<XIPMParquetConsumerImpl> impl_
private