Targets and layouts
Each target's layout is declared in its export rule, not coded. One engine checks every source before it builds anything.
Export rules
Rules follow APB2's rule schema read in reverse:
name: the target's fieldsource: an APB field every vendor shares: the run key ({"axis": "obs_key"}), the primary layer, or a catalogued meaning named by its slot and one of the set's keys,{"catalog": <set>, "layers" | "var" | "obs": <key>}. APB's own columns come from apb-catalog'sapbset, such as{"catalog": "apb_alpha", "var": "peptidoform_ion"}forProForma_ionor keyprotein_assignmentfor the column a rule marks with that role, so no rule names an APB column. apb-fasta's columns come fromfasta_peptides_alpha(its peptide verification) andfasta_proteins_alpha(its protein annotation), such as{"catalog": "fasta_proteins_alpha", "var": "fasta_gene_names"}; a set whose app orapb2 annotatehas not run on the result answers nothing, so an optional entry is left out and a required one stops the export with apb-catalog's message saying what to runfallback: what to read, in order, where the result lacks thesource; the export logs a warning naming the source it read. prolfqua's intensity falls back to the primary layer where the abundance set names no intensity without normalization"from_level": "protein"on a catalogued layer or var source: read through each variable's protein group, named whole or by its leading protein; a cell takes its group's value in its run; a var column's value, the group's, repeats in every runbasein a table: what every level shares; a level adds its own entries tocolumns.obs,columns.var,measurements.layersanduns, and an entry with a base entry's name replaces it where it standsrequired: an entry or layer the result must hold;"required": falseleaves it out, or writesfill_valuesoftwareon a level block: the vendor that block is for.h5adrules: list their levels in order and write the first one the result's software and levels allow.csvrules: choose their level as.h5adrules do and write it as a long table: one row per run and feature that some layer holds, obs columns, var columns and one column per layer, category codes written as the labels the parsing rule declares, missing asNA, no sidecar.txtrules: choose their level as.h5adrules do and write it as a Perseus table, described belowtransformon a layer:log2, applied aftermissing_values; a value that is not positive becomes missinghow: "layer_minimum"withlayer: an exported layer's lowest value per feature across runshow: "short_name": per row, the first input holding a value, cut to its first group member and, fordb|ACC|NAME, toNAME; inputs the result lacks, such as FASTA columns without--fasta, are passed over;appendfollows after_renameon anall_valuesentry: annotation columns whose name matches apatternare written as text, categories sorted, underre.sub(pattern, replacement, name), the first matching rename winning;identifierlower-cases that name and turns every character outsidea-z0-9_into_name_by_keyon a layer: the layer's name perabundance_alphakey of the layer it resolved to, or perqualifier=valuepair of its entry, such as{"aggregation=maxlfq": "LFQ intensity", "ibaq": "iBAQ"}; the first label the layer matches wins, and a layer matching none keepsname
The published JSON Schemas describe the documents. make format lays the rules out: an object on one line where it fits in 100 columns, else one item per line.
HDF5 target files are written by APB2's write_parsed_levels, .apb.json sidecar included:
- each key stays a column and names its index, a String key as written
- var names carry no level prefix
- several levels share one observation axis; MaxQuant's experiments are aligned onto its raw files when each experiment is one raw file
- a rule's
unsentries are written beside APB'suns["apb"] - a rule's
feature_linksbecome one directed relation in the MuData'svarp, under the link's name: a nonzero (u, v), 1.0, maps feature u to the target level's feature v, as mulink reads it
| Target | Rule | File | APB2 levels | Layout |
|---|---|---|---|---|
| msmu | v0_4 | .h5mu |
peptidoform_ion | psm modality, precursors by runs, experimental |
| MSstats | v4_20 | .csv |
peptidoform_ion | long table, one row per precursor and run, MSstats' column names |
| Perseus | v2 | .txt |
protein | wide, proteinGroups.txt's names, #!{Type} and #!{C:…} header rows |
| prolfquapp | v2_11 | .h5ad |
peptidoform_ion, or peptide for MaxQuant; reads protein | wide; uns["prolfquapp"] for LFQData_from_anndata |
| ProteoPy | v0_1 | .h5ad |
protein | wide; sample_id and protein_id beside their indexes |
| ProteoPy, ions | v0_1 | .h5ad |
peptidoform_ion | wide; sample_id, peptide_id (the ion's ProForma) and protein_id |
| exploreDE | v1_0 | .h5ads directory |
protein, peptide, peptidoform_ion, those present | exploreDE/1.0 without differential expression, one file per level the result holds: protein.h5ad, peptide.h5ad, precursor.h5ad; log2 intensities with vendor zeros missing, linear intensities_raw, X a copy of intensities; SDRF factor value[…] and prolfquapp group/bait columns become factor_<name> with sorted categories, other annotation columns pass unprefixed; feature_id is the protein group, or <protein>_<peptide> and <protein>_<ProForma ion>; label_gene_symbol is the leading protein's FASTA gene name, else its entry name or accession, with the peptide or precursor appended; uns holds exploreDE's identity keys and empty de, enrichment and enrichment_support |
| AlphaPeptTools | v0_4 | .h5mu |
peptidoform_ion, peptide, protein | one wide modality per level, linked by id columns |
| QFeatures | v1_22 | .h5mu |
peptidoform_ion, peptide, protein | AlphaPeptTools' layout; assays linked by addAssayLink on id columns |
| QPX | v1_1 | .qpx directory |
peptidoform_ion and/or protein | QPX 1.1 Parquet tables, metadata and export manifest |
QPX
apb-export qpx report.tsv result.qpx --params report.log.txt
multiqc --qpx-plugin result.qpx -o report
- Existing primary precursor quantities become
apb.feature.parquet; existing primary protein quantities becomeapb.pg.parquet. Either level suffices; no quantities are aggregated or inferred - Feature quantities use nested
intensities; protein quantities use flatlabel,intensity, andgrouped_runs, as pMultiQC 0.0.48 reads. Identifiers are opaque integers per table; complete protein-group membership is retained even when distinct groups share a leading protein - Missing measurements produce no quantity row; measured zeroes remain zero. Float32 intensities follow QPX 1.1; infinite or overflowing values are refused
rtis read only through APB Catalog'schromatographyset, keyretention_time, with original unitsminuteorsecond. Minutes become seconds; missing RT remains null. An unknown unit is an unresolved catalogue answer, so the exporter never assumes one- Unknown spectral values remain typed nulls; unknown scan references and peptide-count lists are empty lists. No spectral measurements or peptide counts are fabricated
apb.run.parquetandapb.sample.parquetprovide technical identities keyed by run, with optional supplied observation annotations. QPX requires organism and tissue strings, so missing values use the explicit markernot available; no organism or grouping column is required from the userexport.jsonrecords versions, source mappings and table sizes. HDF5 targets continue to use APB2's sidecar; the QPX directory has its own manifest- The schema snapshot comes from qpx 1.1.6, with its Apache-2.0 license included. pMultiQC's QPX reader does not provide organism-based feature grouping
Report generation belongs to the apb-pmultiqc application. pMultiQC PR #751, merged on 29 October 2026, fixes upstream RT plots for missing/all-null RT; until a release contains it, the released reader (0.0.48) can log a plot exception for such valid inputs. Consumer checks require populated reports and no plot errors.
msmu
msmu's psm modality, written wide. Experimental: msmu's own readers write one feature per run and precursor, and msmu's tools may expect that.
- One
psmmodality; runs are observations, precursors are features, id<ProForma precursor>; the keysfilenameandprecursorstay columns and name the indices X: dense float32, the chosen abundance layer; APB2's primary layer by default; a precursor absent from a run is NaNlayers:q_value, the library or experiment-wide q-value repeated in every run where the vendor reports one, else each run's; each run'sPEP, where the vendor reports itvar:proteins,peptide,stripped_peptide,charge,peptide_length,decoy,contaminant, andPEPandq_valuewhere reported, each the precursor's lowest value across runs in the layer of that name (how: "layer_minimum")uns:apb_export_status: "experimental", msmu's reader settings plus APB metadata;uns["apb"]holds the result's root records and theexportrecord- Features without a protein: left out and counted in the export record, since msmu's protein inference would group them as one unnamed protein
peptide is ProForma for every vendor (AC[UNIMOD:4]K). msmu's modification parser reads it, and to_ptm takes the tag as written, for example "[UNIMOD:21]".
MSstats
apb-export msstats report.tsv msstats.csv --params report.log.txt --annotation design.tsv
input <- read.csv("msstats.csv")
processed <- MSstats::dataProcess(input)
- One row per precursor and run that some layer holds; MSstats reads the columns by name, so their order does not matter
Run: the run key;ConditionandBioReplicate: from the sample annotation, through apb-catalog: a prolfquapp-style table'sgroup…(orbait…,Experiment…) andBioReplicate…(orsubject…) columns, an SDRF'sfactor value[…]andcharacteristics[biological replicate]. Without them the export stopsProteinName: the protein group;PeptideSequence: the ProForma peptidoform, modifications included;PrecursorCharge: the ion's charge;PrecursorId: the ProForma ion, the table's feature keyFragmentIon,ProductCharge:NA, as MSstatsConvert writes precursor-level input;IsotopeLabelType:LIntensity: theabundancecatalog's intensity without normalization, since MSstats normalizes itself, else APB2's primary layer; zeros written asNA;--abundancenames another layerDetectionQValue,PEP: run-level identification q-value and PEP where the tool reports them; no global or library q-values, and no rows are filtered- Features without a protein: left out and counted in the export record
Perseus
apb-export perseus txt perseus.txt --params mqpar.xml --annotation samples.tsv
Perseus: Generic matrix upload, or read with perseuspy.pd.read_perseus("perseus.txt").
- One row per protein group; names as MaxQuant's
proteinGroups.txt, so Perseus' usual steps run without renaming Protein IDs: the protein group;Gene names: with--fasta;Q-value: the group's experiment-wide, else library, q-value, where reportedReverse,Potential contaminant:+or empty, from APB2's decoy and contaminant flags, contaminants also from the FASTA check<prefix> <sample>: APB2's primary layer, or--abundance's; prefix by itsabundancekey:LFQ intensityfor MaxLFQ,iBAQfor iBAQ, elseIntensity; zeros and missing values written asNaN#!{Type}: sample columnsE(main), numbersN, flagsC, textT#!{C:<column>}: one categorical row per annotation column, values under the sample columns- No sidecar
prolfquapp
- Intensity (
X): theabundancecatalogue's intensity without normalization, since prolfquapp normalizes itself, such as DIA-NN'sPrecursor_Quantity; APB2's primary layer where the catalogue has none or cannot pick one;--abundancenames another layer - Factors:
apb2 annotatecolumns, from--annotation - Confidence layers, each where the vendor reports it:
qValue(precursor, per run),pg_qValue(protein group, per run),pg_qValue_experiment(protein group, library or experiment-wide, the same in every run),pep - Features without a protein: left out and counted in the export record
- With
--fasta: the leading protein'sfasta.id,description,IDcolumn,gene_name,protein_lengthandnr_tryptic_peptides, as prolfquapp's FASTA annotation writes them - Without a FASTA:
fasta.id,descriptionandIDcolumnrepeatprotein_Id
ProteoPy and AlphaPeptTools
- ProteoPy:
sample_idandprotein_idname the indices and stay columns - ProteoPy with
--fasta: apb-fasta annotates the protein groups and addsin_fasta,gene_id,descriptionandfasta_organisms - ProteoPy ions (
proteopy_ion): ProteoPy's peptide data, keyed on the ion as ProteoPy's own DIA-NN reader is ataggr_level="Precursor.Id";protein_idis the one accession of the ion'sfasta_accessionscolumn, and an ion naming several proteins is left out and counted in the export's provenance, as that reader leaves it out. apb-export rolls nothing up; ProteoPy's own functions roll ions up to peptides or proteins. With--fasta, apb-fasta annotates the ion level by the same column and adds the same four columns - AlphaPeptTools: peptidoform_ion and peptide modalities carry
contaminant; with--fastaalsoin_fasta,fasta_proteinsandfasta_organisms - AlphaPeptTools on MaxQuant: runs named by raw file; with fractions, several raw files per experiment, only precursors are written and the export record lists the other levels as skipped
- Neither tool reads these FASTA columns; they are kept for inspection
QFeatures
The modalities precursors, peptides (where the vendor reports a peptide level) and proteins become QFeatures assays. Each finer assay links to the next coarser one on that one's key: sequence for peptides, proteins for protein groups. MaxQuant peptides name their protein group when proteinGroups.txt is converted with them.
MuData reads the file from GitHub (BiocManager::install("ilia-kats/MuData")) until a Bioconductor release carries MuData#11.
library(QFeatures)
mae <- MuData::readH5MU("qfeatures.h5mu")
# as(x, "SummarizedExperiment") drops the rowData; X arrives unnamed; categorical columns as factors
as_assay <- function(x) {
features <- rowData(x)
for (column in names(features)) {
if (is.factor(features[[column]])) features[[column]] <- as.character(features[[column]])
}
SummarizedExperiment(assays = list(intensity = assay(x)), rowData = features)
}
# Annotations sit in each modality's colData; the MuData's own colData is empty
qf <- QFeatures(lapply(experiments(mae), as_assay), colData = colData(mae[[1]]))
qf <- addAssayLink(qf, from = "precursors", to = "peptides", varFrom = "sequence", varTo = "sequence")
qf <- addAssayLink(qf, from = "peptides", to = "proteins", varFrom = "proteins", varTo = "proteins")
qf <- aggregateFeatures(qf, "precursors", fcol = "proteins", name = "aggregated", fun = colSums, na.rm = TRUE)
Without a peptide level, as for DIA-NN, link precursors to proteins on proteins. The Consumers workflow runs check_qfeatures.R on a DIA-NN and a MaxQuant example.
Plugin targets
An installed package adds a target without changing apb-export: it names a package holding the target's export rule under the apb_export.targets entry-point group.
[project.entry-points."apb_export.targets"]
toy = "toy_plugin.export_rule"
- Layout:
<package>/<version>/rules.json, one version per target, the same schema as the packaged documents Exporter.targets()lists the target andExporter("toy")applies it; a target named like a packaged one, or by two plugins, is refused- Command:
apb-export toy DATA OUTPUTwith--params,--software,--fasta,--sdrfand--strict; no--abundance, so the rule's primary layers become X - Rule features no packaged target uses yet:
obssources naming SDRF or annotation columns, andfeature_links - The web app offers only the packaged targets it describes
Confidence, by meaning
q_value: library q-value (var) when it holds a nonzero value, else experiment-wide (var), else per run; the first two repeat in every run; the order msmu's DIA-NN reader usesPEP: the vendor's posterior error probability- Lookup: apb-catalog's
confidenceandproteobench_entrapmentcatalogues - Not reported: no
q_valuecolumn, so msmu's filter cannot act on an invented value;PEPis NaN, because msmu'sto_peptiderequires the column - Unreviewed rule: apb-catalog answers "unknown" and the command stops; unknown is not missing
Protein groups
Written as msmu's readers write them:
- Members split on
; - Accession taken from a UniProt
db|ACC|NAMEentry - Members spelled
contam_,Cont_orCON__respelledCont_ACC contaminant: set when apb2 markedapb_Contaminant, the software flags or adds the contaminant, or apb-fasta matched a FASTA contaminant
--fasta runs that FASTA check after conversion; without a FASTA only the vendor's own flags are known.
Limits
- A result without the level a target reads is refused: msmu needs an
peptidoform_ionlevel (Sage'slfq.tsvis peptide-level), ProteoPy aproteinlevel, ProteoPy ions apeptidoform_ionlevel - Label-free only: a result keyed by more than one observation column, as multiplexed designs are, is refused
decoyis apb2'sapb_Decoy; most exports carry no decoys, so use msmu'scalculate_q=Falseunless the vendor kept them- Group separators other than
;pass through unchanged - Retention time is mapped to QPX
rtthrough the chromatography catalogue; HDF5 targets do not map it - msmu's file has no per-run
filenamecolumn: msmu tools that group features by file see precursors, not identifications