AlphaGenome
raw JSON → 0.6.1 verified Sat May 09 auth: no python
A Python SDK developed by Google DeepMind for interacting with and visualizing genomic models. Currently at version 0.6.1, it supports interval scoring, in-silico mutagenesis, variant normalization, and sequence logo plotting. Requires Python >=3.10 and has a rapid release cadence (minor versions every few weeks).
pip install alphagenome Common errors
error AttributeError: module 'alphagenome' has no attribute 'AlphaGenome' ↓
cause Importing the top-level package without using the correct import statement.
fix
Use
from alphagenome import AlphaGenome instead of import alphagenome. error ImportError: cannot import name 'Interval' from 'alphagenome' ↓
cause Misspelled class name or incorrect import path.
fix
Use
from alphagenome import Interval. Note that the class is named 'Interval' (not 'Interval' with capital I). error ValueError: Interval length must be at least 10000 ↓
cause In v0.5.0+ intervals shorter than 10kb are not supported.
fix
Increase interval length to >=10000, or ensure your interval spans sufficient base pairs.
Warnings
breaking In v0.5.0, support for 2kb DNA sequence lengths was removed. AlphaGenome performs poorly with very short sequences, so any code relying on intervals < ~10kb may break or produce unreliable results. ↓
fix Use intervals >= 10kb or set a larger width. Remove any hardcoded 2kb assumptions.
deprecated In v0.6.0, `filter_by_strand` on Output dataclass now correctly filters splice junctions. Previously only tracks were filtered; if your code depended on the old behavior (unfiltered junctions), update filtering logic. ↓
fix After upgrading to v0.6.0, verify that filtering by strand works as expected for both tracks and junctions.
gotcha The API key must be set via environment variable `ALPHAGENOME_API_KEY` or passed directly; otherwise calls will fail with authentication errors. The SDK does not prompt for a key. ↓
fix Set the environment variable before using AlphaGenome: os.environ['ALPHAGENOME_API_KEY'] = 'your_key'
Imports
- AlphaGenome wrong
import alphagenomecorrectfrom alphagenome import AlphaGenome - Interval wrong
from alphagenome.core import Intervalcorrectfrom alphagenome import Interval - Variant
from alphagenome import Variant
Quickstart
from alphagenome import AlphaGenome, Interval, GRCh38
import os
# Initialize the model (requires API key via environment variable)
api_key = os.environ.get("ALPHAGENOME_API_KEY", "")
model = AlphaGenome(api_key=api_key)
# Define an interval and get predictions
interval = Interval(chrom="chr1", start=10000, end=20000)
tracks = model.predict_sequence(interval, genome=GRCh38)
print(tracks)