AlphaGenome

repository·main·Indexed 24 days ago

https://github.com/google-deepmind/alphagenome

A Google DeepMind API and client library for predicting functional genomic outputs, such as gene expression, splicing, chromatin features, and contact maps, from DNA sequences. It allows researchers to analyze the regulatory effects of genomic variants at single base pair resolution for sequences up to 1 million base pairs. The library includes tools for batch variant scoring, VCF processing, and visualization via Sashimi plots and track overlays.

Tokens
18.2K
Snippets
27
Records
99
Agent score
83%

What's inside AlphaGenome

  1. Overview of AlphaGenome capabilities

    main

    AlphaGenome is a multimodal model designed to decipher regulatory code within DNA sequences. It can analyze DNA sequences up to 1 million base pairs in length and provides predictions at single base-pair resolution for various functional outputs, including:

    • Gene expression
    • Splicing patterns
    • Chromatin features
    • Contact maps

    The API is provided as a free service for non-commercial use. It is optimized for small to medium-scale analyses (e.g., thousands of predictions) and may not be suitable for large-scale analyses exceeding 1 million predictions due to varying query rates.

  2. Overview of AlphaGenome API

    main
    AlphaGenome is a deep learning genomics model designed for genome interpretation. It accepts genomic (DNA) sequences as input and predicts various molecular properties of DNA and RNA. Many of these predictions are provided at single base pair resolution, allowing for high-precision genomic analysis.
  3. Explore the AlphaGenome API modules

    main

    The AlphaGenome API is organized into four primary functional modules:

    • Data: Provides classes and utilities for manipulating genomics data.
    • Models: Contains the AlphaGenome client and various variant scorers.
    • Interpretation: Includes tools for sequence interpretation, such as in silico mutagenesis.
    • Visualization: Offers tools for plotting and visualizing genomic data and model outputs.
  4. AlphaGenome API Overview

    main

    AlphaGenome is a unifying model for deciphering regulatory DNA sequences. It provides multimodal predictions for functional outputs including:

    • Gene expression
    • Splicing patterns
    • Chromatin features
    • Contact maps

    The model analyzes DNA sequences up to 1 million base pairs and provides predictions at single base-pair resolution for most outputs.

    Usage Constraints:

    • The API is free for non-commercial use.
    • It is optimized for small to medium-scale analyses (thousands of predictions).
    • It is not suitable for large-scale analyses requiring more than 1 million predictions.
  5. How variant scoring works in AlphaGenome

    main

    AlphaGenome scores genomic variants by treating them as a pair of sequences: the reference (REF) and the alternate (ALT) alleles. The variant effect is estimated by comparing AlphaGenome predictions for these two sequences across different modalities.

    The scoring process follows these steps:

    1. Generate Predictions: Create REF and ALT predictions for a specific modality (e.g., RNA-SEQ, ATAC) within the variant's sequence interval.
    2. Indel Alignment (Optional): For insertions or deletions, the ALT prediction profile is aligned to the REF coordinate space. Inserted bases use the maximum value over the segment, while deleted bases are treated as zero signal.
    3. Apply Spatial Mask: Discard values outside a defined region of interest (e.g., a window centered on the variant or a gene body from a GTF file).
    4. Aggregate and Compute Difference: Reduce the spatial data (using mean, sum, etc.), optionally apply scaling (like log), and compute the difference ALT - REF to produce a single scalar value per track.
    5. Aggregate Tracks (Optional): Perform further aggregation (e.g., mean or max) across all tracks, subsets of tracks, or a specific sample track.
  6. Understand the difference between `raw_score` and `quantile_score`

    main

    AlphaGenome provides two types of scores to help interpret variant impact:

    • raw_score: The direct output of a specific variant scoring strategy. These vary in scale depending on the track and modality (e.g., Splice Site Usage is [0, 1], while Gene Expression can be unbounded).
    • quantile_score: A standardized score representing the rank of the raw_score within a background distribution of common variants (MAF > 0.01 in GnomAD v3).
      • A score of 0.99 means the variant's impact is at the 99th percentile of common variants.
      • Quantile scores are bounded between approximately -0.999990 and 0.999990.
      • For signed scores (indicating direction like up/down-regulation), quantile probabilities are linearly transformed to a [-1, 1] range.

    Recommendation: Use quantile_score to compare impact across different tracks/strategies, and use raw_score to measure the specific magnitude of an effect.

  7. Understand Active Allele Scorers

    main

    While standard variant scoring quantifies the change between REF and ALT (ALT - REF), Active Allele Scorers capture the absolute activity level associated with one of the alleles.

    These are calculated by taking the maximum of the aggregated signals from the REF and ALT alleles over the masked region. Recommended configurations include:

    • Gene expression (RNA-seq): max(mean(ALT), mean(REF)) across exons.
    • TSS activity / Chromatin Accessibility / TF binding: max(sum(ALT), sum(REF)) within a local 501-bp window.
    • Histone modifications: max(sum(ALT), sum(REF)) within a local 2001-bp window.
  8. Interpret model output tracks and strandedness

    main

    Model outputs consist of multiple 'tracks' representing different cell types, tissues, or transcription factors.

    Strandedness

    Tracks are categorized by how they handle DNA strands:

    • Positive (+): Measurements from the forward strand (5'->3').
    • Negative (-): Measurements from the reverse strand (3'->5').
    • Unstranded (.): Measurements that do not distinguish between strands (e.g., ATAC-seq).

    For stranded assays, there will be two tracks per cell/tissue type (one for + and one for -). For unstranded assays, there is a single track annotated as ..

    You can use convenience methods on TrackData objects to manipulate data based on strand, such as TrackData.filter_to_negative_strand().

  9. Configure aggregation logic using AggregationType

    main

    Aggregation logic is controlled via the alphagenome.models.variant_scorers.AggregationType class. The names of the options follow the order of operations, where the right-most operation is applied first to the model predictions.

    For example, AggregationType.DIFF_SUM_LOG2 performs the following sequence:

    1. Applies a log transform to the track data.
    2. Performs a sum over the spatial axis.
    3. Returns the difference ALT - REF.

    Each aggregation type results in a single scalar value per track.

  10. Getting started with AlphaGenome

    main

    To begin using AlphaGenome, follow these steps:

    1. Obtain an API key: You must get an API key to access the service.
    2. Follow a guide: Use the Quick Start Guide for an interactive introduction or watch the AlphaGenome 101 tutorial.
    3. Explore documentation: Refer to the installation guide, tutorials (covering plotting and variant scoring), and the API reference for detailed technical specifications.