YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
biodata-registry
A pip-installable Python package that provides a YAML-based dataset manifest registry for bioinformatics agents. It also exposes a FastMCP server so agent processes can query dataset metadata over MCP.
What it does
- Discovers and indexes dataset manifests (one YAML file per dataset) at import time
- Validates manifests against a typed schema (
DatasetManifest) - Ships with the Moffitt et al. 2015 PDAC bulk microarray dataset as the first entry
- Exposes registry tools over MCP via a FastMCP server
Installation
pip install -e /path/to/biodata-registry
Or from within the repo directory:
pip install -e .
Python usage
from biodata_registry import get_registry, load_manifest, list_available_datasets
# List all registered datasets
datasets = list_available_datasets()
# [{'dataset_id': 'gse71729_moffitt', 'title': '...', 'modality': 'bulk_microarray', ...}]
# Get a typed manifest
manifest = load_manifest("gse71729_moffitt")
print(manifest.organism) # 'human'
print(manifest.analysis_path) # 'B' (log_expression β Path B)
print(manifest.default_contrasts) # list of contrast dicts
# Raw registry access
reg = get_registry()
raw = reg.get("gse71729_moffitt") # dict or None
print(reg.list()) # ['gse71729_moffitt']
Running the MCP server
python -m biodata_registry.server
The server exposes four MCP tools:
| Tool | Description |
|---|---|
list_datasets |
List all dataset IDs with title and modality |
get_manifest |
Return the full manifest dict for a dataset |
get_prohibited_inferences |
Return refusal rules from a manifest |
get_contrast_definition |
Return contrast metadata for a specific column |
Adding a new dataset
- Create a YAML file in
biodata_registry/manifests/<dataset_id>.yaml. - The file must contain at minimum:
dataset_id,title,accession,organism,modality,platform,data_level,feature_id_type,expression_source,metadata_source,group_columns,valid_workflows,limitations. - The registry auto-discovers it on next import β no code changes needed.
- Run
python -m pytest tests/to verify the new manifest loads correctly.
See biodata_registry/manifests/gse71729_moffitt.yaml for a fully annotated example.
Pattern sets (ADR-0045)
A pattern set is a published genes Γ patterns weight matrix (a CoGAPS result, for projectR transfer learning).
It is a separate artefact kind with its own YAML, one per set under biodata_registry/pattern_sets/. It is not a
dataset: list_available_datasets(), the integration engine and the MCP server never see it.
from biodata_registry import (
get_pattern_set, list_pattern_sets, pattern_set_compatibility, verify_pattern_copy,
)
ps = get_pattern_set("cogaps_pdac_epi")
check = pattern_set_compatibility(ps, "tcga_paad_tpm") # allow / map / refuse, plus check.exploratory
verify_pattern_copy(ps, "/path/to/local/copy.tsv") # "matrix" or an upstream copy id, or IntegrityError
fetch_pattern_matrix(id) is the strict fetch. It refuses a set that fails validation, has no hosted matrix, has no
recorded sha256, or does not match that hash. The two shipped sets (cogaps_pdac_epi, cogaps_semaan_ipmn) are
Permission granted 2026-11-08 (Noller), private OHSU hosting with citation: licence.hosting_permission is granted
on both. cogaps_semaan_ipmn is hosted privately on pdac-research-data at use_status: tool (2026-11-10).
cogaps_pdac_epi is hosted the same way at use_status: tool (2026-11-12, pdac-research-data 5199c41); its
canonical_copy is the PDAC_Atlas RDS (Annie's working reading, 2026-11-12, to be confirmed with the authors). A published pattern left out of patterns_kept is declared in
method.patterns_excluded with a reason_code (Semaan's Pattern_8: technical_read_depth); each entry adds a required
result caveat, and pattern_set_compatibility returns the entries as patterns_excluded. The permission is not a licence (spdx: none_stated) and does not cover public redistribution.
Adding a pattern set:
- Record every upstream copy you checked (where, commit or retrieval time, sha256, bytes, how it compares) in
upstream_copies. Keep the files outside the repo. - Derive the stored TSV with
scripts/ingest/cancer_gear/derive_pattern_tsv.py <id> <upstream file> <out.tsv>, and record its sha256 and bytes inmatrix.integrity. Re-running the script must reproduce them. - Write
result_caveatsasvalidate()requires them (the name and source line, the preprint line while the source is an unpublished preprint, the relative-scores line), and setexploratory_on: [pdac]for a precancer-trained set. - Leave
matrix.urlnull anduse_status: internal_parity_onlyuntillicence.hosting_permissionis granted in writing, with itsby,date,evidenceandscope. If the authors require a citation, add it tosource_paper.required_citationsand toresult_caveats(validate()checks the URL is there).use_status: toolalso needs parity at r β₯ 0.99 on every kept pattern, on bulk and on spatial data. - Run
make test.
Gene reference tables (ADR-0047)
The gene id maps, gene lengths and Hallmark sets the agents share ship in the wheel, gzipped, under
biodata_registry/gene_reference_tables/. MANIFEST.yaml records each table's source and release, licence,
generator, the agent copies it was compared with, row count and two sha256s: one of the decompressed table, one of
the file as shipped. Every read checks both and raises IntegrityError on a mismatch.
from biodata_registry import (
gene_reference_path, list_gene_reference_tables, load_gene_map, previous_symbol_overlay,
)
ens_to_symbol = load_gene_map("hgnc_ensembl_symbol") # {"ENSG00000141510": "TP53", ...}
lengths = load_gene_map("gencode_gene_lengths", cast=float) # {symbol: union-exon length}
path = gene_reference_path("mgi_ensembl_symbol") # checked .gz, for pd.read_csv(path, ...)
# A gene list keyed by symbols HGNC has since renamed (PurIST's C16orf74, now CLMB):
overlay = previous_symbol_overlay(my_gene_list) # .symbols, .refused (with reasons)
mapping = {**ens_to_symbol, **overlay.symbols} # never two genes under one symbol
Regenerating one: run its generator in scripts/gene_references/ (each names its source), then
python scripts/gene_references/record.py to rewrite the measured manifest fields, then make test. Never leave an
undeclared file in the folder: the package-data glob ships whatever is there.
Citing what a person said
A sentence that attributes a statement to a named person needs a record of it: who, which date, which
channel, and who brought it into the record. The records are in docs/attributions.yaml, and
tests/test_attributions.py fails the offline suite when a manifest, pattern set, ADR, script or test
names someone on its roster without either a date that matches a received record or a plain label
that the statement is ours and unconfirmed ("working reading, to be confirmed with ..."). The check
proves a record exists and that the text agrees with it; it does not open a mailbox.
make attributions # run the check: this repo, then the ledgers kept here for other repos
make open-questions # what is still to confirm, by person
docs/attributions/<repo>.yaml holds the records for a sibling repo (repo: names its checkout,
people_from: borrows this repo's roster). They live here because this repo is private and a method repo
may be published: the checked repo carries neither the records nor any reference to this one. The offline
suite gates this repo only; the other repos are checked by make attributions.
Schema reference
Manifest fields are documented in biodata_registry/manifest_schema.py. Key controlled vocabularies:
organism:human,mousemodality:bulk_microarray,bulk_rnaseq,sc_rnaseq,spatial_rnaseq,proteomicsdata_level:raw_counts,log_expression,log_ratio,normalized,tpm,fpkm,protein_abundancefeature_id_type:probe_id,gene_symbol,ensembl_gene_id,entrez_id,protein_id
Security-review orientation
This package is the system's trust anchor: the consuming agents validate
every user-named dataset_id against this registry and then trust the
manifest's expression_source URL. So the security-relevant surface is data
integrity, not runtime attack surface:
- Manifest schema (
biodata_registry/manifest_schema.py) β the typedDatasetManifestand its controlled vocabularies;validate()(decomposed into_check_*helpers) is what rejects malformed manifests at import time. - Integration gates (
biodata_registry/integration.py) βget_integration_plandecidesearly/late/concordance/ refuse and enforces the confound, same-cohort, and cross-resolution safety gates. This is pure metadata logic. - No secrets, no network, no code execution at import β the registry only reads bundled YAML and returns dictionaries. It runs no user input and holds no credentials. The expression-h5ad URLs it hands out point at a private HF dataset; the consumers authenticate to fetch them.
- Distribution: consumers pin a specific commit via a
git+https://β¦@<commit>wheel URL, so the exact manifest set under review is pinned and auditable.