Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,3 +1,114 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
library_name: alphagenome-pytorch
|
| 4 |
+
tags:
|
| 5 |
+
- genomics
|
| 6 |
+
- biology
|
| 7 |
+
- dna
|
| 8 |
+
- deep-learning
|
| 9 |
+
- regulatory-genomics
|
| 10 |
+
- chromatin-accessibility
|
| 11 |
+
- gene-expression
|
| 12 |
+
pipeline_tag: other
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# AlphaGenome PyTorch
|
| 16 |
+
|
| 17 |
+
A PyTorch implementation of [AlphaGenome](https://www.nature.com/articles/s41586-025-10014-0), the DNA sequence model from Google DeepMind that predicts hundreds of genomic tracks at single base-pair resolution from sequences up to 1M bp.
|
| 18 |
+
|
| 19 |
+
This is an accessible, readable, and hackable implementation for integrating into existing PyTorch pipelines, fine-tuning on custom datasets, and building on top of.
|
| 20 |
+
|
| 21 |
+
## Model Details
|
| 22 |
+
|
| 23 |
+
- **Parameters**: 450M
|
| 24 |
+
- **Input**: One-hot encoded DNA sequence
|
| 25 |
+
- **Organisms**: Human, Mouse
|
| 26 |
+
- **Weights**: Converted from the official JAX checkpoint
|
| 27 |
+
|
| 28 |
+
## Download Weights
|
| 29 |
+
|
| 30 |
+
Available weight files:
|
| 31 |
+
- `model.safetensors` - trained on all data (recommended)
|
| 32 |
+
- `model_fold_0.safetensors` through `model_fold_3.safetensors` - individual CV folds
|
| 33 |
+
|
| 34 |
+
```bash
|
| 35 |
+
# Using huggingface-cli
|
| 36 |
+
huggingface-cli download gtca/alphagenome_pytorch model.safetensors --local-dir .
|
| 37 |
+
|
| 38 |
+
# Or using Python
|
| 39 |
+
pip install huggingface_hub
|
| 40 |
+
python -c "from huggingface_hub import hf_hub_download; hf_hub_download('gtca/alphagenome_pytorch', 'model.safetensors', local_dir='.')"
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
## Usage
|
| 44 |
+
|
| 45 |
+
```python
|
| 46 |
+
from alphagenome_pytorch import AlphaGenome
|
| 47 |
+
from alphagenome_pytorch.utils.sequence import sequence_to_onehot_tensor
|
| 48 |
+
import pyfaidx
|
| 49 |
+
import torch
|
| 50 |
+
|
| 51 |
+
model = AlphaGenome.from_pretrained("model.safetensors")
|
| 52 |
+
model.eval()
|
| 53 |
+
|
| 54 |
+
with pyfaidx.Fasta("hg38.fa") as genome:
|
| 55 |
+
sequence = str(genome["chr1"][1_000_000:1_131_072])
|
| 56 |
+
|
| 57 |
+
dna_onehot = sequence_to_onehot_tensor(sequence).unsqueeze(0)
|
| 58 |
+
|
| 59 |
+
preds = model.predict(dna_onehot, organism_index=0) # 0=human, 1=mouse
|
| 60 |
+
|
| 61 |
+
# Access predictions by head name and resolution:
|
| 62 |
+
# - preds['atac'][1]: 1bp resolution, shape (batch, 131072, 256)
|
| 63 |
+
# - preds['atac'][128]: 128bp resolution, shape (batch, 1024, 256)
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
## Model Outputs
|
| 67 |
+
|
| 68 |
+
| Head | Tracks | Resolutions | Description |
|
| 69 |
+
|------|--------|-------------|-------------|
|
| 70 |
+
| atac | 256 | 1bp, 128bp | Chromatin accessibility |
|
| 71 |
+
| dnase | 384 | 1bp, 128bp | DNase-seq |
|
| 72 |
+
| procap | 128 | 1bp, 128bp | Transcription initiation |
|
| 73 |
+
| cage | 640 | 1bp, 128bp | 5' cap RNA |
|
| 74 |
+
| rnaseq | 768 | 1bp, 128bp | RNA expression |
|
| 75 |
+
| chip_tf | 1664 | 128bp | TF binding |
|
| 76 |
+
| chip_histone | 1152 | 128bp | Histone modifications |
|
| 77 |
+
| contact_maps | 28 | 64x64 | 3D chromatin contacts |
|
| 78 |
+
| splice_sites | 5 | 1bp | Splice site classification (D+, A+, D−, A−, None) |
|
| 79 |
+
| splice_junctions | 734 | pairwise | Junction read counts |
|
| 80 |
+
| splice_site_usage | 734 | 1bp | Splice site usage fraction |
|
| 81 |
+
|
| 82 |
+
## Installation
|
| 83 |
+
|
| 84 |
+
```bash
|
| 85 |
+
pip install alphagenome-pytorch
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
## License
|
| 89 |
+
|
| 90 |
+
The model weights were created by Google DeepMind and are the property of Google LLC.
|
| 91 |
+
They are released under the [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0),
|
| 92 |
+
consistent with the [official release on Kaggle](https://www.kaggle.com/models/google/alphagenome).
|
| 93 |
+
|
| 94 |
+
## Links
|
| 95 |
+
|
| 96 |
+
- [GitHub Repository](https://github.com/kundajelab/alphagenome-pytorch)
|
| 97 |
+
- [Reference JAX Implementation](https://github.com/google-deepmind/alphagenome_research) (official Google DeepMind code)
|
| 98 |
+
- [Original AlphaGenome Paper](https://www.nature.com/articles/s41586-025-10014-0)
|
| 99 |
+
- [AlphaGenome Documentation](https://www.alphagenomedocs.com/)
|
| 100 |
+
|
| 101 |
+
## Citation
|
| 102 |
+
|
| 103 |
+
```bibtex
|
| 104 |
+
@article{avsec2026alphagenome,
|
| 105 |
+
title={Advancing regulatory variant effect prediction with AlphaGenome},
|
| 106 |
+
author={Avsec, {\v{Z}}iga and Latysheva, Natasha and Cheng, Jun and Novati, Guido and Taylor, Kyle R and Ward, Tom and Bycroft, Clare and Nicolaisen, Lauren and Arvaniti, Eirini and Pan, Joshua and others},
|
| 107 |
+
journal={Nature},
|
| 108 |
+
volume={649},
|
| 109 |
+
number={8099},
|
| 110 |
+
pages={1206--1218},
|
| 111 |
+
year={2026},
|
| 112 |
+
publisher={Nature Publishing Group UK London}
|
| 113 |
+
}
|
| 114 |
+
```
|