/clawbio:biostudies-fetchfrom clawbio
Queries EMBL-EBI BioStudies to fetch study metadata by accession, search across collections, list and download attached files, and produce a harmonised metadata.tsv.
Ships in clawbio. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are BioStudies Fetch, a specialised ClawBio agent for EMBL-EBI BioStudies. Your role is to turn a BioStudies accession or a search phrase into study metadata, a file listing, a harmonised sample table, or the files themselves.
Fire this skill when the user says any of:
S- accessionDo NOT fire when:
E-MTAB-* or another ArrayExpress identifier — route to
arrayexpress-fetch, which understands MAGE-TAB and SDRF. (BioStudies hosts
ArrayExpress, so this skill can fetch those records, but it will not parse
the experimental design.)PRJEB, ERR), SRA (SRR), GEO
(GSE) or PRIDE (PXD) — route to ena-fetch, geo-fetch or
pride-fetch. A bare SRR has no ClawBio skill yet; ena-fetch resolves
most of them, and the rest need sra-tools directly.article-data-fetcher, which resolves a paper to its deposited data.metadata.tsv whose core columns are identical across every
ClawBio archive skill — so a study from BioStudies, ENA, GEO, ArrayExpress or
PRIDE lands in the same shape and is ready to feed straight into a
pipeline rather than needing a bespoke parsing step each time. The archive
skills that hold sequencing runs emit a pipeline-ready samplesheet.csv
(nf-core/rnaseq and nf-core/scrnaseq column contracts) from the same
machinery.One skill, one task. This skill talks to BioStudies and nothing else. ENA, SRA, GEO, ArrayExpress and PRIDE each have their own skill.
| Format | Example | Notes |
|---|---|---|
| BioStudies accession | S-BSST2074 | Any collection hosted in BioStudies |
| Search phrase | "spatial transcriptomics" | With --command search |
metadata; a phrase goes to search.metadata-table): map source-native annotations onto the
core columns, promoting every unmapped characteristic to its own column.report.md, result.json, tables/metadata.tsv and the
reproducibility bundle into --output.Steps 2–4 are prescriptive: the endpoints, the harmonisation keys and the null markers are fixed. Step 5's narrative framing is yours.
# Demo — offline, from the bundled fixture
python skills/biostudies-fetch/biostudies_fetch.py --demo --output /tmp/bs_demo
# Study metadata
python skills/biostudies-fetch/biostudies_fetch.py \
--command metadata --accession S-BSST2074 --output /tmp/bs
# File listing, then download only the files whose path matches
python skills/biostudies-fetch/biostudies_fetch.py \
--command files --accession S-BSST2074 --output /tmp/bs
python skills/biostudies-fetch/biostudies_fetch.py \
--command download --accession S-BSST2074 --match .zip --output /tmp/bs
# Harmonised sample table
python skills/biostudies-fetch/biostudies_fetch.py \
--command metadata-table --accession S-BSST2074 --output /tmp/bs
# Search, optionally within one collection
python skills/biostudies-fetch/biostudies_fetch.py \
--command search --query "spatial transcriptomics" --limit 20 --output /tmp/bs
# Via the ClawBio runner
python clawbio.py run biostudies-fetch --demo
python clawbio.py run biostudies-fetch --command metadata --accession S-BSST2074
# The upstream positional form also works when called directly
python skills/biostudies-fetch/biostudies_fetch.py metadata S-BSST2074 --output /tmp/bs
python clawbio.py run biostudies-fetch --demo
Runs metadata, files, metadata-table and search against the bundled
S-BSST2074 fixture, entirely offline, and writes the full output tree.
GET https://www.ebi.ac.uk/biostudies/api/v1/studies/{accession},
three attempts with a rising backoff.type == "file" and path
is present. Files download from .../biostudies/files/{accession}/{path},
percent-encoded, written to .part and then os.replaced so an interrupted
download never leaves a truncated file in place.type mentions
"sample" or its attributes include an organism field. The root section is
excluded — its organism is the study-level organism, not a sample's.Characteristics[x] / Comment[x] /
FactorValue[x] to x; map synonyms onto the core columns; treat
NA, n/a, none, unknown, not applicable, -- and friends as empty;
promote every unconsumed characteristic to its own column.SAME*/SAMN*/SAMD* sample id, merge in
the EBI BioSamples characteristics, skipping archive bookkeeping fields.Key parameters
sample, replicate, species, sex, age, condition, genotype, treatment, tissueNA_csv.writer's default CRLF# BioStudies report — S-BSST2074
Source: [EMBL-EBI BioStudies](https://www.ebi.ac.uk/biostudies/studies/S-BSST2074)
## metadata
accession : S-BSST2074
Title : An mm10-based reference genome N-masked in positions of SNPs
between Mus musculus and three other mouse species
ReleaseDate: 2026-08-14
Organism : Mus caroli
files : 1 file entries
## files
1 file(s) for S-BSST2074:
GRCm38_masked_allStrains.zip 23996135081 N-masked reference genome
## metadata-table
Wrote 1 row(s) x 12 column(s) for S-BSST2074 to <output>/tables/metadata.tsv
(no per-sample structure; used study-level attributes)
---
*ClawBio is a research and educational tool. It is not a medical device and does
not provide clinical diagnoses. Consult a healthcare professional before making
any medical decisions.*
output_directory/
├── report.md # Commands run and what each returned
├── result.json # Machine-readable envelope
├── tables/
│ └── metadata.tsv # Harmonised sample table
├── downloads/ # (optional) only with --command download
└── reproducibility/
├── commands.sh # Exact command to reproduce
├── environment.yml # Environment snapshot
└── checksums.sha256 # SHA-256 of every artifact
Required: Python >= 3.10 only. The vendored client is standard library
(urllib, json, csv, re, html) — there is nothing to pip install.
Optional: none.
metadata-table output as one row
per sample. Do not assume it. BioStudies submissions often have no per-sample
structure at all, and the skill then emits a single study-level row and
says so in its output. Check the note before reading the table as a sample
manifest.Organism as the
species of every sample. Do not. The root section is deliberately excluded
from sample discovery, because a multi-species study lists one organism at the
top and different ones per sample. Trust the per-row species column.size as megabytes. It is
bytes, and BioStudies routinely attaches multi-gigabyte archives — the
demo study's single file is 24 GB. Never kick off --command download without
telling the user the total size first.E-MTAB-* accession resolves here because BioStudies hosts
ArrayExpress. It will return the record but will not parse the MAGE-TAB
experimental design. Route those to arrayexpress-fetch instead of reporting
a thin result.https://www.ebi.ac.uk/biostudies/files/{accession}/{path} download URL. Do
not. It works — it 302-redirects — but there is no one base tree behind it:
/studies/{accession}/info advertises /biostudies/fire/... for E-MTAB-*
and /pub/databases/biostudies/... for S-BSST*. The redirect also costs
12.4 s against 0.3 s direct, and times out on multi-gigabyte files. This
skill resolves httpLink from /info and keeps the old path as a fallback.--command metadata works but --command download hangs or
fails with a connection timeout, suspect a firewall, not a bug. Metadata
comes from www.ebi.ac.uk; file bytes come from ftp.ebi.ac.uk. Corporate
networks, VPNs and CI sandboxes routinely allow the first and block the
second, which produces exactly this split. Both hosts must be allowlisted —
see the allowlisting section of
docs/data-handling.md
— it is TCP/443 to a different host, not an FTP port, so asking an admin to
"open FTP" will not help.
Confirm with
curl -sI https://ftp.ebi.ac.uk/biostudies/ -o /dev/null -w '%{http_code}\n':
200 means reachable, 000 means blocked.--out defaults were relative to the working
directory. Here every path resolves under --output; a relative --out is
anchored there, and only an absolute --out escapes. Do not reintroduce
cwd-relative defaults.www.ebi.ac.uk and
receives public archive data. Nothing of yours leaves the machine, which
satisfies ClawBio Safety Rule 1 by construction rather than by promise. See
docs/data-handling.md.reproducibility/ with the exact command,
an environment snapshot and SHA-256 checksums.The agent dispatches and explains. The skill executes. The agent must not invent accessions, guess at file contents it has not listed, or re-map the harmonised columns. If a study has no per-sample structure, say so rather than manufacturing rows.
Trigger conditions: the orchestrator routes here on a BioStudies accession
(S-BSST, S-BIAD, S-EPMC) or an explicit mention of BioStudies or the
BioImage Archive.
Chaining partners:
arrayexpress-fetch: for the ArrayExpress records BioStudies hosts, when the
MAGE-TAB design is needed.ena-fetch: when a study links out to sequencing runs.article-data-fetcher: upstream producer. It resolves a DOI or PMID to
the repository accessions a paper deposited. When the user starts from a
paper rather than an accession, run it first and hand the accessions here.
It downloads files and writes a manifest.json, but it does not
harmonise sample annotation into metadata.tsv — that is this skill's job,
so the two chain rather than compete./api/v1; the PageTab schema
changing type == "file"; the BioSamples characteristics endpoint moving.harmonize_row,
write_metadata_tsv, the field-key table) are duplicated across the archive
skills rather than shared, deliberately, so each stays easy to re-sync with
upstream. Factor them out only if upstream does.7cc3e6e (biostudies/), © 2026 UK Dementia Research Institute, MIT.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub clawbio/clawbio --plugin clawbio112 skills in this plugin
/affinity-proteomicsUnified analysis pipeline for affinity-based proteomics platforms — Olink (PEA, NPX) and SomaLogic SomaScan (SOMAmer, RFU). Platform-aware QC, normalisation, differential abundance, volcano plots, heatmaps, and PCA./analyze-fastaAnalyze a single FASTA file (nucleotide or protein), compute sequence-level metrics (GC, ORFs, MW, pI, GRAVY, secondary-structure fractions) with Biopython, and write a Markdown report plus structured JSON for downstream chaining./ancestry-risk-profilerInfers genetic super-population ancestry from a 23andMe/AncestryDNA file and computes ancestry-stratified odds ratios with an exploratory Ancestry Elevation Score (AES) showing where ancestry-specific GWAS effect sizes diverge from European reference estimates. The bundled demo panel requires user-supplied ancestry because high-Fst AIM coverage is below the automatic-inference floor./archaic-introgressionDetect Neanderthal and Denisovan introgression segments from modern human genomes/arrayexpress-fetchQuery metadata and download data from ArrayExpress, EMBL-EBI's functional genomics collection, now hosted inside BioStudies. Fetch study metadata by E-MTAB accession, list and classify files (IDF/SDRF MAGE-TAB, raw, processed), print the SDRF experimental design, download data by category, write a harmonised metadata.tsv, and build an nf-core/rnaseq or nf-core/scrnaseq samplesheet.csv from the SDRF./article-data-fetcherGiven an article DOI or PubMed ID, discover and download the genomics data files deposited by the authors (VCF, FASTA, H5AD, CSV, JSON, BAM, etc.) from public repositories such as GEO, ENA, Zenodo, Figshare, Dryad, and OSF.Other plugins' skills for the same job