Skip to content

APB Export

APB2 results exported as the AnnData, MuData, CSV, Perseus and QPX files downstream tools open: one export rule per target, one subcommand per target.

APB2 converts the vendor output; apb-export applies the target's packaged export rule and writes the format that tool reads. HDF5 files get APB2's <file>.apb.json sidecar; QPX Parquet tables have an export manifest. Field meanings come from apb-catalog, never from vendor column names.

Try it online:

  • Rules viewer: every vendor table's parse rules, as apb2 packages them
  • Catalog viewer: every catalog set with its entries and coverage
  • APB Studio: APB's corpus runs over the test vendor files
  • APB Export: convert a vendor table for a downstream tool in the browser

Targets

Target File APB2 levels Opened with
msmu .h5mu peptidoform_ion msmu.read_h5mu
MSstats .csv peptidoform_ion MSstats::dataProcess
Perseus .txt protein Perseus, or perseuspy.pd.read_perseus
prolfqua .h5ad peptidoform_ion, or peptide for MaxQuant prolfquapp's LFQData_from_anndata
ProteoPy .h5ad protein ProteoPy
ProteoPy, ions .h5ad peptidoform_ion ProteoPy
exploreDE .h5ads directory, one .h5ad per level protein, peptide, peptidoform_ion, those present exploreDE::exploreDE() on each file
AlphaPeptTools .h5mu peptidoform_ion, peptide, protein mulink_from_anndatas
QFeatures .h5mu peptidoform_ion, peptide, protein MuData::readH5MU, then QFeatures
QPX .qpx directory peptidoform_ion and/or protein unchanged pMultiQC --qpx-plugin

Targets and layouts describes what each file holds.

Quick start

apb-export msmu report.tsv result.h5mu --params report.log.txt
apb-export msmu report.tsv result.h5mu --params report.log.txt --fasta proteins.fasta
apb-export prolfqua report.tsv result.h5ad --params report.log.txt --annotation dataset.csv
apb-export msstats report.tsv msstats.csv --params report.log.txt --annotation design.tsv
apb-export perseus report.tsv perseus.txt --params report.log.txt --annotation samples.tsv
apb-export proteopy report.tsv proteins.h5ad --params report.log.txt
apb-export alphapepttools report.tsv linked.h5mu --params report.log.txt
apb-export qfeatures report.tsv qfeatures.h5mu --params report.log.txt
apb-export qpx report.tsv result.qpx --params report.log.txt

msmu then runs unchanged on the result:

import msmu as mm

mdata = mm.read_h5mu("result.h5mu")
mdata = mm.pp.add_filter(mdata, modality="psm", column="q_value", keep="lt", value=0.01)
mdata = mm.pp.apply_filter(mdata, modality="psm", on="var")
mdata = mm.pp.to_peptide(mdata, calculate_q=False)

From Python

APB2 converts and Exporter exports, the shape of the other APB tools:

from pathlib import Path

from apb2.api import ParseRuleCompiler
from apb_export.api import Exporter

exporter = Exporter("msmu")
parsed = ParseRuleCompiler.detect(
    Path("report.tsv"), Path("report.log.txt"), requested_levels=exporter.levels
).compile().parse()
exporter.write(exporter.export(parsed), Path("result.h5mu"))

write uses APB2's writer for HDF5, .h5ads included, and target-specific serializers for QPX, the .csv long table and the .txt Perseus table. Stored APB results work through apb2.api.read_parsed_levels and the same exporter API. Exporter.targets() lists the packaged targets; extension names the suffix or .qpx or .h5ads directory.

Install

apb-export is not on PyPI yet. Install from a checkout with its sibling packages beside it, as CI checks them out:

git clone https://github.com/anndata-omics-bridge/apb2.git
git clone https://github.com/anndata-omics-bridge/apb-catalog.git
git clone https://github.com/anndata-omics-bridge/apb-fasta.git
git clone https://github.com/anndata-omics-bridge/protein-fasta.git protein_fasta
git clone https://github.com/anndata-omics-bridge/prozor.git
git clone https://github.com/anndata-omics-bridge/apb-export.git
cd apb-export
uv sync --group dev
make check

uv tool install --editable . puts apb-export on PATH. The separate APB Export UI owns the web application and its locked environment.

Testing

Tests use synthetic vendor files only and install none of the target tools. The Consumers workflow exports the synthetic examples, validates the QPX ones with qpx and the released pMultiQC, and checks that msmu, ProteoPy, AlphaPeptTools, QFeatures, MSstats and perseuspy read them, msmu against its own read_diann and ProteoPy's ion file against its own DIA-NN reader. prolfquapp's check, in prolfquapp's own image, compares its APB reader with its own preprocess_DIANN.