OpenMS
Loading...
Searching...
No Matches
QPXFile.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: Timo Sachsenberg $
6// $Authors: Timo Sachsenberg $
7// --------------------------------------------------------------------------
8
9#pragma once
10
11#include <OpenMS/config.h>
12
18
19#include <memory>
20#include <vector>
21
22// Forward declarations
23namespace arrow
24{
25 class Table;
26}
27
28namespace OpenMS
29{
30
42class OPENMS_DLLAPI QPXFile
43{
44public:
52 static std::shared_ptr<arrow::Table> exportToArrow(
53 const std::vector<ProteinIdentification>& protein_identifications,
54 const PeptideIdentificationList& peptide_identifications,
55 bool export_all_psms = false);
56
69 static std::shared_ptr<arrow::Table> exportPSMsToQPXArrow(
70 const std::vector<ProteinIdentification>& protein_identifications,
71 const PeptideIdentificationList& peptide_identifications,
72 bool export_all_psms = false);
73
84 static bool exportToParquet(
85 const std::vector<ProteinIdentification>& protein_identifications,
86 const PeptideIdentificationList& peptide_identifications,
87 const std::string& filename,
88 bool export_all_psms = false,
89 const ParquetWriteConfig& config = ParquetWriteConfig{});
90
108 static bool exportToParquet(
109 const std::shared_ptr<arrow::Table>& table,
110 const std::string& filename,
111 const ParquetWriteConfig& config = ParquetWriteConfig{},
112 const std::string& scan_format = "");
113
147 const std::vector<ProteinIdentification>& protein_identifications,
148 const std::vector<const PeptideIdentification*>& peptide_identification_ptrs,
149 const std::string& filename,
150 bool export_all_psms = false,
151 size_t batch_size = 1000000,
152 const ParquetWriteConfig& config = ParquetWriteConfig{},
153 int n_threads = 1);
154
172 const std::vector<ProteinIdentification>& protein_identifications,
173 const PeptideIdentificationList& peptide_identifications);
174
187 const std::vector<ProteinIdentification>& protein_identifications,
188 const std::vector<const PeptideIdentification*>& peptide_identifications);
189
204 static bool importFromArrow(
205 const std::shared_ptr<arrow::Table>& table,
206 std::vector<ProteinIdentification>& protein_identifications,
207 PeptideIdentificationList& peptide_identifications);
208};
209
210} // namespace OpenMS
Container for peptide identifications from multiple spectra.
Definition PeptideIdentificationList.h:66
Export PSM (Peptide Spectrum Match) data to Apache Arrow format following QPX PSM schema.
Definition QPXFile.h:43
static std::shared_ptr< arrow::Table > exportToArrow(const std::vector< ProteinIdentification > &protein_identifications, const PeptideIdentificationList &peptide_identifications, bool export_all_psms=false)
Export PSMs to Arrow table using PSMSchema for lossless round-trips.
static bool exportToParquet(const std::vector< ProteinIdentification > &protein_identifications, const PeptideIdentificationList &peptide_identifications, const std::string &filename, bool export_all_psms=false, const ParquetWriteConfig &config=ParquetWriteConfig{})
Export PSM data to Parquet file.
static bool exportToParquetStreaming(const std::vector< ProteinIdentification > &protein_identifications, const std::vector< const PeptideIdentification * > &peptide_identification_ptrs, const std::string &filename, bool export_all_psms=false, size_t batch_size=1000000, const ParquetWriteConfig &config=ParquetWriteConfig{}, int n_threads=1)
Stream PSMs to a QPX Parquet file in row-batches to cap peak memory.
static bool exportToParquet(const std::shared_ptr< arrow::Table > &table, const std::string &filename, const ParquetWriteConfig &config=ParquetWriteConfig{}, const std::string &scan_format="")
Write a pre-built QPX PSM Arrow table to a Parquet file.
static void requireResolvableMergeIndices(const std::vector< ProteinIdentification > &protein_identifications, const std::vector< const PeptideIdentification * > &peptide_identifications)
Pointer-based overload of requireResolvableMergeIndices()
static bool importFromArrow(const std::shared_ptr< arrow::Table > &table, std::vector< ProteinIdentification > &protein_identifications, PeptideIdentificationList &peptide_identifications)
Import PSMs from a PSMSchema Arrow table.
static std::shared_ptr< arrow::Table > exportPSMsToQPXArrow(const std::vector< ProteinIdentification > &protein_identifications, const PeptideIdentificationList &peptide_identifications, bool export_all_psms=false)
Export PSMs to QPX Parquet eXchange format Arrow table (QPXPSMSchema).
static void requireResolvableMergeIndices(const std::vector< ProteinIdentification > &protein_identifications, const PeptideIdentificationList &peptide_identifications)
Refuse PSMs of a merged run that carry no usable id_merge_index.
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Definition ArrowIOHelpers.h:24
Configuration for Parquet file writing.
Definition MSExperimentArrowExport.h:136