Logo di Chorus

Chorus

Organizzazione
pinellolab

One interface to nine genomic deep-learning oracles — variant effect prediction, calibrated per-track percentiles, and plain-English analysis through MCP.

Autorepinellolab
Repositorychorus
LinguaPython
Fork
11
Stelle
65
Strumenti disponibili
0
Tipo di trasportostdio
Categorie
LicenzaMIT
Link
  • Collega gli strumenti ai flussi di lavoro IA

    Chorus mette a disposizione funzionalità MCP utilizzabili da client e agenti IA compatibili.

  • 0 strumenti disponibili

    Esplora le azioni richiamabili qui sotto, con nomi e descrizioni quando forniti dal server.

  • Configurazione pronta da copiare

    Usa gli esempi di installazione per configurare questo server nel tuo client MCP preferito.

  • Indicatori di interesse open source

    65 stelle e 11 fork nel repository collegato.

Accessible Sequence to Function Analyses: Predict how a genetic variant changes gene regulation — chromatin accessibility, transcription factor binding, histone marks, gene expression — across thousands of cell types.

One API over eight state-of-the-art deep-learning models; ask in natural language via Claude or call it from Python!


🚀 Get running in one lunch break

Four steps. Steps 1 + 2 are copy-paste. Step 3 is a runnable snippet. Step 4 hooks chorus up to Claude Code.

Before you start — three things you need:

1. Install (5 minutes)

bash
git clone https://github.com/pinellolab/chorus.git && cd chorus
git checkout v0.7.5          # a released tag; omit to track main
mamba env create -f environment.yml
mamba activate chorus
python -m pip install -e .

Install a tag, not main. main is kept green but moves; this README's numbers, the committed examples and the background CDFs are consistent as of a tag. Releases that changed published numbers are called out in CHANGELOG.md.

Chorus is not on PyPI — that name belongs to an unrelated project, so pip install chorus gets you someone else's package. A source install is the supported path.

2. Get every oracle, weight, and reference — batteries included (~55–75 min, unattended)

bash
chorus setup

One command, walk away, come back to a complete chorus install. When prompted:

Running unattended, or have no HuggingFace account? Both are fine — see Token plumbing for the one-liner and the no-account path.

3. Your first prediction — score a SNP at the β-globin locus

The snippet loads Enformer, predicts DNase accessibility around chr11:5,247,500 (in the β-globin locus, expressed in K562), then scans every possible SNP at that one base to score the effect of A/C/G/T. One real wild-type signal, three counter-factual variants — the same shape every chorus prediction takes.

About a minute, and no GPU required. Measured end to end on this snippet: 64 s on an idle H100, 59 s CPU-only — near-identical, because the cost is almost entirely TensorFlow import and model load rather than the forward pass, so four 1 kb predictions are cheap either way. (The first run also downloads ~1.9 GiB of Enformer weights.)

python
import chorus
from chorus.utils import get_genome

oracle = chorus.create_oracle(
    'enformer', use_environment=True,
    reference_fasta=str(get_genome('hg38')),
)
oracle.load_pretrained_model()

# Wild-type: DNase-seq signal at the β-globin locus in K562
wt = oracle.predict(
    ('chr11', 5247000, 5248000),
    ['ENCFF413AHU'],
)
# NB: .values is Enformer's FULL output — 896 bins x 128 bp = 114,688 bp centred
# on the query, not the 1 kb you asked for. This mean is over all of it. To score
# just the window, use score_region (recipe 5 below).
print(f"mean over Enformer's 114 kb output: {wt['ENCFF413AHU'].values.mean():.3f}")

# Variant effect: scan every SNV at chr11:5247500 (genome has 'C' here)
effects = oracle.predict_variant_effect(
    'chr11:5247000-5248000',
    'chr11:5247500',
    ['C', 'A', 'G', 'T'],   # ref first (= genome base), then 3 alts
    ['ENCFF413AHU'],
)
n_alts = len(effects['predictions']) - 1  # minus the reference
print(f"Variant result: scored {n_alts} alt alleles "
      f"({list(effects['predictions'].keys())})")

Coordinate convention — the two forms differ by one base. chorus accepts a region either way, and they are not interchangeable:

formconvention…5247500, 5247504 means
'chr11:5247500-5247504' (string)1-based inclusive — dbSNP / gnomAD / UCSC / IGVCATCA (5 bases)
('chr11', 5247500, 5247504) (tuple)0-based end-exclusive — BED / pyfaidxATCA (4 bases, starting one later)

Prefer the string form — it is what every variant database you paste from uses. Assembling ref/alt windows by hand? get_centered_window converts and validates the ref base against the FASTA, so off-by-one bugs fail loudly.

4. Skip the code — drive chorus from Claude in plain English 🤖

Hook chorus up to Claude Code once and then describe the analysis you want. Claude figures out which models to load, which tracks to score, and which chorus tool to call.

bash
claude mcp add -s user chorus -e CHORUS_NO_TIMEOUT=1 -- mamba run -n chorus chorus-mcp

Now ask, in any Claude Code prompt:

"Predict DNase accessibility at chr11:5,247,000–5,248,000 with Enformer for K562, then compute the effect of rs12740374 on SORT1 expression with AlphaGenome."

"Find the cell types where the SNP rs12740374 most strongly opens chromatin."

"Replace the 200 bp endogenous enhancer at chrX:48,782,929–48,783,129 with this synthetic sequence and predict accessibility in HepG2, K562, and GM12878."

That's it. No more boilerplate, no juggling oracle APIs — chorus exposes 24 MCP tools (full list) covering prediction, variant effects, region swaps, multi-layer analysis, in-silico mutagenesis, gene-TSS lookups, and cell-type discovery, and Claude picks the right one for the question.

What to read next

  • Notebooks — three end-to-end tutorials you can follow start-to-finish (start here)
  • Worked application examples — driven by natural-language prompts; the what can chorus do? tour
  • MCP server — full Claude Code + Claude Desktop setup with all 24 tools
  • Python API — 9 runnable recipes (region replacement, gene expression, sub-region scoring, variant-to-gene, …)
  • Pick an oracle — hardware matrix, which one to start with
  • Troubleshooting

Learn more

Everything below is optional — the TLDR above is enough to get running. Sections go from broad context down to model-specific details and the backgrounds appendix.

What chorus is

Conversational genomics. The idea behind Chorus: ask in plain language what DNA does — and what happens when you change it — while an AI agent orchestrates the right sequence-to-function models to predict, compare, and explain the answer. An agent that predicts function from sequence, not a chatbot that looks up what is already known. Computation, replaced by conversation.

Eight genomic deep-learning models — Enformer, Borzoi, ChromBPNet/BPNet, Cherimoya/CATv1, Sei, LegNet, EPInformer-seq, AlphaGenome — behind one API. The same five lines of Python predict base-pair chromatin accessibility, TF binding, 5,168 multi-modal tracks at 1 Mb context, or RNA-seq-grade expression.

Every prediction comes with effect and activity percentiles, ranked against ~18 k–225 k sampled SNPs and ~19.5 k–320 k genome-wide positions. So a +0.45 log₂FC becomes 0.98 effect %ile, 0.96 activity %ile — interpretable without calibrating it yourself.

Each oracle runs in its own conda environment (no TF/PyTorch/JAX dependency hell), every weight + reference + background is pre-mirrored to a chorus-controlled HuggingFace org (no broken-link surprises), and the 24-tool MCP server lets you ask Claude to run the analysis in plain English. See Pick an oracle for the per-oracle hardware/cost matrix.

Key terms

TermMeaning
OracleA deep learning model that predicts regulatory activity from DNA sequence (e.g. Enformer, AlphaGenome)
TrackA single experimental measurement predicted by an oracle (e.g. DNase-seq in K562 cells)
assay_idThe unique identifier for a track, used in API calls (e.g. "ENCFF413AHU" or "DNASE/EFO:0001187 DNase-seq/.")
Effect percentileHow extreme a variant's effect is compared to that track's own reference population of sampled SNPs (≥99th = stronger than 99% of them). See Variant effect distribution for which population each oracle uses
log2FCLog2 fold-change between alternate and reference allele predictions — the raw effect size (most layers). Gene-expression uses lnFC (natural log) and MPRA uses Δ (alt−ref); every report states the formula used per layer.

Worked application examples — seven things you can do today

Every example below was generated end-to-end by Claude Code talking to chorus's MCP server. No code was written by hand — the original natural-language prompt is preserved at the top of every report, so you can read what was asked, look at what came back, and reproduce it by pasting the same prompt into your own Claude session.

I want to…Example
Analyze a GWAS / clinical variant in a specific cell typevariant_analysis/SORT1_rs12740374
I have a variant but don't know the relevant tissuediscovery/SORT1_cell_type_screen
Fine-map a GWAS locus to the causal SNPcausal_prioritization/SORT1_locus
Score a batch of variants from a VCFbatch_scoring/
Predict the effect of an engineered sequence editsequence_engineering/region_swap
Replicate a published regulatory variant findingvalidation/SORT1_rs12740374_with_CEBP
Cross-validate a variant across multiple oraclesvalidation/SORT1_rs12740374_multioracle

Every report ships in Markdown + JSON + TSV + HTML with an embedded IGV browser. Pick the format your downstream pipeline likes; they're consistent. examples/walkthroughs/README.md has the full catalogue with per-persona ("Geneticist", "Bioinformatician", "Clinician", "Computational biologist") starting points.

Pick an oracle

Start with one or two oracles and add more with chorus setup --oracle <name> later. AlphaGenome is the most capable but heaviest; Enformer is the best CPU-friendly starter.

OracleMinimum RAMGPU needed?Typical cold-predictBest for
Enformer8 GBoptional~10 s (GPU) / ~1 min (CPU)lightweight multi-track, CPU-friendly starter
Borzoi12 GBrecommended~30 s (GPU)distal gene-expression effects, longer context
ChromBPNet4 GBoptional~1 s (CPU ok)base-pair chromatin / motif disruption
Cherimoya / CATv14 GBrecommended~5 s (GPU, default) — see notebase-pair chromatin accessibility across 1,518 ENCODE DNase/ATAC experiments — the widest biosample coverage in chorus
LegNet4 GBoptional<1 sMPRA / promoter activity
Sei4 GBoptional~2 sregulatory sequence-class profiling
EPInformer-seq2 GBoptional<1 sper-cell 2-channel enhancer activity (DNase cut-sites + H3K27ac, 3 assays, 11 Roadmap cells, 2114-bp window)
AlphaGenome16 GBstrongly recommended~30 s (GPU) / 2–5 min (CPU)comprehensive multi-layer (5,168 tracks, 1 Mb window)
AlphaGenome (PyTorch backend) ⓘ16 GBrecommended (esp. Apple Silicon)~3.8 s @524 kb on Mac MPS / ~2 s @1 MB on CUDAalternative backend with the same weights; see Two AlphaGenome backends below

GPU detection is automatic — every oracle picks CUDA / MPS / CPU based on what's available; pass device='cuda' / 'cpu' / 'mps' to override, or set CUDA_VISIBLE_DEVICES to pin to a specific GPU. The platform-by-oracle support matrix and Apple Silicon nuances live in Installation — detailed.

Cherimoya timing depends on the mode you run it in

Cherimoya's per-call cost depends on how many models you ask for. chorus defaults to fold 0 — one model — and CATv1's 5-fold mean is available as fold="ensemble", which costs five forward passes and, in use_environment=True mode, five subprocesses. Measured on one H200, single 2,114 bp window, DNASE:ENCSR149XIL:

modeload1st predict2nd predict
use_environment=True, fold=0 — the default4.4 s5.1 s5.2 s
use_environment=True, fold="ensemble"5.8 s25.8 s25.8 s
in-process (use_environment=False), fold 03.8 s0.86 s0.027 s

Nothing is amortised across calls in env mode, so the second prediction costs the same as the first; if you are scoring more than a handful of sequences, run in-process inside chorus-cherimoya. These numbers are ~3.6× better than before v0.7.2, because Triton was re-benchmarking its autotune candidates in every subprocess to serve one forward pass; chorus now enables Triton's on-disk autotune cache (#165, thanks @jmschrei). Predictions are bit-identical either way.

Which fold to use. fold 0 is the default because it matches ChromBPNet's default fold — so the two are comparable at the percentile level, both nulls being built on the same reference sets — and because handling five models complicates and slows most analyses, which is CATv1's author's own recommendation for an interactive tool. The ensemble renders a little cleaner and is one argument away.

They are not interchangeable, and each has its own background null, selected automatically from the fold a prediction was made with. A percentile is a rank against a background, so a null built from one model cannot rank predictions from another; asking for a fold with no null raises rather than returning a plausible wrong number. On the window above:

fold01234ensemble
peak8.2415.4715.3411.087.6511.10

The folds disagree by 2.02× among themselves, so fold=N is a different answer, not a cheaper approximation. chorus ships nulls for fold 0 and the ensemble; build one for another fold with scripts/build_backgrounds_cherimoya.py --fold N.

⚠️ Cherimoya and ChromBPNet are not comparable at raw magnitude. chorus loads ChromBPNet as chrombpnet_nobias, which predicts the bias-corrected accessibility profile — ChromBPNet trains a Tn5/DNase bias model first and regresses its effect out. CATv1 does no such correction (n_control_tracks: 0 in its checkpoints, controls = None in its training config, GC-matched negatives in place of a control track). Measured over four shared DNase experiments, CATv1 tracks bias-aware ChromBPNet to 1.02× on peak while differing from chrombpnet_nobias by 3.40×. Profile shape agrees either way (rank correlation 0.95). Compare the two through percentiles, which are unaffected because each oracle is ranked against its own null.

GPU vs CPU, inference step only (model load, FASTA extraction and subprocess startup excluded). Measured on one H200 vs 8 CPU threads: 1.2 ms GPU / 10.5 ms CPU for the single 2,114 bp window a 1 kb query needs. The GPU margin widens with query width: 8.5× at 1 kb, 45× at 10 kb, 150× at 100 kb (18 ms vs 2.8 s). So CPU is fine for single-locus work and impractical for wide scans. Note also that the CPU path diverges from the Triton GPU path by ~1e-2 relative on the logits (r = 0.99999), so don't mix devices inside one comparison.

Two AlphaGenome backends

Chorus ships two interchangeable AlphaGenome oracles for the same model with the same weights — they differ only in the load + forward implementation:

OracleBackendWeight sourceHF gatingDefault?Best for
alphagenomeJAX (Google DeepMind reference)google/alphagenome-all-foldsgated (HF token + accept terms)yes — installed by default chorus setupmacOS at any window size, Linux/CUDA at any window size
alphagenome_ptPyTorch (genomicsxai/alphagenome-pytorch)gtca/alphagenome_pytorch — converted from the official JAX checkpoint (same numbers, safetensors format)public on HF, but the non-commercial model terms still apply to the weights regardless of which mirror you download from — read Google's AlphaGenome model terms before commercial-adjacent useyes — installed by default chorus setup (~7.5 GB env + ~880 MB weights on top of the JAX backend — see Disk usage breakdown)macOS at ≤600 kb (5–8× faster than JAX CPU on MPS)

The two backends agree to 0.8–4.9 % (peak-relative, correlation 0.9998–1.0000), measured per head. The residual is fp32 implementation noise, not different weights. Audits: audits/2026-04-29_alphagenome_pytorch_spike/ and audits/2026-04-29_alphagenome_pt_stress_test/.

⚠️ Before 0.7.5 this was false for splice tracks — re-run them if you used alphagenome_pt. See Caveats.

Use chorus.recommend_alphagenome_backend(window_size_bp) (also available as an MCP tool and as oracle.recommend_backend() on either oracle) to get a per-host, per-window-size recommendation grounded in the audit numbers. Logic:

  • Linux + CUDA: prefer alphagenome (JAX with CUDA is 1.2–2.8× faster than PyTorch on A100; PT remains useful for portability — smaller install, looser CUDA-version pinning).
  • macOS + MPS, window ≤600 kb: prefer alphagenome_pt on MPS (5–8× faster than JAX CPU; the JAX backend has no MPS access).
  • macOS + MPS, window >600 kb: prefer alphagenome on CPU (PyTorch MPS regresses past a GPU on-die cache cliff at ~768→896 kb on M3 Ultra).
  • No GPU: prefer alphagenome on CPU (JAX CPU is 30–65 % faster than PyTorch CPU for this model).

The recommendation is suggestion-only: chorus never auto-routes between backends. Upstream's PyTorch port also exposes VariantScoringModel + 7 scorer classes, LoRA + linear-probe fine-tuning, and CONTACT_MAPS / SPLICE_JUNCTIONS heads — none of these are wired through the chorus API yet for either backend; access them via direct alphagenome_pytorch import if you need them today.

Installation — detailed

The TLDR's chorus setup does everything you need. This section covers the edge cases: upgrading, per-oracle setup, token plumbing, manual genome management, and backgrounds.

Two env files, one source of truth. The root environment.yml is what you install. The per-oracle files in environments/ are consumed internally by chorus setup --oracle <name> — you don't install them directly.

Platform & GPU support

PlatformDefault oracle pathNotes
Linux x86_64 + NVIDIA CUDAfull GPU acceleration on every oracleNVIDIA CUDA auto-detected; pass device='cuda' / CUDA_VISIBLE_DEVICES=N to pin to a specific GPU
macOS (Apple Silicon)TF-backed oracles (Enformer, ChromBPNet) and PyTorch-backed (Borzoi, Sei, LegNet) use Metal automatically; Cherimoya runs CPU-onlytensorflow-metal for TF; PyTorch MPS for the rest. Cherimoya has no MPS/Metal path in the model, and its triton>=3.5.1 pin ships no macOS wheel — chorus setup installs it with --no-deps and the import-guarded pure-PyTorch CPU path runs
macOS (Intel)CPU on every oracleworks, just slower
AlphaGenome on Apple Siliconuse the alphagenome_pt PyTorch backend (installed by default) for MPS at ≤600 kb windowsthe JAX alphagenome oracle falls back to CPU on Apple Silicon — JAX-Metal still matures; see Two AlphaGenome backends

Disk usage breakdown

The default chorus setup (all 8 oracles, both AlphaGenome backends, hg38, all CDF backgrounds) lands at ~87 GB, measured with du -sh on a Linux x86_64 + CUDA box after a default setup:

BucketSize
7 of the 8 oracle conda envs — Cherimoya's is listed separately below~53 GB
AlphaGenome PyTorch backend env (alphagenome_pt, default-on so Mac users get MPS speed)~7.5 GB
Cherimoya env (PyTorch + CUDA + triton)~6.6 GB
Sei weights — the extracted model plus the retained sei_model.tar.gz it came from~6.5 GB
hg38 reference fasta + index~3.1 GB
Base chorus env~2.7 GB
Per-oracle CDF backgrounds (<data-dir>/backgrounds/, 9 files) — Sei is 1.5 GB of that, a consequence of the 0.7.4 rebuild (40 sequence classes → all 21,947)~3.4 GB
AlphaGenome weights — PyTorch (~880 MB) + JAX (~700 MB)~1.6 GB
Borzoi weights~1.4 GB
Enformer weights~960 MB
ChromBPNet slim HuggingFace mirror — fast-path pre-cache (K562 + HepG2 DNase)~50 MB
LegNet weights~41 MB
EPInformer-seq per-cell weights (11 main + 11 bias)~8 MB
Cherimoya fast-path weights (DNase + ATAC K562/HepG2)~10 MB
Total default~87 GB

One oracle instead of eight is ~13 GiB (measured for enformer: 2.41 GiB base env + 5.89 GiB oracle env + 3.05 GiB hg38 + 0.94 GiB weights + 0.52 GiB backgrounds = 12.81 GiB).

Budget above that: mamba also fills a package cache (~4 GB here) shared across envs, which you can reclaim afterwards with mamba clean --all. Sei's sei_model.tar.gz is kept after extraction, so deleting it reclaims ~3.1 GB if you are tight.

Most of it is the envs, not the models. Each oracle env ships its own CUDA payload and pip does not hardlink between envs, so each is a full copy — per-env sizes run 6.1 GB (Enformer) to 11 GB (AlphaGenome). Two consequences: macOS and CPU-only installs are far smaller (chorus setup strips CUDA on macos_arm64), and chorus setup --oracle <name> plus --no-weights / --no-genome / --no-backgrounds let you skip whatever you do not need.

All of it is relocatable: see Where chorus puts large files if $HOME or the clone's filesystem is the wrong place for it.

Opting in via chorus setup --all-chrombpnet pre-caches every fold-0 bias-corrected ChromBPNet model from the slim mirror (+~1.5 GB, ~5 min). Other ChromBPNet cell types download lazily on first load_pretrained_model(...) regardless. If you specifically need the full bias-aware chrombpnet variant or fold ≠ 0, chorus falls back to the original ENCODE tarball for that specific model (+~1.8 GB on disk per model). See Where the oracle weights come from for the full mirror map.

Where chorus puts large files

By default, everything bulky goes in the chorus installation directory — not ~/.chorus, and not ~/.cache/huggingface. On a shared cluster node, or any box where the clone sits on a small volume, that is usually the wrong filesystem for 85 GB. One switch moves all of it:

bash
export CHORUS_DATA_DIR=/data/chorus_data          # per-shell, highest priority
chorus setup --data-dir /data/chorus_data         # choose at install time
chorus config data-dir --set /data/chorus_data    # persist for this install
chorus config data-dir --set PATH --migrate       # move backgrounds you already downloaded
chorus config data-dir                            # print what resolved, and why

Resolution order: CHORUS_DATA_DIR → <install>/chorus_data_dir.txt → the install directory → ~/.chorus (only when the install tree is not writable, e.g. a pip install into system site-packages). chorus config data-dir prints the resolved paths with their sizes, so it is also the quickest way to see where your disk went:

Resolved chorus data layout
  data_dir      /home/you/chorus
  chosen via    installation directory (default)

  backgrounds   /home/you/chorus/backgrounds  [3.4 GB]
  downloads     /home/you/chorus/downloads  [14.5 GB]
  genomes       /home/you/chorus/genomes  [3.1 GB]
  hf_cache      /home/you/chorus/huggingface  [4.5 GB]

One exception, for upgrades. If ~/.chorus/backgrounds already holds *_pertrack.npz and the resolved directory does not, chorus keeps using the old location and logs that it is doing so, so an upgrade does not silently re-download 1.9 GB. It applies to backgrounds only, and an explicit CHORUS_DATA_DIR or --set always wins. chorus config data-dir --set PATH --migrate moves them for good. This is why backgrounds can print a different root from data_dir above.

Two things do not follow this switch: credentials (~/.chorus/config.toml, the HuggingFace token) stay in $HOME, and conda environments stay with the installation.

Upgrading

After the first install, to upgrade cleanly:

bash
cd chorus && git pull
# Remove all oracle envs, weights, and backgrounds in one command:
chorus cleanup --all
# Then remove the base env:
mamba env remove -n chorus -y

Note that chorus cleanup --all leaves the HuggingFace cache in place — see Uninstalling for how to reclaim that too. For an upgrade that is usually what you want, since re-downloading the weights is the slow part.

Then re-run the Fresh Install steps above.

Using the MCP server? Restart Claude Code (or Claude Desktop) after upgrading. A running MCP server keeps the old code loaded in memory, so newly added oracles or tools won't appear until the client relaunches the chorus-mcp process.

Uninstalling / starting from scratch

bash
# Preview what will be deleted (safe — no changes):
chorus cleanup --all --dry-run

# Remove all oracle envs, downloaded weights, background CDFs, and genomes:
chorus cleanup --all

# `--all` deliberately leaves the HuggingFace cache, where most oracle weights actually
# live — ~4.5 GB for the default set, and much more once you have pulled the full
# 1,518-experiment Cherimoya atlas. Keeping it makes a re-install fast. To reclaim it:
chorus cleanup --hf-cache --dry-run   # preview first
chorus cleanup --hf-cache

# Finer-grained options:
chorus cleanup --oracle enformer          # one oracle only (env + weights)
chorus cleanup --oracle all               # all oracle envs + weights, keep backgrounds/genomes
chorus cleanup --backgrounds              # remove <data-dir>/backgrounds/*.npz only
chorus cleanup --genomes                  # remove downloaded reference genomes only

The base chorus environment itself is not removed by chorus cleanup — remove it manually with mamba env remove -n chorus -y if you want a complete wipe.

Setting up oracle environments one-by-one

Chorus uses isolated conda environments for each oracle to avoid dependency conflicts between TensorFlow, PyTorch, and JAX models.

Which oracle to start with? See Pick an oracle for the hardware matrix, or the side-by-side table in the walkthroughs.

bash
# Set up each oracle individually (alternative to `chorus setup` which does all 8)
chorus setup --oracle alphagenome    # JAX-based — default AlphaGenome backend (see AlphaGenome section below for auth)
chorus setup --oracle enformer       # TensorFlow-based
chorus setup --oracle borzoi         # PyTorch-based
chorus setup --oracle chrombpnet     # TensorFlow-based (includes BPNet for TF binding)
chorus setup --oracle cherimoya      # PyTorch-based (CATv1: 1,518 ENCODE DNase/ATAC experiments; CUDA or CPU)
chorus setup --oracle sei            # PyTorch-based
chorus setup --oracle legnet         # PyTorch-based
chorus setup --oracle epinformerseq  # PyTorch-based (per-cell 2-channel DNase+H3K27ac enhancer activity, 11 Roadmap cells)

# PyTorch backend for AlphaGenome — same model, same weights as the
# default JAX backend (converted to safetensors). Both AlphaGenome
# backends install by default in `chorus setup`. This explicit form is
# only useful if you want to add it after a previous `--oracle <other>`
# install, or if you ran setup with `--no-weights` and want to add PT
# weights afterward. (See "Two AlphaGenome backends" below.)
chorus setup --oracle alphagenome_pt

# List available environments
chorus list

Check the installation:

bash
# Check environment health (use --timeout for first run when models download)
chorus health --timeout 300

Note: chorus setup pre-downloads each oracle's default weights + background CDFs + the hg38 reference at install time, so subsequent chorus health / prediction calls are fast. If you opted out via --no-weights, the first prediction will still do a lazy download.

Slow or unstable connection? Use --setup-timeout SECONDS to cap how long each phase (env build and weight download) is allowed to run before aborting with a clear error:

bash
chorus setup --oracle borzoi --setup-timeout 3600   # 1-hour cap per phase

Default is unlimited. If a phase times out, re-run the same command — mamba and HuggingFace downloads resume from where they left off.

Tokens

Two tokens are relevant. chorus setup surfaces both so they aren't a mid-prediction surprise:

TokenWhen you need itHow chorus setup handles it
HF_TOKEN (HuggingFace)Required for AlphaGenome — the google/alphagenome-all-folds model is gated.Resolved via --hf-token → HF_TOKEN / HUGGING_FACE_HUB_TOKEN env → existing huggingface-cli login → interactive prompt. chorus setup (bare or --oracle all) halts the whole flow if no working token can be resolved, so the other 7 oracles aren't built for nothing.
LDLINK_TOKENOptional — only used by fine_map_causal_variant (auto-fetch LD proxies from the NIH LDlink REST API).Non-blocking prompt during chorus setup. If provided, stored in ~/.chorus/config.toml; chorus.utils.ld also reads LDLINK_TOKEN from env.

Register an HF read token at https://huggingface.co/settings/tokens, then accept the model license at https://huggingface.co/google/alphagenome-all-folds. Register a free LDlink token at https://ldlink.nih.gov/?tab=apiaccess.

Token plumbing

Unattended runs. The token is resolved before anything is built, and if stdin is not a TTY the run aborts immediately — "No HuggingFace token available and stdin is not a TTY" — with zero progress and no envs. So for nohup, CI, Slurm or a tmux-less ssh session, supply it up front:

bash
export HF_TOKEN=hf_...        # or: chorus setup --hf-token hf_...
nohup chorus setup &

No HuggingFace account. Only AlphaGenome is gated and the gate is scoped to it, so chorus setup --oracle enformer never asks for a token (main.py prompts only when alphagenome is among the requested oracles) and leaves a fully working ~13 GiB install. Every snippet in the quick start uses Enformer.

chorus setup --no-weights also skips the gate, but it downloads no model weights at all, so you cannot predict anything afterwards. It provisions envs; it is not the no-account path.

Managing reference genomes

Chorus includes built-in support for downloading and managing reference genomes. chorus setup pulls hg38 automatically — this section is for other assemblies or manual management.

bash
# List available genomes
chorus genome list

# Download a reference genome (e.g., hg38, hg19, mm10)
chorus genome download hg38

# Get information about a downloaded genome
chorus genome info hg38

# Remove a downloaded genome
chorus genome remove hg38

Supported genomes:

  • hg38: Human genome assembly GRCh38
  • hg19: Human genome assembly GRCh37
  • mm10: Mouse genome assembly GRCm38
  • mm9: Mouse genome assembly NCBI37
  • dm6: Drosophila melanogaster genome assembly BDGP6
  • ce11: C. elegans genome assembly WBcel235

Genomes are stored in the genomes/ directory within your Chorus installation.

The downloader is not the oracles. Every oracle is trained on hg38 only, and a non-hg38 reference is refused rather than scored — see Caveats. Other assemblies are here for other tooling; docs/BACKGROUND_NULL_PROTOCOL.md §11 covers what mouse support would require.

Per-track background distributions (auto-downloaded)

Chorus converts every raw prediction into an effect percentile and activity percentile against each track's own sampled-SNP reference population (~17,800–225,000 variants) and ~19,500–320,000 genome-wide positions scored on the same oracle. These pre-computed per-track CDFs are what let a user interpret a +0.45 log2FC as 0.96 activity %ile.

Nothing to configure. chorus setup pre-downloads them; otherwise the first variant analysis for an oracle fetches them from lucapinello/chorus-backgrounds and caches them at <data-dir>/backgrounds/. Building your own for a new oracle: see CONTRIBUTING.

<data-dir> defaults to the chorus installation directory, not ~/.chorus — see Where chorus puts large files to move it.

Where the oracle weights come from

Chorus mirrors every oracle's weights to chorus-controlled HuggingFace repos so the install path stays stable even if upstream sources move (TFHub deprecation, Zenodo single-link records, third-party HF accounts). Each loader prefers the chorus mirror and falls back to the original source on any failure — so chorus stays bootable even if the mirror is unreachable.

OracleChorus mirrorOriginal sourceMirror size
AlphaGenome (JAX)not mirrored — official sourcegoogle/alphagenome-all-folds (gated)—
AlphaGenome (PyTorch)not mirrored — upstream portgtca/alphagenome_pytorch—
Enformerlucapinello/chorus-enformerTFHub deepmind/enformer/1 (now redirects to Kaggle)961 MB
Borzoilucapinello/chorus-borzoijohahi/borzoi-replicate-{0..3}~6 GB (4 folds)
ChromBPNetlucapinello/chorus-chrombpnet-slimENCODE per-experiment tarballs1.49 GB (786 h5's; chorus fetches only the 9 human ATAC/DNase models — the 33 mm10 models are still hosted but no longer offered, see 2026-08-01)
Cherimoyaprogrammable-genomics/CATv1is the primary source (CC-BY-4.0)~3.8 GB (1,518 fold-0 checkpoints; ~2.5 MB each, fetched lazily)
Seilucapinello/chorus-seiZenodo 49069973.28 GB
LegNetlucapinello/chorus-legnetZenodo 1786355038 MB
EPInformer-seqlucapinello/chorus-epinformerseq-v2per-cell 2-channel PerCellProfileNetWide + frozen BiasNet, trained on Roadmap DNase-summit peaks (ch0 = 5′ DNase cut-sites, ch1 = H3K27ac) (Pinello Lab)11 MB (11 cells × main + bias)

The chorus mirrors are byte-identical to the originals (verified via md5 / size against upstream metadata where published). License terms applying to the weights are unchanged by mirroring — see each mirror's README on HuggingFace for explicit attribution and the upstream model terms.

OracleFile sizeTracks covered
AlphaGenome~260 MB5,168
Enformer~520 MB5,313
Borzoi~770 MB7,611
ChromBPNet~80 MB753 (9 ATAC/DNASE + 744 CHIP)
Cherimoya~162 MB1,518 (369 ATAC + 1,149 DNASE)
Cherimoya (ensemble)~154 MB1,518 — the fold-ensemble has its own null; see Cherimoya folds
Sei~1.5 GB21,947 tracks (21,907 chromatin profiles + 40 sequence classes)
LegNet~210 KB3 cell types
EPInformer-seq~2.3 MB33 tracks (11 cell types × 3 assays: DNase, H3K27ac, composite)

The backgrounds dataset is public — no HuggingFace token required. HF_TOKEN is only needed for the gated AlphaGenome model itself (see Tokens above). Causal prioritization with auto-LD-fetch needs a separate free LDlink token.

To pre-download by hand:

python
from chorus.analysis.normalization import download_pertrack_backgrounds
for oracle in ["alphagenome", "enformer", "borzoi", "chrombpnet", "cherimoya",
               "sei", "legnet", "epinformerseq"]:
    download_pertrack_backgrounds(oracle)

Python API

Prefer a notebook? Open examples/notebooks/single_oracle_quickstart.ipynb for a full walkthrough using Enformer + the GATA1 locus. The recipes below are the minimum viable snippets.

Prerequisite: you've run chorus setup (or at least chorus setup --oracle enformer).

Minimal working example

python
import chorus
from chorus.utils import get_genome

# 1. Create oracle with reference genome
genome_path = get_genome('hg38')  # auto-downloads if needed
oracle = chorus.create_oracle('enformer', use_environment=True,
                              reference_fasta=str(genome_path))
oracle.load_pretrained_model()

# 2. Predict DNase accessibility at the beta-globin locus.
#    'ENCFF413AHU' is the ENCODE track ID for DNase-seq in K562 cells.
#    See "Discovering tracks" below to find track IDs for other assays /
#    cell types, or use the `list_tracks` MCP tool from Claude Code.
predictions = oracle.predict(('chr11', 5247000, 5248000), ['ENCFF413AHU'])

# 3. Check the result
track = predictions['ENCFF413AHU']
print(f"Mean signal: {track.values.mean():.2f}, Max: {track.values.max():.2f}")

Discovering tracks

Each oracle has thousands of tracks. describe_tracks() is the one call that works on all nine — no model load, no reference genome, no GPU, so it is cheap to explore with:

python
oracle = chorus.create_oracle('enformer', use_environment=True)

for t in oracle.describe_tracks(query='K562', limit=3):
    print(t.track_id, '|', t.assay, '|', t.cell_type, '|', t.description)
# ENCFF899YDP | DNASE | K562 | DNASE:K562 treated with 1 uM vorinostat for 72 hours
# ENCFF515UNC | DNASE | K562 | DNASE:K562 G2 phase
# ENCFF708UIS | DNASE | K562 | DNASE:K562 G1 phase

len(oracle.describe_tracks())        # 5313 — omit query/limit for everything

query matches case-insensitively across id, assay, cell type and description. Each record is a TrackRecord with .track_id, .assay, .cell_type, .description, .extra (oracle-specific fields such as fold or ENCODE accession) and .as_dict(). track_id is the contract: pass it straight to predict() and it comes back as the key.

python
tracks = [t.track_id for t in oracle.describe_tracks(query='DNASE:K562')]
predictions = oracle.predict(('chr11', 5247000, 5248000), tracks)

Per-oracle metadata is still there when you want a DataFrame or an oracle-specific column, but it differs per oracle — describe_tracks() exists so you don't have to know which:

python
print(oracle.list_assay_types())   # ['ATAC', 'CAGE', 'CHIP', 'DNASE']

from chorus.oracles.enformer_source.enformer_metadata import get_metadata
k562_tracks = get_metadata().search_tracks('K562')   # DataFrame, 'identifier' column

Tip: track id formats differ per oracle (ENCODE accessions, assay+cell type, {OutputType}/{Track}/{Strand}, …). describe_tracks() returns the right form for whichever oracle you loaded, so you rarely need to know which; Model-specific details has them all if you do.

1. Wild-type prediction

python
# Predict from genomic coordinates
predictions = oracle.predict(
    ('chr11', 5247000, 5248000),  # Beta-globin locus
    tracks
)

# Or from DNA sequence
sequence = 'ACGT' * 98304  # 393,216 bp for Enformer
predictions = oracle.predict(sequence, tracks)

2. Region replacement

python
# Replace a 200bp region with enhancer sequence
enhancer = 'GATA' * 50  # 200bp GATA motif repeats
replaced = oracle.predict_region_replacement(
    'chr11:5247400-5247600',  # Region to replace
    enhancer,                  # New sequence
    tracks
)

3. Sequence insertion

python
# Insert enhancer at specific position
inserted = oracle.predict_region_insertion_at(
    'chr11:5247500',  # Insertion point
    enhancer,         # Sequence to insert
    tracks
)

4. Variant effect

python
# Test SNP effects (e.g., A→G mutation)
variant_effects = oracle.predict_variant_effect(
    'chr11:5247000-5248000',  # Region containing variant
    'chr11:5247500',          # Variant position
    ['C', 'A', 'G', 'T'],     # ref FIRST and it must match the genome: hg38
                              # has C at chr11:5247500. strict_ref=True by
                              # default, so a wrong ref raises rather than
                              # silently substituting.
    tracks
)

5. Sub-region scoring

python
# Score a specific peak or promoter within the prediction window
# (instead of summarizing the entire 114 kb output)
score = predictions.score_region('chr11', 5247400, 5247600, 'mean')
# Returns {track_id: score} for all tracks

# Also available on individual tracks with different strategies
track = predictions['ENCFF413AHU']
track.score_region('chr11', 5247400, 5247600, 'max')   # peak signal
track.score_region('chr11', 5247400, 5247600, 'sum')   # total signal

6. Focused variant effect scoring

python
from chorus.core.result import score_variant_effect

# Score variant effects at the variant site (±N bins)
scores = score_variant_effect(variant_effects, at_variant=True, window_bins=2)
# Returns {allele: {track_id: {ref_score, alt_score, effect}}}

# Or score variant effects at a specific region (e.g. a nearby promoter)
scores = score_variant_effect(
    variant_effects,
    chrom='chr11', start=5247400, end=5247600,
    scoring_strategy='mean'  # mean, max, sum, median, or abs_max
)

7. Gene expression analysis

python
# Quantify predicted gene expression from CAGE and/or RNA-seq tracks
# Auto-detects expression tracks and uses appropriate quantification:
#   CAGE/LentiMPRA → TSS windowed max
#   RNA-seq → exon sum (Borzoi/AlphaGenome)
expr = oracle.analyze_gene_expression(predictions, 'GATA1')
# Returns per-track expression values with quantification method

# Also available: get exon annotations for a gene
from chorus.utils.annotations import get_gene_exons
exons = get_gene_exons('GATA1')  # merged exon coordinates

8. Variant effect on gene expression

python
# The key question: does this variant change expression of a gene?
result = oracle.analyze_variant_effect_on_gene(variant_effects, 'GATA1')
# Returns fold change, log2 fold change, and absolute change per allele per track

9. Save predictions

python
# Save as BedGraph for genome browser
wt_files = predictions.save_predictions_as_bedgraph(output_dir="bedgraph_outputs",
                                                    prefix='a_wt')

Notebooks — three sittings, zero to confident

Three end-to-end Jupyter notebooks shipped with the repo. Run them in order — by the time you finish notebook 3 you'll have used every oracle, scored a variant across five regulatory layers, and rendered a coolbox track view of your own predictions. All three work as soon as chorus setup finishes; no extra downloads needed. One extra step, though — register the base env as a Jupyter kernel, which chorus setup does not do for you:

bash
mamba activate chorus
python -m ipykernel install --user --name chorus --display-name "Python 3 (chorus)"

The shipped notebooks declare kernel name chorus, so without this JupyterLab prompts you to choose a kernel and jupyter nbconvert --execute fails with NoSuchKernel: No such kernel named chorus.

NotebookOraclesWhat you'll build
examples/notebooks/single_oracle_quickstart.ipynbEnformerPredictions → region replacement → sequence insertion → variant effect → gene expression → coolbox visualization. The "I get it now" notebook.
examples/notebooks/comprehensive_oracle_showcase.ipynb6 oracles — Enformer, Borzoi, ChromBPNet/BPNet, Sei, LegNet, AlphaGenome (does not yet include Cherimoya or EPInformer-seq)Same variant scored by every oracle side-by-side. Cross-model agreement, sub-region scoring, gene-expression layer integration.
examples/notebooks/advanced_multi_oracle_analysis.ipynbEnformer + ChromBPNet/BPNet + LegNetCHIP-seq TF footprinting, strand-specific tracks, the Interval API, effect-percentile normalization, cell-type switching. The graduate-level notebook.

Need a specific cell type or tissue? cherimoya_quickstart.ipynb works the 1,518-experiment CATv1 atlas end-to-end: search, disambiguate a biosample with several experiments, predict, score a variant, compare by activity percentile. Wants a CUDA GPU.

MCP server — chorus, but you talk to Claude

Chorus's MCP (Model Context Protocol) server is what makes the lunch-break tour Step 4 work. Claude (or any MCP-aware client) loads oracles, predicts variant effects, scores regions, and writes full HTML/MD reports — all from natural-language prompts. Step 4 above gave you the one-liner; this section has every config detail (Claude Code, Claude Desktop, manual testing, the full 24-tool catalogue).

Setup for Claude Code

You do NOT need to run the server manually. Claude Code manages the MCP server process automatically. You just need a .mcp.json file — and it works from any project folder, not just the Chorus repo.

Step 1: One-liner — run this from any project folder:

bash
curl -sL https://raw.githubusercontent.com/pinellolab/chorus/main/.mcp.json -o .mcp.json

Or create .mcp.json manually:

json
{
  "mcpServers": {
    "chorus": {
      "type": "stdio",
      "command": "mamba",
      "args": ["run", "-n", "chorus", "chorus-mcp"],
      "env": {
        "CHORUS_NO_TIMEOUT": "1"
      }
    }
  }
}

The chorus-mcp command is installed in the chorus conda environment, so mamba run -n chorus chorus-mcp works from any directory.

Note: If you use conda instead of mamba, replace "command": "mamba" with "command": "conda". The CHORUS_NO_TIMEOUT env var disables prediction timeouts, which is recommended for interactive use.

Step 2: Start (or restart) Claude Code from your project:

bash
cd /path/to/my-project    # any folder — does NOT need to be the chorus repo
claude

Claude Code reads .mcp.json on startup and launches the MCP server in the background. You should see the Chorus tools available immediately — try asking: "What oracles are available?"

Alternatively, you can add Chorus to your global Claude Code settings (~/.claude/settings.json) so it's available in every project without needing a per-project .mcp.json:

bash
# Add globally (one-time setup) — note `-s user`:
claude mcp add -s user chorus -e CHORUS_NO_TIMEOUT=1 -- mamba run -n chorus chorus-mcp

claude mcp add defaults to --scope local, which registers the server for the current project only. Without -s user you would run this in the chorus clone, then open Claude Code in your actual analysis project and find no chorus tools — with nothing in the output to say why.

Setup for Claude Desktop

Add this to your Claude Desktop MCP config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

json
{
  "mcpServers": {
    "chorus": {
      "command": "mamba",
      "args": ["run", "-n", "chorus", "chorus-mcp"],
      "env": {
        "CHORUS_NO_TIMEOUT": "1"
      }
    }
  }
}

Then restart Claude Desktop. Chorus tools will be available in all conversations.

Manual testing (optional)

You can verify the server starts correctly by running it directly:

bash
mamba run -n chorus chorus-mcp
# You should see the FastMCP banner. Press Ctrl+C to stop.

Available MCP tools

All 24, grouped by what you would reach for them for:

  • Discovery: list_oracles, list_tracks, list_genomes, get_genes_in_region, get_gene_tss, recommend_alphagenome_backend
  • Lifecycle: load_oracle, unload_oracle, oracle_status
  • **Low-level predi

Installazione

TypingMind
{
  "mcpServers": {
    "chorus": {
      "command": "chorus-mcp",
      "args": []
    }
  }
}

Usa MCP Chorus con più modelli IA

TypingMind collega gli strumenti MCP a livello di area di lavoro: una volta connesso Chorus, puoi usarlo con diversi modelli IA in TypingMind, senza configurarlo separatamente per ogni modello. Questa integrazione MCP viene eseguita localmente sul tuo dispositivo tramite il connettore MCP di TypingMind.

Guida alla configurazione del connettore locale

Usa questo metodo quando il server MCP deve accedere a file locali, app o risorse private sul tuo computer.

1

Apri le impostazioni MCP

In TypingMind, vai su Impostazioni, Impostazioni avanzate, poi su Model Context Protocol e scegli Configura MCP.

  1. Apri TypingMind nel tuo browser.
  2. Fai clic sull'icona Impostazioni.
  3. Vai a Impostazioni avanzate.
  4. Apri la sezione Model Context Protocol.
  5. Fai clic su Configura MCP e scegli Questo dispositivo.
Schermata di configurazione del connettore MCP di TypingMind con Questo dispositivo selezionato
2

Esegui il comando del connettore

Scegli Questo dispositivo, copia il comando da TypingMind ed eseguilo nel terminale. Lascia il processo in esecuzione mentre usi MCP.

  1. Copia il comando di configurazione mostrato da TypingMind.
  2. Apri Terminale su macOS o Windows Terminal su Windows.
  3. Incolla ed esegui il comando.
  4. Conferma l'installazione del pacchetto se il terminale ti chiede di procedere.
  5. Tieni aperta la finestra del terminale con il processo in esecuzione mentre usi gli strumenti MCP.
3

Aggiungi Chorus come server

Quando lo stato del connettore è Pronto, fai clic su Modifica server e incolla la configurazione del server MCP.

  1. Attendi che lo stato del connettore sia Pronto.
  2. Fai clic su Modifica server.
  3. Incolla la configurazione del server MCP di Chorus.
  4. Salva l'elenco dei server.
  5. Aggiorna per verificare che il connettore sia ancora pronto.
Impostazioni MCP di TypingMind con un server attivo e il pulsante Modifica server
{
  "mcpServers": {
    "chorus": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Usa la connessione con diversi modelli

Salva l'elenco dei server, apri Plugin, abilita gli strumenti MCP di Chorus, poi seleziona un modello IA supportato in TypingMind e usa gli strumenti in chat o assegnali a un agente IA.

  1. Apri la pagina Plugin in TypingMind.
  2. Abilita gli strumenti MCP di Chorus.
  3. Avvia una chat e scegli il modello IA che vuoi usare.
  4. Usa gli strumenti MCP in chat o assegnali a un agente IA.
  5. Passa a un altro modello IA quando serve, senza riconnettere MCP.
Chat di TypingMind che usa gli strumenti MCP abilitati con un modello IA selezionato
Puoi usare Chorus per aiutarmi con questa attività?
Chorus
Certo. Ho letto.
Ecco cosa ho trovato con Chorus.

Domande frequenti

A cosa serve il server MCP Chorus?

Chorus è un server MCP che consente ai client IA compatibili di accedere a strumenti e informazioni di contesto esterni. In TypingMind puoi aggiungere questo server MCP una sola volta e rendere disponibili i suoi strumenti nella tua area di lavoro IA.

Posso usare Chorus MCP con più modelli IA in TypingMind?

Sì. TypingMind collega gli strumenti MCP a livello di area di lavoro, quindi puoi usare Chorus con diversi modelli IA come Claude, ChatGPT, Gemini o altri modelli che hai configurato in TypingMind, senza dover configurare il server MCP separatamente per ogni modello.

Perché usare il connettore MCP Chorus con TypingMind?

TypingMind è una delle migliori interfacce per chattare con gli LLM perché riunisce più modelli IA, prompt, plugin, agenti IA, chiavi API e strumenti MCP in un'unica area di lavoro. Collegando Chorus, puoi usare i suoi strumenti MCP con i tuoi modelli preferiti e mantenere organizzato il tuo flusso di lavoro in chat su TypingMind.

Come collego Chorus MCP a TypingMind?

Chorus funziona tramite il connettore MCP locale di TypingMind. È la soluzione ideale quando il server MCP deve accedere a file locali, app desktop, strumenti da riga di comando o risorse private sul tuo computer.

Quali strumenti offre Chorus MCP in TypingMind?

Chorus mette a disposizione funzionalità MCP che puoi attivare dalla pagina Plugin di TypingMind e usare in chat o assegnare agli agenti IA.

Devo condividere le mie chiavi API con TypingMind per usare Chorus MCP?

No. TypingMind privilegia il funzionamento in locale e ti permette di mantenere il controllo su fornitori di modelli, chiavi API, prompt e configurazione MCP. Se Chorus richiede l'autenticazione, aggiungi le intestazioni, le impostazioni OAuth o la configurazione locale necessarie per quel server MCP quando crei la connessione.

Server MCP correlati

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇