Generated banner for Alphagenome Single Variant Analysis
Generated logo for Alphagenome Single Variant Analysis

Alphagenome Single Variant Analysis

Google DeepMindOfficialPublished by Google DeepMind

  • Skill
  • Tool integration
  • Science and research
  • Apache-2.0
  • Low risk
  • Has scripts

From the author

Analyzes genetic variant effects on gene expression (RNA-seq), chromatin accessibility (DNASE), histone marks (ChIP), and transcription factors using the AlphaGenome API. Use when the user asks about non-coding variant effects, pathogenicity, clinical significance, disease associations, functional effects, gene expression changes, splicing disruption, or regulatory effects in promoters and enhancers. Also use for resolving biological terms to tissue/cell-type ontologies (UBERON/CL) or analyzing variants in chr:pos:ref>alt format.
— the description by Google DeepMind

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

The AlphaGenome Single Variant Analysis skill provides a structured workflow for investigating how specific genetic variants influence biological processes. It leverages the AlphaGenome API to predict effects on RNA-seq expression, chromatin accessibility, histone marks, and transcription factor binding. The skill includes robust procedures for resolving biological ontologies, performing discovery scans for tissue-specific effects, and visualizing variant impacts through detailed genomic tracks and splicing analysis. It emphasizes rigorous interpretation through standardized reporting templates and mandatory adherence to provided interpretation guides.

What it does

  • Performs discovery scans to identify significant variant effects across diverse tissues and modalities.
  • Resolves biological terms and tissue/cell-type names to standard UBERON/CL ontologies.
  • Visualizes variant effects on gene expression, splicing, and regulatory regions.
  • Generates structured, evidence-based analysis reports following predefined templates.
  • Supports in-silico mutagenesis (ISM) and quantitative splicing analysis.
  • Provides tools for local gene and transcript lookup using GTF data.

When to use it

  • When investigating the functional consequences of non-coding genetic variants.
  • When assessing the pathogenicity or clinical significance of a variant in a specific disease context.
  • When analyzing how a variant disrupts regulatory elements like promoters and enhancers.
  • When exploring tissue-specific gene expression changes or splicing disruption caused by a variant.
  • When you need to map biological terms to standardized ontologies for downstream analysis.

Advantages

  • Provides a standardized, reproducible workflow for complex genomic variant interpretation.
  • Integrates multi-omic data types (RNA-seq, DNASE, ChIP) for comprehensive functional insights.
  • Includes specific strategies for handling complex events like splicing skipping and large genes.
  • Enforces rigorous reporting standards to ensure consistency and clarity in findings.
  • Utilizes local GTF data for efficient and offline-capable gene lookups.

Usage examples

“Analyze the functional impact of the variant chr2:1234:A>C in liver tissue.”
The agent will perform a discovery scan, filter for liver-related biosamples, generate visualization plots for the variant, and produce a structured report detailing the predicted regulatory and expression effects.
“What is the effect of chr1:5000:G>T on splicing in neurons?”
The agent will use the interpret_splicing script to quantify delta scores and junction changes, visualize the splicing event with appropriate flanking exons, and summarize the findings in a report.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/google-deepmind/alphagenome-single-variant-analysis/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip alphagenome-single-variant-analysis.zip -d .agents/skills

Documentation by Google DeepMind

Variant Analysis using AlphaGenome

Prerequisites

  1. uv: Read the uv skill and follow its Setup instructions to ensure uv is installed and on PATH.

  2. User Notification: If .licenses/alphagenome_single_variant_analysis_LICENSE.txt does not already exist in the workspace root directory then (1) prominently notify the user to check the terms at https://deepmind.google.com/science/alphagenome/, then (2) create the file recording the notification text and timestamp.

  3. .env file: Make sure the .env file exists in your home directory. Create one if it does not exist.

  4. ALPHAGENOME_API_KEY: This skill requires an API key to function.

    You can register for a key at https://deepmind.google.com/science/alphagenome/. You MUST use the safe credentials protocol in the credentials skill to check for and request this key if this skill looks relevant to the user's request.

  5. ALPHAGENOME_GTF_PATH (Optional): Accelerate gene/transcript lookup by pointing to a local copy of the GTF feather file instead of downloading from GCS:

    echo "ALPHAGENOME_GTF_PATH=/path/to/local/gencode.v46.annotation.gtf.gz.feather" >> ~/.env

Core Rules

  • NEVER run python3 or python3 -c directly. The system Python does not necessarily have pandas, numpy, and other key dependencies. ALWAYS use uv run to run ALL Python code — including scripts, ad-hoc analysis files, and one-liners. Do not attempt to pip install or create new venvs — uv manages an isolated environment automatically.

  • Offline Only: NEVER use external APIs (e.g., MyGene.info, Ensembl REST) for gene/transcript lookup. Use lookup_gene_info.py with the local GTF. If it fails, fix the environment/paths, do not switch to external APIs.

  • API Key is required: ALPHAGENOME_API_KEY must be set before running any script.

  • Notification: If this skill is used, ensure this is mentioned in the output.

  • Report Format: Always use the templates in docs/report-templates.md for generating analysis reports, and ensure to include the table of top hits from the discovery scan.

Environment Setup & Troubleshooting

Python Environment

All scripts must be executed using uv run, which manages an isolated virtual environment with the correct dependencies via uv.

uv run <script_name> [args...]

For ad-hoc scripts (e.g., inline analysis code saved to a temp file), pass the full path instead of a short name:

uv run --project $SKILL_DIR /tmp/my_analysis.py --arg1 val1

[!NOTE] The first invocation resolves and installs dependencies (~10s). Subsequent runs use the cached environment and start instantly. The cache lives in ~/.cache/uv/.

Common Issues
  • Column Names: tidy_scores and metadata often use gene_name (not gene_symbol) and output_type (not modality). Always inspect df.columns before filtering.

  • Large Genes: Genes > 500kb (e.g., USH2A) break the whole_gene view. Use --view detail or manual regional windows instead.

  • Sashimi Strand Error: plot_components.Sashimi does NOT accept a strand argument directly. Filter input tracks instead.

  • KeyError: 'ontology_curie': Not all tracks have ontology_curie. Check track.metadata.columns before filtering.

  • Python Path: If exec: "python": executable file not found occurs, ensure you are using uv run instead of bare python/python3.

  • NotImplementedError (pandas): "iLocation based boolean indexing on an integer type is not available". This occurs when using boolean masks with .iloc on integer-indexed DataFrames in newer pandas versions. Fix: Convert boolean masks to integer indices using np.flatnonzero(mask).

  • GTF Feather Case Sensitivity: The AlphaGenome GTF Feather file uses Capitalized column names (Feature, Start, End, Strand) unlike standard GTF files. Always check df.columns if getting KeyErrors.

  • score_variant ontology filtering: score_variant does NOT accept ontology_terms as an argument. You must filter the returned AnnData objects manually by inspecting adata.var columns. In contrast, predict_variant DOES accept ontology_terms directly.

  • Sashimi Zoom Logic: To ensure "skipping" arcs are visible, expand the zoom to include the flanking exons rather than relying on junction overlap alone.

  • Junction Scores: Raw Junction objects from prediction may be simple Intervals. Use junction_data.get_junctions_to_plot(predictions=..., name=...) to retrieve objects with the .k (abundance/score) attribute.

  • uv Not Found: If exec: uv: not found, follow the installation instructions in Prerequisites.

  • Registry Authentication Error (401): If uv fails with 401 Unauthorized for a private registry, set UV_INDEX_URL=https://pypi.org/simple before running the script.

References


Code Patterns

Broad Discovery Scan

Use score_variant across differential scorers only to discover unexpected tissue effects.

from alphagenome.models import dna_client
from alphagenome.models import variant_scorers
from alphagenome.data import genome
import os
import pandas as pd
import dotenv

# Load environment variables from ~/.env
dotenv.load_dotenv(os.path.expanduser('~/.env'))

# Setup API Key and Client
dna_model = dna_client.create(api_key=os.environ.get('ALPHAGENOME_API_KEY'),
                              address='dns:///gdmscience.googleapis.com:443')

# Define Variant (example)
variant_str = "chr2:1234:A>C"
chrom, pos_str, ref_alt = variant_str.split(':')
ref, alt = ref_alt.split('>')
pos = int(pos_str)

# Use supported sequence length (e.g., 2**20 for optimal performance)
SEQ_LENGTH = 2**20
interval = genome.Interval(chrom, pos - SEQ_LENGTH // 2, pos + SEQ_LENGTH // 2)
variant = genome.Variant(chrom, pos, ref, alt)

scorers = [
    variant_scorers.RECOMMENDED_VARIANT_SCORERS[m]
    for m in variant_scorers.RECOMMENDED_VARIANT_SCORERS
    if "ACTIVE" not in m and "CAGE" not in m and "PROCAP" not in m
]

print(f"Scoring variant {variant_str}...")
scores_list = dna_model.score_variant(interval=interval, variant=variant, variant_scorers=scorers)

# Process and Display Results
all_dfs = []
for score_adata in scores_list:
    df = variant_scorers.tidy_scores([score_adata], match_gene_strand=True)
    if df is not None:
        all_dfs.append(df)

if all_dfs:
    df = pd.concat(all_dfs)
    significant = df[df['quantile_score'].abs() > 0.995]
    ranked = significant.sort_values('raw_score', key=abs, ascending=False)
    print("Top Significant Hits:")
    print(ranked[['biosample_name', 'gene_name', 'output_type', 'quantile_score', 'raw_score']])
Extended Search for Disease-Relevant Tissues
# Define keywords based on disease context
disease_keywords = ["liver", "hepatocyte"]

# Filter for any match
mask = df['biosample_name'].str.contains('|'.join(disease_keywords), case=False, na=False)

relevant_hits = df[mask].sort_values('raw_score', key=abs, ascending=False)
print(f"\n--- Extended Analysis (Keywords: {disease_keywords}) ---")
print(relevant_hits.head(20)[['biosample_name', 'output_type', 'raw_score', 'quantile_score']])

Workflow Checklist

Variant Analysis Progress:
- [ ] Step 0: Review Golden Examples (MANDATORY)
- [ ] Step 1: Create Output Folder and Setup
- [ ] Step 2: Parse User Query & Research
- [ ] Step 3: Resolve Tissues & Modalities
- [ ] Step 4: Visualize & Save Plots
- [ ] Step 5: Analyze Predictions (view plots, no code). MANDATORY: Read [interpretation-guide.md](docs/interpretation-guide.md) before interpreting results.
- [ ] Step 6: Write Report, save it as `report.md` (MANDATORY)
- [ ] Step 7: Self-Critique (view `report.md` to verify links & claims)
- [ ] Step 8: Make artifact out of `report.md`

Multi-Variant Workflow

If multiple variants are specified, spawn sub-agents to run each variant analysis and then synthesize each report.md into a single report.

Script Reference
ScriptPurpose
lookup_gene_infoComprehensive gene and transcript lookup using
: : GTF data :
resolve_ontology_termsBiological terms → UBERON/CL/EFO IDs
visualize_variant_effectsREF/ALT visualization (expression, regulatory,
: : splicing) :
analyze_ismIn-Silico Mutagenesis SeqLogo generation
interpret_splicingQuantitative splicing analysis (delta scores,
: : junctions) :
visualize_genome_tracksGenomic track visualization for a region

Files

scripts/interpret_splicing.py

# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Quantitative analysis of splicing effects (Splice Sites & Junctions).

This script provides high-resolution, quantitative analysis of splicing changes.
While discovery scans give summary scores, this script analyzes specific
junctions to detect events like exon skipping or cryptic splicing.

Design Note:
  This tool provides quantitative analysis of specific splice junctions,
  complementary to analyze_ism.py which can be used to analyze motifs affecting
  splice site usage. While ISM helps identify *why* a site was lost or gained
  (motif disruption), this script reveals *what* structural changes occurred
  (e.g., exon skipping or cryptic junction usage). It offloads final judgment
  to the agent but provides heuristic flags (e.g., GAIN/LOSS) to guide the analysis.

Usage:
  uv run scripts/interpret_splicing.py --chrom=chr21 --pos=46126238 --ref=G --alt=C \
      --ontology_id=CL:0002545
"""

# /// script
# requires-python = ">=3.10"
# dependencies = [
#   "alphagenome",
#   "numpy",
#   "pandas",
#   "python-dotenv",
# ]
# ///

from __future__ import annotations

import argparse
import os
from typing import Any, Sequence

from alphagenome.data import genome
from alphagenome.models import dna_client
import dotenv
import numpy as np
import pandas as pd

API_ADDRESS = 'dns:///gdmscience.googleapis.com:443'


def get_track(obj: Any, attr: str, curie: str) -> Any:
  """Retrieves a track filtered by ontology CURIE."""
  if not hasattr(obj, attr):
    print(f"Warning: Object missing attribute '{attr}'.")
    return None
  data = getattr(obj, attr)
  if hasattr(data, 'filter_by_ontology'):
    return data.filter_by_ontology(curie)
  mask = data.metadata['ontology_curie'] == curie
  if not mask.any():
    print(f"Info: No data found for ontology term '{curie}' in track '{attr}'.")
    return None
  return data.filter_tracks(mask.values)


def junctions_to_df(junc_track: Any) -> pd.DataFrame:
  """Converts a JunctionTrack to a DataFrame."""
  if junc_track is None or len(junc_track.junctions) == 0:
    return pd.DataFrame()

  scores = None
  if hasattr(junc_track, 'values'):
    vals = junc_track.values
    # Handle different shapes of values array from API
    if vals.shape[0] == len(junc_track.junctions):
      scores = vals.mean(axis=1)
    elif len(vals.shape) > 1 and vals.shape[1] == len(junc_track.junctions):
      scores = vals.mean(axis=0)
    elif len(vals.shape) == 1 and len(vals) == len(junc_track.junctions):
      scores = vals

  if scores is None:
    print('Warning: Failed to parse scores for junctions.')
    return pd.DataFrame()

  rows = []
  for junction, score in zip(junc_track.junctions, scores):
    rows.append({
        'start': junction.start,
        'end': junction.end,
        'score': float(score),
        'strand': junction.strand,
    })
  return pd.DataFrame(rows)


def analyze_splicing(
    chrom: str,
    pos: int,
    ref: str,
    alt: str,
    ontology_id: str,
    window: int,
) -> None:
  """Runs the splicing analysis for a specific variant."""
  api_key = os.environ.get('ALPHAGENOME_API_KEY')
  if not api_key:
    raise ValueError('ALPHAGENOME_API_KEY environment variable not set.')

  dna_model = dna_client.create(api_key=api_key, address=API_ADDRESS)

  variant = genome.Variant(chrom, pos, ref, alt)
  zoom_interval = genome.Interval(chrom, pos - window // 2, pos + window // 2)
  pred_interval = zoom_interval.resize(131072)

  print(
      f'Quantifying splicing changes for {chrom}:{pos}:{ref}>{alt} in'
      f' {ontology_id}...'
  )

  requested_outputs = [
      dna_client.OutputType.SPLICE_JUNCTIONS,
      dna_client.OutputType.SPLICE_SITE_USAGE,
      dna_client.OutputType.RNA_SEQ,
  ]

  prediction = dna_model.predict_variant(
      interval=pred_interval,
      variant=variant,
      requested_outputs=requested_outputs,
      ontology_terms=[ontology_id],
  )

  print('\n--- Splice Site Usage Analysis ---')
  ss_ref = get_track(prediction.reference, 'splice_site_usage', ontology_id)
  ss_alt = get_track(prediction.alternate, 'splice_site_usage', ontology_id)

  if ss_ref and ss_alt:
    start = pred_interval.start
    idx = pos - start

    for offset in range(-2, 3):
      position = pos + offset
      index = idx + offset
      try:
        val_ref = (
            ss_ref.values[index].mean()
            if ss_ref.values.ndim > 1
            else ss_ref.values[index]
        )
        val_alt = (
            ss_alt.values[index].mean()
            if ss_alt.values.ndim > 1
            else ss_alt.values[index]
        )

        diff = val_alt - val_ref
        if abs(diff) > 0.05:
          print(
              f'Position {position} (Offset {offset}): REF={val_ref:.3f},'
              f' ALT={val_alt:.3f}, Delta={diff:.3f}'
          )
          if val_ref > 0.5 and val_alt < 0.1:
            print(f'  -> Loss of strong splice site at {position}!')
          elif val_ref < 0.1 and val_alt > 0.5:
            print(f'  -> Gain of new splice site at {position}!')
      except (IndexError, AttributeError, ValueError) as e:
        if not isinstance(e, IndexError):
          print(f'Warning: Error during splice site diff calculation: {e}')
        pass
  else:
    print('Splice site usage track missing.')

  print('\n--- Junction Analysis ---')
  junc_ref = prediction.reference.splice_junctions.filter_by_ontology(
      ontology_id
  )
  junc_alt = prediction.alternate.splice_junctions.filter_by_ontology(
      ontology_id
  )

  df_ref = junctions_to_df(junc_ref)
  df_alt = junctions_to_df(junc_alt)

  if not df_ref.empty and not df_alt.empty:
    merged = pd.merge(
        df_ref,
        df_alt,
        on=['start', 'end', 'strand'],
        how='outer',
        suffixes=('_REF', '_ALT'),
    ).fillna(0)
    merged['delta'] = merged['score_ALT'] - merged['score_REF']

    # Junctions overlapping variant
    variant_overlapping = merged[
        (merged['start'] < pos) & (merged['end'] > pos)
    ]

    print(f'Junctions overlapping variant ({pos}):')
    if variant_overlapping.empty:
      print('  None found.')
    else:
      for _, row in variant_overlapping.iterrows():
        print(
            f"  {int(row['start'])}-{int(row['end'])} (Strand {row['strand']}):"
            f" REF={row['score_REF']:.2f}, ALT={row['score_ALT']:.2f},"
            f" Delta={row['delta']:.2f}"
        )
        if row['score_REF'] > 5 and row['score_ALT'] < 1:
          print('  -> Skipping/Loss of canonical intron (Exon skipping?)')

    # Cryptic Junctions (Gain in ALT)
    cryptic = merged[(merged['score_ALT'] > 5) & (merged['score_REF'] < 1)]
    if not cryptic.empty:
      print('\nPotential Cryptic Junctions (Gain in ALT):')
      for _, row in cryptic.iterrows():
        print(
            f"  {int(row['start'])}-{int(row['end'])}:"
            f" REF={row['score_REF']:.2f} -> ALT={row['score_ALT']:.2f}"
        )

    print('\nTop 5 Most Changed Junctions:')
    top_changes = merged.reindex(
        merged['delta'].abs().sort_values(ascending=False).index
    ).head(5)
    print(top_changes[['start', 'end', 'score_REF', 'score_ALT', 'delta']])
  else:
    print('No junctions found or failed to parse.')

  print('\n--- RNA-seq Analysis ---')
  rna_ref = get_track(prediction.reference, 'rna_seq', ontology_id)
  rna_alt = get_track(prediction.alternate, 'rna_seq', ontology_id)

  if rna_ref and rna_alt:
    start_idx = pos - pred_interval.start - 50
    end_idx = pos - pred_interval.start + 50

    def safe_mean(arr: np.ndarray) -> np.ndarray:
      if arr.ndim > 1:
        return arr.mean(axis=1)
      return arr

    ref_vals = safe_mean(rna_ref.values)
    alt_vals = safe_mean(rna_alt.values)

    ref_window = ref_vals[start_idx:end_idx]
    alt_window = alt_vals[start_idx:end_idx]

    print(
        f'Mean RNA Coverage (+/- 50bp): REF={ref_window.mean():.2f},'
        f' ALT={alt_window.mean():.2f}'
    )
    if ref_window.mean() > 0:
      log2fc = np.log2((alt_window.mean() + 1e-3) / (ref_window.mean() + 1e-3))
      print(f'Log2 Fold Change at variant: {log2fc:.2f}')
  else:
    print('RNA-seq track missing.')


def main(argv: Sequence[str] | None = None) -> None:
  """Main entry point for the splicing analysis CLI tool."""
  dotenv.load_dotenv(os.path.expanduser('~/.env'))
  parser = argparse.ArgumentParser(
      description='Quantitative analysis of splicing effects.'
  )
  parser.add_argument(
      '--chrom', required=True, help='Chromosome (e.g., chr21).'
  )
  parser.add_argument(
      '--pos', type=int, required=True, help='Position (1-based).'
  )
  parser.add_argument('--ref', required=True, help='Reference allele.')
  parser.add_argument('--alt', required=True, help='Alternate allele.')
  parser.add_argument(
      '--ontology_id', required=True, help='Ontology CURIE (e.g., CL:0002545).'
  )
  parser.add_argument(
      '--window',
      type=int,
      default=1500,
      help='Window size around variant for analysis.',
  )
  args = parser.parse_args(argv)

  analyze_splicing(
      args.chrom,
      args.pos,
      args.ref,
      args.alt,
      args.ontology_id,
      args.window,
  )


if __name__ == '__main__':
  main()

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs an API key, Needs Python

Security

What our scanner noticed· Low risk

  • Instructions that use the network
  • Scripts that your agent may run

This skill includes scripts that your agent may run. Read them before you use it.

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Google DeepMind
Publisher
Google DeepMind (Official)
Source
google-deepmind/science-skills · skills/alphagenome_single_variant_analysis · commit 4de6786
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Google DeepMind or Google DeepMind.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download alphagenome-single-variant-analysis.zip