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

Stateful value and primary-key validator for QPX Arrow tables. More...

#include <OpenMS/FORMAT/QPXValueValidation.h>

Collaboration diagram for QPXValueValidation:
[legend]

Classes

struct  Result
 Result of validating one table or streaming batch. More...
 

Public Types

enum class  View { PSM , FEATURE , PROTEIN_GROUP }
 QPX table whose value contract is checked. More...
 

Public Member Functions

 QPXValueValidation (View view)
 Construct a validator for one QPX view.
 
 ~QPXValueValidation ()
 
 QPXValueValidation (QPXValueValidation &&) noexcept
 
QPXValueValidation & operator= (QPXValueValidation &&) noexcept
 
 QPXValueValidation (const QPXValueValidation &)=delete
 
QPXValueValidation & operator= (const QPXValueValidation &)=delete
 
Result validate (const std::shared_ptr< arrow::Table > &table)
 Validate one whole table or the next streaming batch.
 
void reset ()
 Forget primary keys accumulated from earlier validate() calls.
 

Private Attributes

std::unique_ptr< Impl > impl_
 

Detailed Description

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.

Experimental classes:
This API is experimental and may change in future versions.

Member Enumeration Documentation

◆ View

enum class View
strong

QPX table whose value contract is checked.

Enumerator
PSM 
FEATURE 
PROTEIN_GROUP 

Constructor & Destructor Documentation

◆ QPXValueValidation() [1/3]

QPXValueValidation ( View  view)
explicit

Construct a validator for one QPX view.

Parameters
[in]viewView whose schema, values, and primary key are checked

◆ ~QPXValueValidation()

◆ QPXValueValidation() [2/3]

◆ QPXValueValidation() [3/3]

QPXValueValidation ( const QPXValueValidation &  )
delete

Member Function Documentation

◆ operator=() [1/2]

QPXValueValidation & operator= ( const QPXValueValidation &  )
delete

◆ operator=() [2/2]

QPXValueValidation & operator= ( QPXValueValidation &&  )
noexcept

◆ reset()

void reset ( )

Forget primary keys accumulated from earlier validate() calls.

◆ validate()

Result validate ( const std::shared_ptr< arrow::Table > &  table)

Validate one whole table or the next streaming batch.

Checks the exact OpenMS QPX schema, physical nulls in required columns, non-empty identity-bearing primary-key values, primary-key uniqueness, canonical quantitative labels, and view-specific nested invariants. For pg data this includes non-empty, duplicate-free grouped_runs and run-disjointness within one (anchor_protein, label).

State is advanced only when the complete table is valid, so a rejected batch can be fixed and submitted again without first calling reset().

Parameters
[in]tableTable or streaming batch to validate
Returns
Structured validation result; valid is false if writing must be refused

Member Data Documentation

◆ impl_

std::unique_ptr<Impl> impl_
private