Stateful value and primary-key validator for QPX Arrow tables.
Arrow schema validation checks declarations such as field type and nullability. It does not reject an empty string in an identity-bearing key, physical nulls under a non-nullable field, duplicate primary keys, or invalid nested values. This class supplies those write-time checks for the OpenMS QPX psm, feature, and pg views. QPX-permitted unmapped features retain OpenMS' empty peptidoform representation and are still distinguished by their remaining key fields.
A validator retains primary keys between validate() calls. Streaming writers can therefore validate consecutive batches with one instance and detect duplicates that cross a batch boundary. Use reset() before starting a different output file.
The contract this class enforces
This is the single place the QPX input contract is written down; the tools that offer -out_qpx (ProteinQuantifier, ProteomicsLFQ, IsobaricWorkflow, ProSE) point here rather than restating it, so it cannot drift from the code. A table that violates it is refused outright: the export writes nothing, rather than emitting rows that will not join.
Consensus maps produced by ProteomicsLFQ and IsobaricWorkflow satisfy the contract by construction, and they are the supported producers. A map assembled by a different pipeline may not, and the requirements it can fail are:
- Every identification needs a scan. The
scan primary-key component is derived from the identification's spectrum reference. Identifications carrying none - protein-inference output, some ID converters, transferred (match-between-runs) identifications - cannot be exported.
- Every identification needs a resolvable origin file.
run_file_name is the key the psm view is joined to the feature and pg views on. Protein inference commonly drops the path; restore it with ProteinIdentification::setPrimaryMSRunPath() before exporting.
- Identifications must be unique per (peptidoform, charge, run, scan). IDMapper maps one MS2 identification onto every consensus feature whose RT/m-z window contains it, so the same identification can end up on two features. Resolve conflicts first, e.g. with IDConflictResolver.
- Every channel needs a QPX label. The vocabulary is label-free, the TMT and iTRAQ plexes, and SILAC 2-/3-plex. Those labels are join keys against the run sidecar, so OpenMS refuses rather than guesses one. Maps from FeatureFinderMultiplex carrying
ICPL*, Leu3, "label N" or no_label fall outside the vocabulary and cannot be exported.
Feature rows are keyed on (peptidoform, charge, run_file_name, rt, observed_mz). observed_mz is part of that key for the sake of unmapped features: QPX permits them, OpenMS writes them with an empty peptidoform, and rt is narrowed to float32 on write - so without the m/z two co-eluting unmapped features of one charge in one run would share a key and the export would be refused. Rows agreeing on all five are genuinely indistinguishable and are still refused.
- Experimental classes:
- This API is experimental and may change in future versions.