Skip to content

APB Catalog

APB Catalog finds a field of an APB2 result by what it means, so a consumer never names vendor columns such as MaxQuant's PEP, Spectronaut's EG_PEP or DIA-NN's Q_Value.

from pathlib import Path

from apb2.api import read_parsed_levels
from apb_catalog.api import DataCatalog

result = read_parsed_levels(Path("diann.h5mu"))   # any APB2 result
pep = DataCatalog(result, "confidence_alpha").levels["peptidoform_ion"].layers.get("pep")

pep is a numpy matrix, runs × ions as AnnData's layers, or None when the vendor reports no PEP; layers.name("pep") names the vendor's column.

With pandas, on the MuData or AnnData object APB2 wrote, the same keys return AnnData's own matrices and pandas Series: from apb_catalog.api_pandas import DataCatalog, then DataCatalog(mdata, "confidence_alpha"); see pandas.

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
Page For
Get started Install, then get the data by key with Polars or pandas, and the prefixes
Sets Every set: its vocabulary, which software has which field
Python API Every call, answer, table and command
Maintaining APB2 rule changes, new sets, the checks
Contributing Extend a set, or create your own

Set or rule role?

APB2 rules can mark a column with a semantic role such as abundance_alpha or protein_assignment; the role policy owns that vocabulary.

Meaning Lives in
Needed by several tools, or defined by APB2 itself A role in the rule
Needed by one consumer or an external standard A set
More detail about a role, such as an abundance layer's normalization A set that qualifies the role

How it stays correct

  • An entry holds for the software versions it was reviewed against: the software name and version pattern each level's stored rule declares
  • A set holds what downstream applications read; a new APB2 level, layer or column gets entries once an application reads it
  • Tests fail when an entry names a field its rule no longer keeps; APB2's own tests cover what it converts
  • APB2's parse rules are read only when the catalog is written; at runtime it reads its own tables
  • Lookups never transform values; the consumer reads the field it is handed
  • A snapshot of every lookup can be stored in the result, readable without this package