Skip to main content

bolero

Bolero: predicting cell-state-specific gene regulation from DNA sequence.

Bolero is a cell-state-conditioned sequence-to-function model. It takes a 524,288 bp one-hot DNA sequence plus an atlas-scale cell-state embedding (and optional conditioning such as tissue, developmental age, or a TF-activity score) and predicts cell-state-specific chromatin accessibility and transcript abundance at 32 bp resolution (16,384 output bins).

Under the hood it is a frozen Borzoi/Flashzoi backbone with per-layer conditional LoRA adapters whose low-rank weights are generated on the fly from the cell-state embedding — so every cell state gets its own effective network. For a chosen cell state those adapters can be "collapsed" into a plain DNA→track model for fast inference and base-level attribution. Bolero is trained on Bolero-10M: 10.8M cells across 36 datasets and 6 mammals.

📖 Documentation & tutorials: https://liuhlab.github.io/bolero/

System requirements

  • Operating system: Linux, x86-64 (linux-64). macOS and Windows are not supported.
  • Hardware: one NVIDIA GPU with a driver that supports CUDA 12.0 or later. The model has no CPU-only mode. Installation itself needs no GPU.
  • Disk: about 25 GB free for the quick-start downloads; full datasets need more.
  • Software: pixi installs everything else, pinned in pyproject.toml and pixi.lock. Main versions: Python 3.11, PyTorch 2.4 (CUDA build), CUDA 12.6 as the build target, flash-attn and triton (conda-forge), Ray 2.34. Git dependencies: bolerodata, lab forks of SEACells and MOODS that install cleanly in this environment, and finemo-gpu.
  • Tested on: Ubuntu 22.04.5 LTS, NVIDIA H100 80 GB, NVIDIA driver 560.35.05, pixi 0.72.2.

Installation

curl -fsSL https://pixi.sh/install.sh | bash   # install pixi, then open a new shell
git clone https://github.com/liuhlab/bolero.git
cd bolero
pixi install            # runtime env; or: pixi install -e dev

pixi install also pulls the git dependencies above. Typical install time: about 3 min for the clone and pixi install with an empty package cache, measured on a Linux server with a fast network. Allow longer on a slower connection. See docs/installation.md for the environments, Jupyter setup and checks.

Demo

The quick start predicts chromatin accessibility with the pretrained Bolero model for 8 held-out genomic windows (hg38) in 5 blood cell types from the ChromiumPBMC dataset, and compares the predictions with the measured single-cell ATAC signal. Every input downloads from the public HuggingFace repositories arcinstitute/bolero-models and arcinstitute/bolero-data on the first run, about 12 GB in total.

pixi run quickstart     # executes docs/tutorials/00_quickstart.ipynb in place

Expected output in docs/tutorials/quickstart_output/:

  • pred_peak_data.feather, true_peak_data.feather: predicted and measured accessibility of each peak in the predicted windows, one column per cell type.
  • summary_stats.joblib.gz: Pearson r and R² between the two for each cell type. In the reference run, Pearson r was 0.88–0.93 across 598 peaks.
  • pred_vs_measured.png: predicted vs measured accessibility per peak, and the predicted and measured 32 bp tracks of one window for each cell type.

The committed notebook docs/tutorials/00_quickstart.ipynb shows these outputs from the reference run.

Expected run time: about 10 min of downloads and one-time setup on the first run (cached afterwards), then about 25 s of prediction on one NVIDIA H100 80 GB.

Instructions for use

The documentation is an ordered tutorial series that runs the full workflow on your own data, from single cells to a trained model and its predictions:

  • Cell embedding & metacells: build a joint cell-state embedding and SEACells metacells.
  • Datasets: aggregate single-cell fragments into the parquet coverage database, then form pseudobulks with reference signal.
  • Training: fit Bolero on a single dataset, or on the full multi-dataset ATAC (+ gene) atlas.
  • Prediction & variant effect: predict accessibility, score caQTLs and eQTLs, and compute per-base DNA attributions.
  • Bolero-Score: condition the model on a chromVAR TF-activity score (for example AP-1).
  • Cross-species: run the trained atlas model on any species' genome, DNA only, with no retraining.

Companion package

bolero pairs with bolerodata, a lightweight registry that maps short keys to the datasets (Bolero-10M), trained model zoo, and QTL collections behind the paper. It carries no GPU stack, runs inside this environment, and is installed automatically by pixi install.

Citation

If you use Bolero in your work, please cite the paper "Bolero: predicting cell-state-specific gene regulation from DNA sequence" (Hanqing Liu et al.). Full citation details will be added on publication.

License

MIT — see LICENSE.

Metadata

Release files for bolero 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bolero 0.1.1
File Size Uploaded Provenance Actions
bolero-0.1.1.tar.gz 16.1 MB With provenance Details for bolero-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bolero 0.1.1
File Interpreter ABI Platform Actions
bolero-0.1.1-py3-none-any.whl Python 3 none any Details for bolero-0.1.1-py3-none-any.whl

Total release size: 30.0 MB

Release files / bolero-0.1.1.tar.gz

Download URL bolero-0.1.1.tar.gz
Size 16.1 MB
Tags Source
SHA-256 checksum
How to use checksums
aa51feb755fcdbfe591b68f26052d34769dafe38b6ab8d32a297650a953c1ccd
BLAKE2b-256 checksum
How to use checksums
974b77aa8a5c81f22b6080d789fd96aea296b7e8a9adf1fe815b57a2121696f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / bolero-0.1.1-py3-none-any.whl

Download URL bolero-0.1.1-py3-none-any.whl
Size 13.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
8a5700a7c688e15c285794b80cd55d87937e9a45bc94b8e093fa8072d9ecc20d
BLAKE2b-256 checksum
How to use checksums
4277e7274435d1b92703749b646bff9fc2e72af3dfed74ffd584aa9021aaf71e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Security for bolero 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bolero-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page