APB metadata specification
APB2 defines where metadata lives, the record fields shared by producers, and the versions readers accept. Each producer owns its payload and computes the values that Studio displays. This result contract was adopted on 8 October 2026.
Placement: a root part and level parts, never merged
Every result has one root part and one part per level, in every format:
| Format | Root part | Level part |
|---|---|---|
| h5mu | mdata.uns["apb"] |
mdata.mod["peptidoform_ion"].uns["apb"] |
| h5ad | adata.uns["apb"] |
adata.uns["peptidoform_ion"]["apb"] |
| Parquet, DuckDB | collection apb |
per-level apb |
| JSON sidecar | root.apb |
levels[].apb |
Root and level parts are independent and may use the same key. In memory the root part combines parse (from ParsedLevels.uns), ParsedLevels.metadata and hierarchy when present. A level part combines parse (from ParsedLevel.uns), ParsedLevel.metadata and roles when it has semantic column or layer roles. Storage copies producer records as supplied.
APB2 reserves parse, roles, hierarchy and storage, plus annotation_tables and feature_relations at the h5mu root. Extension records use their own keys. In h5ad and h5mu, each uns["apb"] part carries a storage descriptor.
An h5ad holds one level. Its root descriptor gives the level name and the uns key for that part. Collection annotation tables and feature relations need a collection format. An h5mu stores each feature relation as a matrix in root varp, with a physical key recorded in the descriptor. Rows and columns follow the MuData var axis. A nonzero at (u, v) maps feature u to feature v.
Records
A producer writes at apb.<producer>. Producers with several named records use one additional key, as Catalog does at apb.catalog.<catalogue>. Each field is optional.
schema_versionidentifies the producer's payload version as textprovenancerecords versions, inputs and configurationresultholds the outputsummaryholds display metrics calculated by the producerdetailspoints to tables with per-feature evidence
Write each field to the part it describes. Studio displays the stored summaries directly.
Summary entries
Each entry has name, label, value, unit and status, plus an optional layer naming the logical quantity. Within a record, each (name, layer) pair must be unique. name is a nonempty string. label, unit and any supplied layer are strings.
statusisok,attentionornot_checkedvalueis a JSON scalar ornull. Usenullfornot_checkednullwithokorattentionmeans computed but undefined- Producers convert NaN and ±infinity to
nullbefore writing. The validator rejects nonfinite numbers - Store a checked zero as
0. A positive problem count has statusattention
Detail references
details lists {slot, name} pairs. Use a nonempty logical name in a level's varm or layers, or a collection's annotation_tables or feature_relations. Copies preserve these references even when the target table is absent.
Producers
| Key | Writer | Root record | Level record |
|---|---|---|---|
parse |
apb2 conversion | provenance, levels_without_features, observation grouping in result |
provenance, result, summary |
prolfquapp, sdrf |
apb2 annotation | schema_version, provenance.annotation |
result.annotation, summary |
fasta |
apb-fasta | schema_version, provenance per operation |
result, summary, details |
aggregate |
apb-aggregate | none | schema_version, provenance.lineage, summary, details |
proteobench |
apb-proteobench | schema_version, provenance |
result, summary, details |
catalog.<catalogue> |
apb-catalog | result: the resolution snapshot |
summary |
export |
apb-export | schema_version, provenance |
provenance, summary |
Generic annotation uses one mechanism for prolfquapp, SDRF and ProteoBench sample tables. The convention names the record. Sample annotations live in obs and feature-aligned tables in varm. Producers can reference feature-aligned tables through details. Annotation payload
Exports copy every upstream record unchanged and add their own export record, encoded with UnsJsonCodec in the same placement. A standalone export keys its level part by the name a MuData export would give that modality.
Conversion records
In the root parse record:
provenance.input_filesholds one record per input file, including each parameter file. The fields arerole,file_name(basename),size_bytes,sha256of the on-disk bytes,compressionandformat. Table inputs addnrows,ncolsandcolumnsprovenance.search_parameters.parametersholds the typed parameters when conversion reads a parameter file or a pair of fileslevels_without_featureslists levels omitted because they had no complete feature key- When conversion groups multiple observation identities,
resultrecordsobservation_keysandobservation_relationships. The relationships are stored as JSON text
Each level's parse.provenance records rule_json and plan_json, with input_preparation and sample_annotation_matching when applicable. Its result contains unknown_mod_tokens, layer_diagnostics, uninformative_fields and var_disagreements. The summary contains counts derived from these findings.
Storage and representation
Store the primary quantity in X and other matrices in adata.layers. The descriptor keeps the primary layer's logical name so a display can show Intensity · X. The declared primary layer determines matrix placement. Semantic roles describe the quantities.
UnsJsonCodec writes each uns["apb"] part. It stores empty lists and uniform lists of native strings, booleans, integers or floats as AnnData arrays. It writes other lists, integers outside the signed 64-bit range, strings containing NUL and mappings with invalid HDF5 link keys as JSON text. Invalid keys are empty, ., or contain / or NUL. Valid mappings stay native groups and invalid top-level section names raise an error. The descriptor's json_values lists encoded paths as arrays of key segments. Readers decode exactly these paths and reject a path list that does not match the decoded values.
export_uns holds native keys beside apb in uns. Vendor conversion leaves it empty. H5MU writes level keys into each modality and result keys into the MuData root. H5AD writes both sets into the same uns, so the sets must be disjoint and cannot use the level name. Validation reserves apb and rejects any value requiring JSON text. Each descriptor lists the export_uns keys to restore. Parquet and DuckDB keep them in their manifests. In the sidecar they appear at root.export_uns and levels[].export_uns.
Storage preserves unknown producer metadata as supplied. The sidecar derives a bounded view from the same persistence projections and keeps root.apb and levels[].apb separate. It lives beside the result file. Sidecar lifecycle and redaction
Versions
| Persisted component | Current version |
|---|---|
| HDF5 storage descriptor | 8 |
| Parquet manifest | 9 |
| DuckDB manifest | 8 |
| Representation document | 7 |
Update readers and writers together when a layout changes. Readers reject unsupported layouts and leave the original artifact intact. Producers version their payloads independently of result formats and parsing rules.
Enforcement
APB2 checks every record's summary and details when it writes or reads a result, without importing producers (records.py). Record tests, format tests and representation tests run through make check. Scientific payload and overwrite tests belong to the producing tools.