npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@anndata-omics-bridge/apb-catalog

v0.2.0

Published

apb-catalog's API in TypeScript: look up APB result fields by meaning in the browser

Readme

@anndata-omics-bridge/apb-catalog

apb-catalog's API in TypeScript: look up the fields of an APB result by meaning, such as a PEP or an unnormalized intensity, in the browser, without naming vendor columns.

Documentation: anndata-omics-bridge.github.io/apb-catalog-ts, with Get started and the API.

Catalog viewer: fgcz-ms.uzh.ch/public/apb-catalog, every set with its entries, requirements and coverage, in the browser, built on this package.

Contributing: the sets can be extended to suit your application, and you are welcome to create your own; see Contributing.

New API. This package is new, and its API may still change between releases. Feedback is very welcome: open an issue with what you need, what surprised you, or what broke.

APB

The AnnData Proteomics Bridge, apb2, converts the reports of proteomics quantification software into one result layout. Declarative parse rules describe each vendor table, so one parser reads them all.

  • Software: AlphaDIA, DIA-NN, FragPipe, MaxQuant, PEAKS, Sage, Spectronaut and more
  • Levels: peptidoform ion, peptidoform, peptide, protein, peptidoform fragment
  • Per level: one AnnData, runs as obs, features as var, measurements as layers
  • Formats: h5ad, h5mu, Parquet, DuckDB

Columns keep the vendor's names: the posterior error probability is PEP in MaxQuant and DIA-NN, EG_PEP in Spectronaut.

apb-catalog

apb-catalog records what those columns mean, in reviewed sets. A consumer asks a set for a kind, such as pep or intensity, and gets the column.

| Set | Fields | | --- | --- | | abundance_alpha | Intensities, and whether the software normalizes them across runs | | confidence_alpha | PEP and q-values per run and per feature | | proteobench_entrapment_alpha | Precursor q-values for ProteoBench's entrapment scoring | | apb_alpha | Fields apb2 convert writes for every vendor: ProForma identifiers, decoy and contaminant flags | | obs_annotation_alpha | Each run's group and subject, from an SDRF or a prolfquapp table | | fasta_peptides_alpha | apb-fasta's peptide verification, once apb-fasta verify-peptides has run | | fasta_proteins_alpha | apb-fasta's protein annotation, once apb-fasta merge-annotations has run | | chromatography_alpha | Retention times, peak bounds and widths, with their unit |

A lookup answers one of three ways:

  • One field: the column, or its data
  • Software does not report it: null
  • Several fields: an UnresolvedField error, never a silent choice

This package

This is apb-catalog's Python API in TypeScript, with the same classes and methods as Python's apb-catalog and R's apbCatalogR. It is built for web apps that plot from APB results in the browser. Snapshots are not ported, as in apbCatalogR.

| Call | Answers | | --- | --- | | Bundle.load(url) | The catalog bundle, from the URL of its manifest.json | | new Catalog(bundle, software, software_version, set_name) | From the rules alone, without data: levels, each slot holding names | | await read_parsed_levels(url) | One result, as R's read_parsed_levels(): levels with AnnData's slots by the vendor's own names, such as the whole var() | | new DataCatalog(bundle, result, sets) | On that result, the named sets alone: levels with AnnData's slots looked up by key, returning the data | | sets(bundle), rule_coverage(bundle, set_name), catalog_table(bundle) | The sets, how each rule covers a set, every entry as a table |

Two things differ from Python and R, because a browser fetches everything over HTTP:

  • The bundle is not shipped with the package: the app serves it next to the data, and Bundle.load fetches it once
  • read_parsed_levels reads a result's provenance JSON, the Parquet result's manifest.json, alone. Lookups read only that JSON; a data call fetches only the Parquet file it needs, by HTTP range request, once.

It does not convert vendor files. Convert with apb2, as Parquet:

apb2 convert DATA --params PARAMETER_FILE --format parquet --output result   # writes result.parquet

Install

npm install @anndata-omics-bridge/apb-catalog

Use

Ask the rules which column a software version reports:

import { Bundle, Catalog, DataCatalog } from '@anndata-omics-bridge/apb-catalog'

const bundle = await Bundle.load('catalog/apb-catalog-bundle/manifest.json')
const ion = new Catalog(bundle, 'DIA-NN', '2.2.0', 'abundance_alpha').levels.get('peptidoform_ion')
ion?.layers.keys()
// ['intensity', 'intensity_ms1', 'intensity_norm_settings', 'intensity_ms1_norm_settings']
ion?.layers.get('intensity')
// 'Precursor_Quantity'
ion?.layers.get('maxlfq')
// null: DIA-NN 2.2.0 reports no MaxLFQ for precursors

Get the data of a result:

const result = await read_parsed_levels('results/result.parquet/manifest.json')
const catalog = new DataCatalog(bundle, result, ['confidence_alpha'])
const level = catalog.levels.get('peptidoform_ion')
const pep = await level?.layers.get('pep')
// { runs: string[], features: string[], values: Float64Array[] }, one array per run; null when absent
level?.layers.name('pep')
// 'PEP', the field get reads; throws where get gives null

Each slot, layers, var and obs, answers as Python's does, with get in place of [...]:

  • A name is a key first, then the level's own field of that name; get gives null when it is neither
  • A prefix makes the lookup exact: 'c:q_value' asks the confidence set alone, 'v:q_value' the level's own field alone; sets(bundle) lists each set's prefix
  • get(key, { unit: 'minute' }) narrows a key by a qualifier it leaves open
  • keys() and has(key) know keys only
  • var.select(keys) and obs.select(keys) read every column the keys name, as var[[...]] does
  • var also reads varm tables; such a field is named table/column
  • A var or obs column is one array: a Float64Array for numbers, otherwise strings or booleans
  • X() is the primary layer, and obs_names() and var_names() the run and feature names
  • A lookup throws UnresolvedField at once when the catalog cannot decide; data arrives as a promise

The bundle

apb-catalog builds two bundles at each release:

  • Bundle: the reviewed sets and the levels apb2 converts for each software version; lookups read only this
  • Test bundle: synthetic results, with apb-catalog's answers on them; the tests check that TypeScript gives the same answers

How an app gets the latest bundle:

  • Download apb-catalog-bundle.tar.gz from the latest apb-catalog release and serve its folder with the data; a browser cannot download it from GitHub itself
  • A newer catalog needs only new files on the server, no new package version
  • A bundle of a newer format than the package reads is refused with "update @anndata-omics-bridge/apb-catalog"

The file server must answer HTTP range requests.

Development

npm ci
make check     # type check and every test

The tests read both bundles from APB_CATALOG_BUILD, by default ../apb-catalog/build (make bundle in apb-catalog).