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
| Call | Returns |
|---|---|
await Bundle.load(url) | The catalog bundle, from the URL of its manifest.json; every file fetched once, revalidated with the server |
bundle.version | The 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
| Call | Returns | R |
|---|---|---|
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 refused | read_parsed_levels(path) |
result.levels | ReadonlyMap<string, ParsedLevel>: one level per name, in the result's order | result$levels |
result.uns, result.metadata | the root parse record; the root post-parse records, such as sdrf or fasta | result$uns, result$metadata |
Member of a ParsedLevel | Returns | R |
|---|---|---|
var(), obs() | Promise<Map<string, Column>>: every column, in the result's order, the vendor's own included | level$var, level$obs |
X() | Promise<Layer>: the primary layer | level$X |
layers.keys(), layers.get(name) | the other layers' names; Promise<Layer | null> by name | level$layers |
obs_names(), var_names() | Promise<string[]>: the key columns, joined by | | level$obs_names, level$var_names |
uns | { apb }: the level's APB record | level$uns |
- In Python the result is the MuData or AnnData apb2 wrote:
var()isadata.var - Not read yet: R's
hierarchy,annotation_tables,feature_relationsandvarm; aDataCatalogreadsvarmcolumns by key
Catalogs
| Constructor | Answers from | Python |
|---|---|---|
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 data | Catalog(software, software_version, set_name, enforce=None) |
| Member | DataCatalog | Catalog |
|---|---|---|
levels | ReadonlyMap<string, Level>: one result level per name, with AnnData's slots | ReadonlyMap<string, LevelNames>: one rule level, the same slots holding names |
fields() | TableRow[]: the long table's columns plus present and constant | same, present always true |
description | the first set's purpose and used_by | the 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(kindintensity, normalizationrun_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()andfields()cover every set - A level answers only for its own entity:
peptidoform_ionfor precursors,proteinfor protein groups
Levels
| Member | DataCatalog level | Catalog level | Python |
|---|---|---|---|
name | the level's name | same | name |
X() | Promise<Layer>: the primary layer | — | X |
layers.get(key, qualifiers) | Promise<Layer | null> | string | null | layers.get(key, **qualifiers), and layers[key] |
var.get(key, qualifiers), obs.get(key, qualifiers) | Promise<Column | null>; var also reads varm tables | string | null | var.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 null | same | name(key, **qualifiers) |
var.select(keys), obs.select(keys) | Promise<Map<string, Column>>: every column the keys name, in order, by name | string[] | var[[key, …]] |
layers.keys(), var.keys(), obs.keys() | string[], sorted: the keys the level offers there | same | keys() |
layers.has(key), … | whether the level offers the key there | same | key in layers |
obs_names(), var_names() | Promise<string[]>: the key columns, joined by | | — | obs_names, var_names |
Layeris{ runs: string[], features: string[], values: Float64Array[] }, one array per run;Columnis aFloat64Arrayfor numbers (null as NaN), otherwise an array of strings or booleansqualifiersis 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()andhas()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 ownq_valuecolumn;'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 dofasta_proteins_alphabeforeapb-fasta merge-annotationsandobs_annotation_alphaon 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();layersholds 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
| Answer | Means |
|---|---|
| a field | Exactly one cataloged field matches |
null | From 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 |
KeyError | From name and select where get gives null; its name is 'KeyError' |
UnresolvedField | Two 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 |
Error | A 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 with | required absent | recommended absent | optional absent |
|---|---|---|---|
no enforce | opens | opens | opens |
enforce: 'required' | throws MissingRequiredField | opens; one MissingRequiredField passed to console.warn | opens |
enforce: 'recommended' | throws | throws | opens |
- One
MissingRequiredFieldlists every missing field, one line each; itsmissingholds each[resolution, row]pair - A lookup does not enforce: once the catalog is open,
getgivesnullfor an absent field enforceon a catalog whose sets have no requirement rows throws
Tables
| Call | Returns | Python |
|---|---|---|
sets(bundle) | One row per set: set, prefix, purpose, used_by, has_requirements, entries | sets() |
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, verdict | rule_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_id | catalog_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.