跳到正文
cccskills
免费在 GitHub 公开

alphagenome-single-variant-analysis

Analyze a genetic variant with the AlphaGenome API to predict changes in gene activity, DNA accessibility, and RNA splicing, the joining of RNA segments. Produce comparison plots and a report highlighting effects across tissues.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

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.

查看安装方法

适用场景

  • Explore predicted effects of non-coding genetic variants
  • Compare predicted gene activity changes across tissues
  • Visualize changes in RNA splicing
  • Match tissue and cell names to standard identifiers

包含的文件(48)

  • SKILL.md11.7 KB
  • docs/alphagenome-api.md13.3 KB
  • docs/examples/model_limitation_RNU4ATAC/ism_skeletal_muscle_RNA_SEQ.png12.1 KB
  • docs/examples/model_limitation_RNU4ATAC/plot_skeletal_muscle_RNU4ATAC_detail.png76.3 KB
  • docs/examples/model_limitation_RNU4ATAC/plot_skeletal_muscle_RNU4ATAC_effects.png72.9 KB
  • docs/examples/model_limitation_RNU4ATAC/plot_skeletal_muscle_RNU4ATAC_wholegene.png78.3 KB
  • docs/examples/model_limitation_RNU4ATAC/README.md1.7 KB
  • docs/examples/model_limitation_RNU4ATAC/report.md3.7 KB
  • docs/examples/negative_result_GATA4/ism_heart_DNASE.png11.7 KB
  • docs/examples/negative_result_GATA4/plot_heart_GATA4_detail.png73.5 KB
  • docs/examples/negative_result_GATA4/plot_heart_GATA4_effects.png70.2 KB
  • docs/examples/negative_result_GATA4/plot_heart_GATA4_wholegene.png78.2 KB
  • docs/examples/negative_result_GATA4/README.md1.1 KB
  • docs/examples/negative_result_GATA4/report.md3.6 KB
  • docs/examples/negative_result_TGFB3/ism_heart_ATAC.png6.5 KB
  • docs/examples/negative_result_TGFB3/ism_heart_RNA_SEQ.png10.3 KB
  • docs/examples/negative_result_TGFB3/plot_heart_TGFB3_detail.png51.5 KB
  • docs/examples/negative_result_TGFB3/plot_heart_TGFB3_effects.png64.0 KB
  • docs/examples/negative_result_TGFB3/plot_heart_TGFB3_wholegene.png43.9 KB
  • docs/examples/negative_result_TGFB3/README.md1.2 KB
  • docs/examples/negative_result_TGFB3/report.md3.0 KB
  • docs/examples/polyadenylation_HBA2/ism_K562_RNA_SEQ.png10.8 KB
  • docs/examples/polyadenylation_HBA2/plot_K562_HBA2_effects.png158.5 KB
  • docs/examples/polyadenylation_HBA2/plot_K562_HBA2_wholegene.png159.3 KB
  • docs/examples/polyadenylation_HBA2/README.md1.1 KB
  • docs/examples/polyadenylation_HBA2/report.md3.1 KB
  • docs/examples/regulatory/apoa1_promoter/ism_heart_left_ventricle_RNA_SEQ.png8.6 KB
  • docs/examples/regulatory/apoa1_promoter/ism_liver_RNA_SEQ.png8.6 KB
  • docs/examples/regulatory/apoa1_promoter/plot_heart_left_ventricle_APOA1_effects.png73.0 KB
  • docs/examples/regulatory/apoa1_promoter/plot_liver_APOA1_effects.png221.5 KB
  • docs/examples/regulatory/apoa1_promoter/report.md3.4 KB
  • docs/examples/regulatory/README.md1.2 KB
  • docs/examples/splicing/col6a2_exon_extension.png101.4 KB
  • docs/examples/splicing/col6a2_report.md2.2 KB
  • docs/examples/splicing/dlg1_exon_skipping.png73.1 KB
  • docs/examples/splicing/dlg1_report.md1.9 KB
  • docs/examples/splicing/README.md1.3 KB
  • docs/interpretation-guide.md17.4 KB
  • docs/report-templates.md2.8 KB
  • pyproject.toml269 B
  • references/citation.bib823 B
  • scripts/analyze_ism.py10.1 KB
  • scripts/generate_ontology_mapping.py4.8 KB
  • scripts/interpret_splicing.py9.5 KB
  • scripts/lookup_gene_info.py9.8 KB
  • scripts/resolve_ontology_terms.py5.5 KB
  • scripts/visualize_genome_tracks.py12.4 KB
  • scripts/visualize_variant_effects.py37.0 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Retrieve AlphaFold protein structures using a UniProt ID and summarize prediction confidence, boundaries of rigid structural regions, and likely disordered regions. Downloaded structure files and error estimates support further examination of the results.

中文简介正在准备中。当前显示英语简介。

  • Check confidence in a predicted protein structure
  • Identify boundaries of rigid structural regions
  • Assess regions likely to lack a stable structure
google-deepmind/science-skills33212026年10月15日 更新

Create links that open specific genetic variants or genomic regions in AlphaGenome Atlas. Set tissue and display filters, build linked candidate tables, and open charts comparing predictions for reference and alternate DNA sequences.

中文简介正在准备中。当前显示英语简介。

  • Open a specific genetic variant in AlphaGenome Atlas
  • Explore a genomic region with selected display filters
  • Build a candidate variant table with clickable links
google-deepmind/science-skills33212026年10月15日 更新

Use AlphaGenome scores to investigate predicted molecular effects of genetic variants, annotate variant files, and rank research candidates. Scan genomic regions for single nucleotide substitutions and retrieve matching gene structures, including exon and splice junction coordinates.

中文简介正在准备中。当前显示英语简介。

  • Inspecting predicted functional effects of individual variants
  • Annotating variant files and ranking research candidates
  • Scanning genomic regions for impactful single nucleotide substitutions
google-deepmind/science-skills33212026年10月15日 更新

Search ChEMBL for compounds, drug targets, and measured biological activity. Retrieve drug mechanisms, compare activity values in a common unit, find similar chemical structures, and download structure files or images for further analysis.

中文简介正在准备中。当前显示英语简介。

  • Find compounds and their drug targets
  • Compare IC50 values in a common unit
  • Check drug mechanisms and indications
google-deepmind/science-skills33212026年10月15日 更新

Search ClinicalTrials.gov for studies by condition, treatment, location, recruitment status, or trial phase. Retrieve individual trial details and participation criteria, count matching studies, and explore trials run by a particular company or institution.

中文简介正在准备中。当前显示英语简介。

  • Finding recruiting trials by condition and location
  • Checking trial participation and exclusion criteria
  • Counting studies by condition, phase, or time period
google-deepmind/science-skills33212026年10月15日 更新

Look up human genetic variants in ClinVar to retrieve disease-related classifications, review status, associated conditions, and evidence from submitting laboratories. Compare conflicting interpretations or find variants classified as pathogenic for benchmark controls.

中文简介正在准备中。当前显示英语简介。

  • Checking a variant's disease-related classification
  • Comparing interpretations from different laboratories
  • Finding pathogenic variants for benchmark controls
google-deepmind/science-skills33212026年10月15日 更新

查看 google-deepmind 的全部技能

报告此技能的问题