
Complete Developer Guide
Integrate powerful DNA sequence analysis and variant effect prediction into your applications with our Python SDK and REST API.
Get up and running with AlphaGenome in minutes
Install the Python package using pip
pip install dr7-alphagenomeConfigure your authentication credentials
export DR7_API_KEY=your_keyMake your first prediction from command line
alphagenome predict seq.fafrom dr7_alphagenome import AlphaGenome
# Initialize the client
client = AlphaGenome(api_key="your_api_key")
# Predict from DNA sequence
sequence = "ATCGATCG..." * 125000 # 1Mb sequence
results = client.predict(
sequence=sequence,
modalities=["CAGE", "ATAC", "ChIP"],
cell_types=["K562", "HepG2"]
)
# Get variant effect predictions
variant_effect = client.score_variant(
chromosome="chr1",
position=12345,
ref="A",
alt="G"
)
print(f"Variant effect score: {variant_effect.score}")
print(f"Affected tracks: {variant_effect.top_affected_tracks}")Powerful endpoints for comprehensive genomics analysis
POST /v1/alphagenome/predict
Predict functional effects from raw DNA sequences. Returns predictions across 5,930 tracks covering gene expression, chromatin accessibility, and more.
POST /v1/alphagenome/variant
Score the functional impact of genetic variants. Compare reference and alternate allele predictions to quantify variant effects.
POST /v1/alphagenome/batch
Process multiple sequences or variants in a single request. Ideal for VCF files or genome-wide studies.
GET /v1/alphagenome/region
Query predictions for a specific genomic region. Useful for visualizing predictions in a genomic browser.
Learn by example with these common use cases
from dr7_alphagenome import AlphaGenome
client = AlphaGenome()
# Load sequence from FASTA file
results = client.predict_from_fasta(
"input.fa",
modalities=["CAGE", "ATAC", "DNase", "H3K27ac"],
output_format="bigwig"
)
# Results are saved as BigWig files for visualization
for track in results.tracks:
print(f"Saved: {track.output_path}")from dr7_alphagenome import AlphaGenome
client = AlphaGenome()
# Score a single variant
effect = client.score_variant(
chromosome="chr17",
position=7674220, # Near TP53 gene
ref="G",
alt="A",
window_size=100000 # Context around variant
)
print(f"Overall effect score: {effect.score:.4f}")
print(f"Gene expression change: {effect.expression_delta:.4f}")
print("Top affected cell types:")
for ct in effect.top_cell_types[:5]:
print(f" {ct.name}: {ct.score:.4f}")from dr7_alphagenome import AlphaGenome
client = AlphaGenome()
# Score variants from VCF file
results = client.score_vcf(
"variants.vcf",
reference="hg38",
output_file="scored_variants.tsv",
include_tracks=["CAGE", "enhancer_activity"],
parallel=True
)
print(f"Scored {results.total_variants} variants")
print(f"High-impact variants: {results.high_impact_count}")
# Filter for regulatory variants
regulatory = results.filter(
min_score=0.5,
affected_elements=["enhancer", "promoter"]
)
regulatory.to_dataframe().to_csv("regulatory_variants.csv")# REST API Example with curl
# Predict from sequence
curl -X POST https://api.dr7.ai/v1/alphagenome/predict \
-H "Authorization: Bearer $DR7_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sequence": "ATCGATCG...",
"modalities": ["CAGE", "ATAC"],
"cell_types": ["K562"]
}'
# Score variant
curl -X POST https://api.dr7.ai/v1/alphagenome/variant \
-H "Authorization: Bearer $DR7_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"chromosome": "chr1",
"position": 12345,
"ref": "A",
"alt": "G"
}'Ask our AI assistant for help with code examples, troubleshooting, or integration questions
Experience Genomics AI
Optimize your AlphaGenome API usage
Balance context length with processing time for optimal results.
Choose relevant cell types to focus your analysis.
Efficiently process large datasets with batch endpoints.
Build robust applications with proper error handling.
Get API access with higher rate limits, priority support, and advanced features.
Common technical questions about the AlphaGenome API
Free tier: 100 requests/day. Standard: 10,000 requests/day. Pro: 100,000 requests/day. Enterprise: Custom limits available. Rate limit headers are included in all API responses.
The API accepts raw DNA sequences (A, T, C, G characters), FASTA format, genomic coordinates (hg38), and VCF files for batch variant scoring. Sequences can be up to 1Mb in length.
For sequences longer than 1Mb, split them into overlapping windows and combine predictions. The SDK provides a sliding_window() helper function that handles this automatically.
JSON (default) for programmatic access, BigWig for genome browser visualization, BedGraph for text-based analysis, and TSV for tabular outputs. Batch jobs can also output compressed files.
Use Bearer token authentication with your API key. Set the DR7_API_KEY environment variable or pass it directly to the client constructor. API keys can be managed in your Dr7.ai dashboard.
Yes! Install with 'pip install dr7-alphagenome'. The SDK provides a high-level interface for all API endpoints, automatic retries, streaming support, and helper functions for common workflows.