Scope guard that leaves no partial QPX collection behind.
requireExportable() cannot decide everything: a view can still refuse a row it only sees while building the table, and a write can fail on I/O. Either way the earlier files of the collection are already on disk, and a directory holding quantms.feature.parquet but no quantms.psm.parquet is indistinguishable from a complete export of a smaller dataset.
Construct this before the first write and call commit() once the last one has succeeded. On any other exit – a view returning false, a writer throwing, an early return – the destructor removes the collection files this export created, so the export is all-or-nothing. Enumerating the failure sites instead would silently miss the next one.
Files that already existed when the guard was constructed are never removed. Exporting into a directory that still holds an earlier collection is the normal way to re-run a pipeline, and a failed re-run must not take the previous result with it. Such a run does leave the directory mixed – the views that ran overwrote their files before the failure – so the destructor names the surviving files in its warning rather than pretending the directory is still coherent.
qpx.commit();
static bool exportToParquet(const ConsensusMap &cmap, const std::string &filename, const ParquetWriteConfig &config=ParquetWriteConfig{}, QPXIdentity::FeatureLinks *out_links=nullptr)
Export ConsensusMap to Parquet file.
static bool exportToParquet(const ConsensusMap &cmap, const ExperimentalDesign &design, const std::string &filename, const ParquetWriteConfig &config=ParquetWriteConfig{})
Export protein group data to Parquet file.
Scope guard that leaves no partial QPX collection behind.
Definition QPXCollectionExport.h:108
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{}, const QPXIdentity::FeatureLinks *feature_links=nullptr)
Export PSM data to Parquet file.
- Experimental classes:
- This API is experimental and may change in future versions.