11#include <OpenMS/config.h>
21#include <unordered_set>
28 class KeyValueMetadata;
35class MetaInfoInterface;
36namespace MS1LabelState {
struct Keys; }
47namespace ArrowIOHelpers
81 const std::shared_ptr<arrow::Table>& table,
82 const std::string& filename,
101 const std::vector<std::shared_ptr<arrow::Table>>& tables,
102 const std::string& filename,
104 const std::shared_ptr<const arrow::KeyValueMetadata>& metadata =
nullptr);
133 const std::string& file_type,
135 const std::map<std::string, std::string>& extra = {});
155 OPENMS_DLLAPI std::string
qpxScanFormat(
const std::vector<std::string>& native_ids);
226 const std::string& resolved_run_file,
243 const std::string& context,
244 const std::vector<std::string>& ms_run_paths);
270 const std::string& column_label,
271 const std::string& channel_name);
333 const std::shared_ptr<arrow::Table>& table,
334 const std::string& name,
335 bool required =
true);
339 const std::shared_ptr<arrow::Array>& array,
344 const std::shared_ptr<arrow::Array>& array,
346 double default_val = 0.0);
350 const std::shared_ptr<arrow::Array>& array,
352 float default_val = 0.0f);
356 const std::shared_ptr<arrow::Array>& array,
358 int32_t default_val = 0);
362 const std::shared_ptr<arrow::Array>& array,
364 int64_t default_val = 0);
368 const std::shared_ptr<arrow::Array>& array,
370 bool default_val =
false);
374 const std::shared_ptr<arrow::Array>& array,
384 const std::shared_ptr<arrow::Array>& array,
387 const std::unordered_set<std::string>& excluded_keys = {});
A container for consensus elements.
Definition ConsensusMap.h:67
unsigned int UInt
Unsigned integer type.
Definition Types.h:64
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
std::string qpxPsmRunFileName(const MetaInfoInterface &hit, const MetaInfoInterface &identification, const std::string &resolved_run_file, const QPXRunFileNameKeys &keys)
The QPX run_file_name the psm view writes for one identification and hit.
int32_t getInt32Value(const std::shared_ptr< arrow::Array > &array, int64_t row, int32_t default_val=0)
Read an int32 at row, or default_val if null.
bool writeTableToParquet(const std::shared_ptr< arrow::Table > &table, const std::string &filename, const ParquetWriteConfig &config=ParquetWriteConfig{})
Write an Arrow table to a Parquet file.
int64_t getInt64Value(const std::shared_ptr< arrow::Array > &array, int64_t row, int64_t default_val=0)
Read an int64 at row, or default_val if null.
bool getBoolValue(const std::shared_ptr< arrow::Array > &array, int64_t row, bool default_val=false)
Read a bool at row, or default_val if null.
std::vector< Int32 > qpxScanComponents(const std::string &spectrum_reference)
The QPX scan column value for one spectrum reference.
float getFloatValue(const std::shared_ptr< arrow::Array > &array, int64_t row, float default_val=0.0f)
Read a float at row, or default_val if null.
std::vector< std::pair< std::string, std::string > > qpxCvParams(const MetaInfoInterface &hit)
The meta values of an identification that QPX carries as cv_params.
double getDoubleValue(const std::shared_ptr< arrow::Array > &array, int64_t row, double default_val=0.0)
Read a double at row, or default_val if null.
std::string generateUuidV4()
Generate a lowercase hyphenated RFC 4122 version-4 UUID string.
void readMetaValues(const std::shared_ptr< arrow::Array > &array, int64_t row, MetaInfoInterface &target, const std::unordered_set< std::string > &excluded_keys={})
Read metavalues from a list<struct{name,value,value_type}> column.
std::shared_ptr< arrow::Array > getColumn(const std::shared_ptr< arrow::Table > &table, const std::string &name, bool required=true)
Fetch a named column from a table, combining chunks if needed.
std::string qpxIntensityLabel(const std::string &column_label, const std::string &channel_name)
QPX intensities[].label for a ConsensusMap column header.
std::string qpxRunFileName(const std::string &ms_run_path)
Reduce an MS run path to the QPX run_file_name form.
std::string getStringValue(const std::shared_ptr< arrow::Array > &array, int64_t row)
Read a string at row, or "" if null/out-of-bounds.
bool qpxIsCanonicalIntensityLabel(const std::string &label)
Test whether a string is in the canonical SDRF/QPX intensity-label vocabulary.
std::string qpxScanFormat(const std::string &native_id)
Classify a spectrum native ID into a QPX scan_format token.
bool concatenateAndWriteToParquet(const std::vector< std::shared_ptr< arrow::Table > > &tables, const std::string &filename, const ParquetWriteConfig &config=ParquetWriteConfig{}, const std::shared_ptr< const arrow::KeyValueMetadata > &metadata=nullptr)
Concatenate a vector of Arrow tables and write the result to a Parquet file.
std::shared_ptr< const arrow::KeyValueMetadata > qpxFileMetadata(const std::string &file_type, const ParquetWriteConfig &config=ParquetWriteConfig{}, const std::map< std::string, std::string > &extra={})
Build the canonical QPX file-level key-value metadata.
bool qpxWarnOnRunNameCollisions(const std::string &context, const std::vector< std::string > &ms_run_paths)
Warn once per export about source files that collapse onto one run_file_name.
bool isNull(const std::shared_ptr< arrow::Array > &array, int64_t row)
Whether array is null at row (or unset)
Size tableRowCount(const std::shared_ptr< arrow::Table > &table)
Number of rows in an Arrow table, or 0 when it is null.
std::map< std::uint64_t, std::string > qpxIntensityLabels(const ConsensusMap &cmap)
Derive canonical QPX intensity labels for every ConsensusMap column.
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Definition ArrowIOHelpers.h:26
MetaInfo indices qpxPsmRunFileName() consults, resolved once.
Definition ArrowIOHelpers.h:195
QPXRunFileNameKeys()
Resolve the keys against the current registry.
UInt run_file_name
Index of run_file_name, or UInt(-1) when it is not registered.
Definition ArrowIOHelpers.h:201
UInt reference_file_name
Index of reference_file_name, or UInt(-1) when it is not registered.
Definition ArrowIOHelpers.h:199
The registry indices of the three keys, resolved once for a loop over many hits.
Definition MS1LabelState.h:65
Configuration for Parquet file writing.
Definition MSExperimentArrowExport.h:136