Code for the scooby model. Scooby is the first model to predict scRNA-seq coverage and scATAC-seq insertion profiles along the genome at single-cell resolution. For this, it leverages the pre-trained multi-omics profile predictor Borzoi as a foundation model, equips it with a cell-specific decoder, and fine-tunes its sequence embeddings. Specifically, the decoder is conditioned on the cell position in a precomputed single-cell embedding.
This repository contains model and data loading code and a train script. The reproducibility repository contains notebooks to reproduce the results of the manuscript.
- NVIDIA GPU (tested on A40), Linux, Python >= 3.12 (required by alphagenome-pytorch; scooby 0.1 was tested with v3.9)
scooby uses a a custom version of SnapATAC2, which can be installed with pip. This is best installed in a separate environment due to numpy version conflicts with scooby.
pip install snapatac2-scooby
pip install git+https://github.com/gagneurlab/scooby.git- Download file contents from Zenodo (Training data and Resources)
- Use examples from the scooby reproducibility repository
We offer a train script for modeling scRNA-seq only and a script for multiome modeling. Both require SNAPATAC2-preprocessed anndatas and embeddings. Training scooby takes 1-2 days on 8 NVIDIA A40 GPUs with 128GB RAM and 32 cores.
You can find pretrained models for the three datasets of the manuscript on Hugging Face:
Scooby-2 (developed as scAG) keeps Scooby's cell-state decoder and replaces
Borzoi with AlphaGenome.
It is part of the scooby package:
pip install git+https://github.com/gagneurlab/scooby.git
# or, from a clone of this repository
pip install -e .A checkpoint is a directory holding model.safetensors and
scag_config.yaml; from_pretrained rebuilds the architecture and LoRA
adapters from the config:
from scooby import ScoobyAlphaGenome
model = ScoobyAlphaGenome.from_pretrained("checkpoint/", device="cuda")A Hugging Face Hub repo id can be passed instead of a local directory. See
scooby/scag/README.md for training, prediction and
the evaluation scripts in scripts/scag.
Currently, the model is only tested with a batch size of 1.
This work was funded by "ERC Synergy grant" (Grant ID 101118521, European Research Council).
