Skip to content

API ​

Everything is imported from @anndata-omics-bridge/apb-catalog. Each call answers as its Python counterpart in apb-catalog's API does; Get started shows them on results.

Bundle ​

CallReturns
await Bundle.load(url)The catalog bundle, from the URL of its manifest.json; every file fetched once, revalidated with the server
bundle.versionThe bundle's version, such as '0.1.4'
bundle.csv(...path), bundle.json(...path)One file of the bundle, by its path in it, such as bundle.csv('data', 'versions.csv')

A bundle of another format than the package reads is refused: a newer one with "update @anndata-omics-bridge/apb-catalog".

Results ​

CallReturnsR
await read_parsed_levels(url)ParsedLevels, from the URL of the result's manifest.json; only that JSON is fetched; another Parquet format version is refusedread_parsed_levels(path)
result.levelsReadonlyMap<string, ParsedLevel>: one level per name, in the result's orderresult$levels
result.uns, result.metadatathe root parse record; the root post-parse records, such as sdrf or fastaresult$uns, result$metadata
Member of a ParsedLevelReturnsR
var(), obs()Promise<Map<string, Column>>: every column, in the result's order, the vendor's own includedlevel$var, level$obs
X()Promise<Layer>: the primary layerlevel$X
layers.keys(), layers.get(name)the other layers' names; Promise<Layer | null> by namelevel$layers
obs_names(), var_names()Promise<string[]>: the key columns, joined by |level$obs_names, level$var_names
uns{ apb }: the level's APB recordlevel$uns
  • In Python the result is the MuData or AnnData apb2 wrote: var() is adata.var
  • Not read yet: R's hierarchy, annotation_tables, feature_relations and varm; a DataCatalog reads varm columns by key

Catalogs ​

ConstructorAnswers fromPython
new DataCatalog(bundle, result, sets, { enforce })One result, as read_parsed_levels returns it: the rule each level was converted with; the named sets alone, so apb_alpha, the fields apb2 convert writes, answers only when named; R's DataCatalog$new(result, ...)DataCatalog(result, *sets, enforce=None)
new Catalog(bundle, software, software_version, set_name, { enforce })The packaged APB2 rule whose version pattern admits software_version, such as '2.6.0'; no dataCatalog(software, software_version, set_name, enforce=None)
MemberDataCatalogCatalog
levelsReadonlyMap<string, Level>: one result level per name, with AnnData's slotsReadonlyMap<string, LevelNames>: one rule level, the same slots holding names
fields()TableRow[]: the long table's columns plus present and constantsame, present always true
descriptionthe first set's purpose and used_bythe set's
DataCatalog.answering_sets(bundle, result)string[]: the sets new DataCatalog(bundle, result, [name]) opens, every set but one whose app has not run on the result or whose annotation it does not record; static, never throws; Python's DataCatalog.answering_sets(result)—
  • A key is one of a set's keys: a kind with the qualifier values it fixes, such as intensity_norm_settings (kind intensity, normalization run_setting); Sets lists them per set
  • Composed sets: a key routes to the sets that define it; two sets naming different fields for one key on one level throw when the catalog is built; keys() and fields() cover every set
  • A level answers only for its own entity: peptidoform_ion for precursors, protein for protein groups

Levels ​

MemberDataCatalog levelCatalog levelPython
namethe level's namesamename
X()Promise<Layer>: the primary layer—X
layers.get(key, qualifiers)Promise<Layer | null>string | nulllayers.get(key, **qualifiers), and layers[key]
var.get(key, qualifiers), obs.get(key, qualifiers)Promise<Column | null>; var also reads varm tablesstring | nullvar.get(...), obs.get(...)
layers.name(key, qualifiers), var.name(...), obs.name(...)string, the field get reads; a varm field is table/column; throws KeyError where get gives nullsamename(key, **qualifiers)
var.select(keys), obs.select(keys)Promise<Map<string, Column>>: every column the keys name, in order, by namestring[]var[[key, …]]
layers.keys(), var.keys(), obs.keys()string[], sorted: the keys the level offers theresamekeys()
layers.has(key), …whether the level offers the key theresamekey in layers
obs_names(), var_names()Promise<string[]>: the key columns, joined by |—obs_names, var_names
  • Layer is { runs: string[], features: string[], values: Float64Array[] }, one array per run; Column is a Float64Array for numbers (null as NaN), otherwise an array of strings or booleans
  • qualifiers is an object of one value per qualifier the key leaves open, such as { unit: 'minute' }; kind, or a qualifier the key fixes, throws
  • Lookup follows cf_xarray: a key first, then the level's own name in that slot; keys() and has() know keys only
  • A prefix makes the lookup exact: a set's prefix asks that set alone, so 'c:q_value' is the confidence set's q-value or nothing, never Sage's own q_value column; 'v:' asks the level's own name alone, never the catalog; an unknown prefix, or qualifiers on a 'v:' name, throw
  • Every key keys() lists reads: an app's keys, such as apb-fasta's, are there once the app has run. new DataCatalog(bundle, result, ['fasta_peptides_alpha']) on a result apb-fasta has not verified throws when it opens, naming what to run; so do fasta_proteins_alpha before apb-fasta merge-annotations and obs_annotation_alpha on a result without a sample table. DataCatalog.answering_sets(bundle, result) lists the sets that open
  • A key may name the primary layer and then answers X(); layers holds the other layers, as in AnnData
  • A lookup is answered at once from the provenance JSON and throws at once; only the data is a promise, and each Parquet file is fetched once

Answers ​

AnswerMeans
a fieldExactly one cataloged field matches
nullFrom get: the level's software version was reviewed and has no such field, or the name is neither a key nor the level's own; an absent level is not in levels
KeyErrorFrom name and select where get gives null; its name is 'KeyError'
UnresolvedFieldTwo fields match equally, an entry leaves a requested qualifier unknown, the set reviews no entries for the level's software version, or an app has not run, in Catalog or in a set with vendor entries too; resolution.status and the message name the reason and candidates
ErrorA misspelled set or qualifier, qualifiers with a name that is no key, a qualifier the key fixes, or a version no packaged rule admits

Requirements and enforce ​

{ enforce: 'required' } or { enforce: 'recommended' } makes a set's requirement rows binding and checks them once, when the catalog opens: DataCatalog on the levels the result has, Catalog on the levels of the rule its version matches.

Opened withrequired absentrecommended absentoptional absent
no enforceopensopensopens
enforce: 'required'throws MissingRequiredFieldopens; one MissingRequiredField passed to console.warnopens
enforce: 'recommended'throwsthrowsopens
  • One MissingRequiredField lists every missing field, one line each; its missing holds each [resolution, row] pair
  • A lookup does not enforce: once the catalog is open, get gives null for an absent field
  • enforce on a catalog whose sets have no requirement rows throws

Tables ​

CallReturnsPython
sets(bundle)One row per set: set, prefix, purpose, used_by, has_requirements, entriessets()
rule_coverage(bundle, set_name)Every packaged rule level checked against one set, one row per field: software, version, software_version_pattern, level, slot, table, name, key, kind, one qualifier.<name> column per qualifier of the set, producer, requirement, needs, verdictrule_coverage(set_name)
catalog_table(bundle, set_name?)The whole catalog, every set, or one set, as one row per entry and software version pattern: set, source, version, software_version_pattern, level, slot, table, name, key, kind, one qualifier.<name> column per qualifier, requirement, entry_idcatalog_table(set_name=None)

The columns are Python's; apb-catalog's API describes them.

Not ported ​

As in apbCatalogR: snapshots, Python's resolve, snapshot, attach_snapshot and ResolutionSnapshot; and the command line.