File size: 7,380 Bytes
4516781
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/alphagenome_dataset
---

<p align="center">
  <strong>
    <span style="font-size: 30px;">AlphaGenome</span>
  </strong>
</p>

# Model Introduction

AlphaGenome is a DNA sequence model proposed by Google DeepMind. It can take DNA intervals up to 1 Mbp as input and predict multiple classes of genomic functional signals for 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 based on JAX / Flax and supports genomic interval inference, variant effect scoring, track evaluation, and fine-tuning examples. This model package is accompanied by the ModelScope dataset `OneScience/alphagenome_dataset`, which can be used for quick local verification.

# Applicable Scenarios

| Scenario | Description |
| :---: | :--- |
| Genomic interval prediction | Input a reference genome FASTA, chromosome, and interval coordinates, and output predicted tracks for ATAC, DNase, CAGE, RNA-seq, ChIP, and other signals |
| Variant effect scoring | Input a VCF or built-in example variants, compare prediction differences between reference and variant sequences, and generate a variant scoring table |
| Track prediction evaluation | Use validation data from the AlphaGenome dataset to calculate regression evaluation metrics for different assay bundles |
| Fine-tuning experiments | Use a custom reference genome, interval CSV, and BigWig signal files to verify the fine-tuning workflow |
| ModelScope / OneCode runtime | After downloading the model project and accompanying dataset, quickly verify script connectivity in a biology-domain runtime environment |



# Usage Instructions

## 1. OneCode Usage

You can experience intelligent one-click AI4S programming through the OneCode online environment:

[Click to experience intelligent one-click AI4S programming](https://web-2069360198568017922-iaaj.ksai.scnet.cn:58043/home)

## 2. Manual Installation and Usage

**Hardware Requirements**

- GPU or DCU runtime is recommended.
- CPU can be used for import checks and small-configuration connectivity verification, but full training and inference are slow.
- DCU users need to install DTK in advance. DTK 25.04.2 or later is recommended, or the OneScience-recommended version matching the current cluster.





**Environment Check**

- NVIDIA GPU:

```bash
nvidia-smi
```

- Hygon DCU:

```bash
hy-smi
```

### Download the Model Package

```bash
modelscope download --model OneScience/alphagenome --local_dir ./alphagenome
cd alphagenome
```

### Install the Runtime Environment

**DCU Environment**

```bash
# First activate DTK and Conda
conda create -n onescience311 python=3.11 -y
conda activate onescience311
# Supports uv installation
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
```

### Training and Inference Data Introduction

The OneScience community has uploaded the data required for AlphaGenome inference, evaluation, and fine-tuning to ModelScope: [OneScience/alphagenome_dataset](https://modelscope.cn/datasets/OneScience/alphagenome_dataset). After downloading, place the data in the `data/` directory of the model package.

```bash
modelscope download --dataset OneScience/alphagenome_dataset --local_dir ./data
```

### Training Weights

The repository includes `weight/alphagenome-all-folds`, and all scripts also support specifying model weights through `--model_dir`.

### Prepare Weights

If using local weights, place the AlphaGenome Orbax checkpoint in the following directory:

```text
weight/
  alphagenome-all-folds/
    _CHECKPOINT_METADATA
    _METADATA
    ...
```

If running in a shared runtime environment, you can also reuse a unified directory through environment variables:

```bash
export ONESCIENCE_MODELS_DIR=/path/to/onescience/models
export ONESCIENCE_DATASETS_DIR=/path/to/onescience/datasets
```

The scripts will preferentially read:

- `${ONESCIENCE_MODELS_DIR}/AlphaGenome/alphagenome-all-folds`
- `${ONESCIENCE_DATASETS_DIR}/AlphaGenome`

If the above environment variables are not set, the defaults under the current model package are read:

- `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 will be saved to `outputs/`.

### Variant Effect Scoring

```bash
bash scripts/run_variant.sh
```

When specifying VCF input, you can use:

```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 will be saved as CSV files.

### Track Prediction Evaluation

```bash
bash scripts/run_track.sh
```

You can also explicitly specify the 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

The ModelScope dataset `OneScience/alphagenome_dataset` is recommended to be downloaded to `data/` under the model package. The default structure is as follows:

```text
data/
  reference/
    HOMO_SAPIENS/
      GRCh38.p13.genome.fa
      GRCh38.p13.genome.fa.fai
  v1/
    train/
      ...
```

Where:

- `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 preparing an interval CSV file with column names `chromosome,start,end`, as well as one or more BigWig signal files.

# Official OneScience 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 |

# Citations and License

- This repository is based on the AlphaGenome open-source model and provides DCU adaptation. The related source code uses the Apache License 2.0.
- For scientific research, cite the original paper: [Advancing regulatory variant effect prediction with AlphaGenome](https://www.nature.com/articles/s41586-025-10014-0).