File size: 7,399 Bytes
871acc0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | ---
license: apache-2.0
tasks:
- genomic-sequence-modeling
frameworks:
- jax
language:
- en
- zh
tags:
- OneScience
- Life Sciences
- Genomics
- DNA Sequence Model
- Variant Effect Prediction
- AlphaGenome
datasets:
- OneScience-Sugon/alphagenome_dataset
---
<p align="center">
<strong>
<span style="font-size: 30px;">AlphaGenome</span>
</strong>
</p>
# Model Introduction
AlphaGenome is a DNA sequence model developed by Google DeepMind. It accepts DNA intervals of up to 1 Mbp as input and predicts a range of functional genomic signals for genomic track prediction and regulatory variant-effect scoring.
Paper: Advancing regulatory variant effect prediction with AlphaGenome
https://www.nature.com/articles/s41586-025-10014-0
# Model Description
AlphaGenome is implemented in JAX / Flax and supports genomic interval inference, variant effect scoring, track evaluation, and example fine-tuning workflows. This model package is accompanied by the Hugging Face dataset `OneScience-Sugon/alphagenome_dataset`, which enables rapid local validation.
# Use Cases
| Scenario | Description |
| :---: | :--- |
| Genomic interval prediction | Takes a reference-genome FASTA file, a chromosome, and genomic interval coordinates as input and outputs predicted tracks such as ATAC, DNase, CAGE, RNA-seq, and ChIP |
| Variant effect scoring | Takes either a VCF file or built-in example variants as input, compares predictions for the reference and variant sequences, and produces a variant scoring table |
| Track prediction evaluation | Uses validation data from the AlphaGenome dataset to compute regression evaluation metrics across different assay bundles |
| Fine-tuning experiments | Validates a fine-tuning workflow using custom reference genomes, interval CSVs, and BigWig signal files |
| Hugging Face / OneCode execution | After downloading the model project and accompanying dataset, quickly verifies that the scripts run correctly in a life-sciences runtime environment |
# Usage Guide
## 1. OneCode Usage
Try one-click AI4S development in the OneCode online environment:
[Try one-click AI4S development](https://web-2069360198568017922-iaaj.ksai.scnet.cn:58043/home)
## 2. Manual Installation and Usage
**Hardware Requirements**
- GPU or DCU is recommended.
- A CPU can be used for import checks and lightweight configuration tests; full training and inference will be slow.
- DCU users must install DTK in advance. DTK 25.04.2 or later is recommended, or a OneScience-recommended version matching the current cluster.
**Environment Check**
- NVIDIA GPU:
```bash
nvidia-smi
```
- Hygon DCU:
```bash
hy-smi
```
### Download the Model Package
```bash
hf download --model OneScience-Sugon/alphagenome --local-dir ./alphagenome
cd alphagenome
```
### Install the Runtime Environment
**DCU Environment**
```bash
# Activate DTK and CONDA first
conda create -n onescience311 python=3.11 -y
conda activate onescience311
# uv installation supported
pip install onescience[bio-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
```
After installation, return to the model package directory:
```bash
cd ./alphagenome
```
### Data for Inference, Evaluation, and Fine-Tuning
The OneScience community has uploaded the data required for AlphaGenome inference, evaluation, and fine-tuning to Hugging Face: [OneScience-Sugon/alphagenome_dataset](https://huggingface.co/datasets/OneScience-Sugon/alphagenome_dataset). After downloading, place the data in the `data/` directory under the model package.
```bash
hf download --dataset OneScience-Sugon/alphagenome_dataset --local-dir ./data
```
### Model Weights
The repository already includes `weight/alphagenome-all-folds`, and all scripts allow the model weights directory to be specified via `--model_dir`.
### Preparing Weights
If using local weights, place the AlphaGenome Orbax checkpoint in the following directory:
```text
weight/
alphagenome-all-folds/
_CHECKPOINT_METADATA
_METADATA
...
```
When running in a shared environment, you can also reuse centrally managed model and dataset directories via environment variables:
```bash
export ONESCIENCE_MODELS_DIR=/path/to/onescience/models
export ONESCIENCE_DATASETS_DIR=/path/to/onescience/datasets
```
Scripts look in the following locations first:
- `${ONESCIENCE_MODELS_DIR}/AlphaGenome/alphagenome-all-folds`
- `${ONESCIENCE_DATASETS_DIR}/AlphaGenome`
If the above environment variables are not set, the scripts fall back to the following paths under the current model package:
- `weight/alphagenome-all-folds`
- `data/`
### Interval Inference
```bash
bash scripts/inference.sh
```
Equivalent Python command example:
```bash
python scripts/run_inference.py \
--fasta_path ./data/reference/HOMO_SAPIENS/GRCh38.p13.genome.fa \
--model_dir ./weight/alphagenome-all-folds \
--chromosome chr19 \
--start 10587331 \
--end 11635907 \
--output_dir ./outputs
```
Inference results are saved to `outputs/`.
### Variant Effect Scoring
```bash
bash scripts/run_variant.sh
```
To specify a VCF input:
```bash
python scripts/run_variant_scoring.py \
--vcf_path ./data/example.vcf \
--fasta_path ./data/reference/HOMO_SAPIENS/GRCh38.p13.genome.fa \
--model_dir ./weight/alphagenome-all-folds \
--output_dir ./outputs_variant
```
Scoring results are saved as a CSV file.
### Track Prediction Evaluation
```bash
bash scripts/run_track.sh
```
You can also explicitly specify data and output paths:
```bash
python scripts/run_track_prediction_eval.py \
--model_dir ./weight/alphagenome-all-folds \
--model_version ALL_FOLDS \
--data_dir ./data/v1/train \
--output_path ./outputs_track/eval_results.csv
```
### Fine-Tuning Example
```bash
python scripts/run_finetuning.py \
--fasta_path ./data/reference/HOMO_SAPIENS/GRCh38.p13.genome.fa \
--regions_csv ./data/finetune_regions.csv \
--bigwig_paths ./data/sample_atac.bw \
--output_dir ./finetuned_model \
--num_steps 1000 \
--batch_size 2
```
# Data Format
It is recommended to download the Hugging Face dataset `OneScience-Sugon/alphagenome_dataset` to `data/` under the model package. The default directory structure is as follows:
```text
data/
reference/
HOMO_SAPIENS/
GRCh38.p13.genome.fa
GRCh38.p13.genome.fa.fai
v1/
train/
...
```
In this structure:
- `reference/HOMO_SAPIENS/GRCh38.p13.genome.fa` is the human reference genome FASTA.
- `.fai` is the FASTA index file.
- `v1/train/` is the data directory used for track prediction evaluation.
- Custom fine-tuning also requires an interval CSV file with column names `chromosome,start,end`, as well as one or more BigWig signal files.
# OneScience Official Information
| Platform | OneScience Main Repository | Skills Repository |
| --- | --- | --- |
| Gitee | https://gitee.com/onescience-ai/onescience | https://gitee.com/onescience-ai/oneskills |
| GitHub | https://github.com/onescience-ai/OneScience | https://github.com/onescience-ai/oneskills |
# Citation & License
- This repository is adapted from the open-source AlphaGenome model to support DCUs. The source code is licensed under Apache License 2.0.
- For scientific use, please cite the original paper: [Advancing regulatory variant effect prediction with AlphaGenome](https://www.nature.com/articles/s41586-025-10014-0).
|