AlphaGenome Variant Impact (AVI) Analysis Score and prioritize genetic variants using AlphaGenome Variant Impact (AVI) models via . [!IMPORTANT] Research Use Only & Clinical Safety Rules : The AlphaGenome AVI Skill and the underlying AlphaGenome model/Atlas are strictly research tools . Access to outputs requires an AlphaGenome API key subject to terms of service prohibiting clinical use. 1. No Medical Advice or Clinical Diagnosis : You MUST NOT provide medical advice, clinical diagnoses, disease management strategies, or treatment recommendations based on outputs from this skill or the Alpha…

, args.region\n )\n if not region_match:\n raise ValueError(\n f'Invalid region string: {args.region}. Expected format chr:start-end'\n ' (e.g. chr9:128225900-128226000).'\n )\n\n chrom = region_match.group(1)\n start_pos = int(region_match.group(2))\n end_pos = int(region_match.group(3))\n\n if end_pos \u003c start_pos:\n raise ValueError(\n f'End position ({end_pos}) must be >= start position ({start_pos}).'\n )\n\n window_size = end_pos - start_pos + 1\n if window_size > args.max_window_size:\n raise ValueError(\n f'Requested region size ({window_size} bp) exceeds maximum window size'\n f' ({args.max_window_size} bp). Please specify a smaller region or'\n ' increase --max_window_size.'\n )\n\n print(f'Scanning region {chrom}:{start_pos}-{end_pos} ({window_size} bp)...')\n\n chrom_normalized = _normalize_chrom(chrom, with_chr_prefix=True)\n # Convert 1-based closed CLI interval [start, end] to 0-based half-open [start-1, end)\n interval = genome.Interval(\n chromosome=chrom_normalized,\n start=start_pos - 1,\n end=end_pos,\n )\n\n print(\n 'Querying AlphaGenome Atlas interval API for'\n f' {chrom_normalized}:{start_pos}-{end_pos}...'\n )\n scores = client.query_interval(interval, requested_scorers=_REQUESTED_SCORERS)\n\n if 'AVI_SCORE' not in scores:\n raise ValueError(\n f'AlphaGenome Atlas did not return AVI_SCORE for region {args.region}.'\n )\n\n avi_adata = scores['AVI_SCORE']\n fi_adata = scores.get('AVI_SCORE_FEATURE_IMPORTANCE')\n\n candidate_variants = _extract_region_variants(avi_adata, fi_adata)\n valid_scored = [\n v\n for v in candidate_variants\n if v.phred_score is not None or v.raw_score is not None\n ]\n print(\n f'Successfully retrieved and scored {len(valid_scored)} SNVs in region.'\n )\n\n ranked, top_hits = _rank_and_filter(\n valid_scored, min_phred=args.min_phred, top_k=args.top_k\n )\n\n print_top_summary_table(top_hits, len(valid_scored))\n\n if args.show_features and top_hits:\n _print_feature_breakdowns(\n top_hits,\n header_text='\\n### Top Region Hotspot Feature Importances:',\n include_track_info=args.include_track_info,\n max_variants=3,\n )\n\n if args.output:\n _export_scored_variants(\n args.output,\n ranked,\n include_features=args.include_features,\n include_track_info=args.include_track_info,\n include_rank=True,\n )\n print(f'Region scan exported to: {args.output}')\n\n\ndef _print_feature_metadata(args: argparse.Namespace) -> None:\n \"\"\"Prints AVI feature definitions (no API client needed).\"\"\"\n rows: list[dict[str, object]] = []\n for rank, feature in enumerate(AviFeature, start=1):\n rows.append({\n 'rank': rank,\n 'feature_key': feature.name,\n 'display_name': feature.display_name,\n 'category': feature.category,\n })\n\n if getattr(args, 'format', 'table') == 'json':\n print(json.dumps(rows, indent=2))\n return\n if getattr(args, 'output', None):\n _write_tabular(args.output, rows)\n print(f'AVI feature definitions written to: {args.output}')\n return\n\n print('\\n### AlphaGenome Variant Impact (AVI) 18 Biological Modalities:\\n')\n display_rows = [\n {\n 'Rank': r['rank'],\n 'Modality Key': f'`{r[\"feature_key\"]}`',\n 'Website Display Name': f'**{r[\"display_name\"]}**',\n 'Category': r['category'],\n }\n for r in rows\n ]\n print(tabulate.tabulate(display_rows, headers='keys', tablefmt='github'))\n print()\n\n\ndef handle_metadata(args: argparse.Namespace) -> None:\n \"\"\"Handler for `metadata` subcommand.\"\"\"\n meta_type = args.type\n\n if meta_type == 'features':\n _print_feature_metadata(args)\n return\n\n # scorers and tracks modes require the Atlas client.\n client = get_atlas_client()\n\n if meta_type == 'scorers':\n scorer_map = client.scorer_metadata()\n rows: MutableSequence[dict[str, object]] = [\n {\n 'scorer_name': 'AVI_SCORE',\n 'category': 'Variant Impact (Composite)',\n 'is_signed': False,\n 'tracks': 1,\n 'biosamples': 1,\n 'description': (\n 'AlphaGenome Variant Impact calibrated Phred/Quantile score'\n ),\n },\n {\n 'scorer_name': 'AVI_SCORE_FEATURE_IMPORTANCE',\n 'category': 'Feature Attribution',\n 'is_signed': True,\n 'tracks': 18,\n 'biosamples': 1,\n 'description': (\n '18-modality biological feature attribution weights (SHAP)'\n ),\n },\n ]\n for name, meta in scorer_map.items():\n df = meta.track_metadata\n num_tracks = len(df)\n num_biosamples = (\n int(df['biosample_name'].nunique())\n if (df is not None and 'biosample_name' in df.columns)\n else 0\n )\n rows.append({\n 'scorer_name': name,\n 'category': 'Experimental Track Scorer',\n 'is_signed': meta.is_signed,\n 'tracks': num_tracks,\n 'biosamples': num_biosamples,\n 'description': f'Atlas experimental track predictions ({name})',\n })\n\n if args.format == 'json':\n print(json.dumps(rows, indent=2))\n return\n if args.output:\n _write_tabular(args.output, rows)\n print(f'Scorer metadata written to: {args.output}')\n return\n\n print('\\n### Registered AlphaGenome Atlas Scorers:\\n')\n display_rows = [\n {\n 'Scorer Name': f'`{row[\"scorer_name\"]}`',\n 'Category': row['category'],\n 'Signed': row['is_signed'],\n 'Tracks': row['tracks'],\n 'Biosamples': row['biosamples'],\n }\n for row in rows\n ]\n print(tabulate.tabulate(display_rows, headers='keys', tablefmt='github'))\n print()\n\n elif meta_type == 'tracks':\n scorer_map = client.scorer_metadata()\n track_rows: MutableSequence[dict[str, object]] = []\n\n target_scorers = [args.scorer] if args.scorer else list(scorer_map.keys())\n\n for name in target_scorers:\n if name not in scorer_map:\n continue\n df = scorer_map[name].track_metadata\n if df is None or df.empty:\n continue\n for index, row in df.iterrows():\n track_dict: dict[str, object] = {\n 'scorer': name,\n 'track_index': int(index),\n 'track_name': str(row.get('name', '')),\n 'biosample_name': str(row.get('biosample_name', '')),\n 'biosample_type': str(row.get('biosample_type', '')),\n 'ontology_curie': str(row.get('ontology_curie', '')),\n 'strand': str(row.get('strand', '')),\n }\n for extra_col in ('transcription_factor', 'histone_mark', 'assay'):\n if extra_col in row and str(row[extra_col]):\n track_dict[extra_col] = str(row[extra_col])\n\n # Filter by ontology\n if args.ontology and str(track_dict['ontology_curie']) != args.ontology:\n continue\n\n # Filter by text query\n if args.query:\n q_lower = args.query.lower()\n searchable = ' '.join(str(v).lower() for v in track_dict.values())\n if q_lower not in searchable:\n continue\n\n track_rows.append(track_dict)\n\n if not track_rows:\n print('No tracks matched the specified metadata filter criteria.')\n return\n\n if args.output:\n _write_tabular(args.output, track_rows)\n print(\n f'Dumped {len(track_rows)} track metadata records to: {args.output}'\n )\n return\n\n if args.format == 'json':\n print(json.dumps(track_rows[: args.top_n], indent=2))\n return\n\n print(\n f'\\n### Atlas Track Metadata Catalog (Matched: {len(track_rows)},'\n f' Showing Top {min(len(track_rows), args.top_n)}):\\n'\n )\n display_tracks = [\n {\n 'Scorer': f'`{row[\"scorer\"]}`',\n 'Track Index': f'`{row[\"track_index\"]}`',\n 'Track Name': f'`{row[\"track_name\"]}`',\n 'Biosample': row['biosample_name'],\n 'Ontology': f'`{row[\"ontology_curie\"]}`',\n }\n for row in track_rows[: args.top_n]\n ]\n print(tabulate.tabulate(display_tracks, headers='keys', tablefmt='github'))\n print()\n\n\ndef _clean_chrom(chrom_str: str) -> str:\n \"\"\"Ensures chromosome string has chr prefix.\"\"\"\n c = str(chrom_str).strip()\n return c if c.startswith('chr') else f'chr{c}'\n\n\nGTF_URL = (\n 'https://storage.googleapis.com/alphagenome/reference/gencode/'\n 'hg38/gencode.v46.annotation.gtf.gz.feather'\n)\n\n\ndef load_gtf_dataframe(custom_path: str | None = None) -> pd.DataFrame:\n \"\"\"Loads GENCODE v46 GTF annotations from a local path, environment variable, cache, or GCS.\"\"\"\n path = custom_path or os.environ.get('ALPHAGENOME_GTF_PATH')\n if path and os.path.exists(path):\n print(f'Loading GTF from {path}...')\n return pd.read_feather(path)\n\n cache_dir = os.path.expanduser('~/.cache/alphagenome')\n cache_path = os.path.join(cache_dir, 'gencode.v46.annotation.gtf.gz.feather')\n if os.path.exists(cache_path):\n print(f'Loading GTF from cache {cache_path}...')\n return pd.read_feather(cache_path)\n\n target_url = path or GTF_URL\n print(f'Loading GTF from {target_url}...')\n try:\n df = pd.read_feather(target_url)\n try:\n os.makedirs(cache_dir, exist_ok=True)\n df.to_feather(cache_path)\n except Exception:\n pass\n return df\n except Exception as e:\n raise RuntimeError(\n f'Failed to load GTF annotations from {target_url}: {e}'\n ) from e\n\n\ndef handle_gtf(args: argparse.Namespace) -> None:\n \"\"\"Handles gene and transcript GTF queries, exon extraction, and splice junctions.\"\"\"\n gtf = load_gtf_dataframe()\n\n if getattr(args, 'protein_coding', False):\n if 'gene_type' in gtf.columns:\n gtf = gtf[gtf['gene_type'] == 'protein_coding']\n if 'transcript_type' in gtf.columns:\n gtf = gtf[gtf['transcript_type'] == 'protein_coding']\n\n if not getattr(args, 'all_transcripts', False):\n if 'tag' in gtf.columns:\n gtf = gtf[gtf['tag'].fillna('').str.contains('MANE_Select')]\n\n if getattr(args, 'longest', False):\n lengths = gtf[gtf['Feature'] == 'transcript'].reset_index(drop=True)\n lengths['t_len'] = lengths['End'] - lengths['Start'] + 1\n longest = lengths.loc[lengths.groupby('gene_id')['t_len'].idxmax()]\n gtf = gtf[gtf['transcript_id'].isin(longest['transcript_id'])]\n\n query_variant = None\n query_pos = None\n query_chrom = None\n\n if getattr(args, 'variant', None):\n v_str = args.variant.strip()\n match = re.match(\n r'^(chr[0-9XYM]+):(\\d+)(?:[:/_>]([A-Za-z]+)(?:[:/_>]([A-Za-z]+))?)?

AlphaGenome Variant Impact (AVI) Analysis Score and prioritize genetic variants using AlphaGenome Variant Impact (AVI) models via . [!IMPORTANT] Research Use Only & Clinical Safety Rules : The AlphaGenome AVI Skill and the underlying AlphaGenome model/Atlas are strictly research tools . Access to outputs requires an AlphaGenome API key subject to terms of service prohibiting clinical use. 1. No Medical Advice or Clinical Diagnosis : You MUST NOT provide medical advice, clinical diagnoses, disease management strategies, or treatment recommendations based on outputs from this skill or the Alpha…

,\n v_str,\n )\n if match:\n query_chrom = match.group(1)\n query_pos = int(match.group(2))\n query_variant = v_str\n else:\n parts = v_str.split(':')\n if len(parts) >= 2 and parts[0].startswith('chr') and parts[1].isdigit():\n query_chrom = parts[0]\n query_pos = int(parts[1])\n query_variant = v_str\n else:\n raise ValueError(f'Invalid variant/position format: {args.variant}')\n\n t_df = gtf[\n (gtf['Chromosome'] == query_chrom) & (gtf['Feature'] == 'transcript')\n ]\n overlapping_t = t_df[\n (t_df['Start'] \u003c= query_pos) & (t_df['End'] >= query_pos)\n ]\n if overlapping_t.empty:\n nearby_t = t_df[\n (t_df['Start'] - 50000 \u003c= query_pos)\n & (t_df['End'] + 50000 >= query_pos)\n ]\n if nearby_t.empty:\n print(f'No transcripts found overlapping or near {args.variant}.')\n return\n t_ids = nearby_t['transcript_id'].unique()\n else:\n t_ids = overlapping_t['transcript_id'].unique()\n target_rows = gtf[gtf['transcript_id'].isin(t_ids)]\n\n elif getattr(args, 'gene', None):\n gene_name = args.gene.strip().upper()\n target_rows = gtf[gtf['gene_name'].fillna('').str.upper() == gene_name]\n if target_rows.empty:\n print(f'No gene found with symbol: {args.gene}')\n return\n\n elif getattr(args, 'gene_id', None):\n gene_id = args.gene_id.strip()\n target_rows = gtf[\n (gtf['gene_id'] == gene_id)\n | (gtf['gene_id'].str.split('.').str[0] == gene_id.split('.')[0])\n ]\n if target_rows.empty:\n print(f'No gene found with ID: {args.gene_id}')\n return\n\n elif getattr(args, 'transcript_id', None):\n t_id = args.transcript_id.strip()\n target_rows = gtf[\n (gtf['transcript_id'] == t_id)\n | (gtf['transcript_id'].str.split('.').str[0] == t_id.split('.')[0])\n ]\n if target_rows.empty:\n print(f'No transcript found with ID: {args.transcript_id}')\n return\n\n elif getattr(args, 'region', None):\n r_str = args.region.strip()\n match = re.match(r'^(chr[0-9XYM]+):(\\d+)-(\\d+)

AlphaGenome Variant Impact (AVI) Analysis Score and prioritize genetic variants using AlphaGenome Variant Impact (AVI) models via . [!IMPORTANT] Research Use Only & Clinical Safety Rules : The AlphaGenome AVI Skill and the underlying AlphaGenome model/Atlas are strictly research tools . Access to outputs requires an AlphaGenome API key subject to terms of service prohibiting clinical use. 1. No Medical Advice or Clinical Diagnosis : You MUST NOT provide medical advice, clinical diagnoses, disease management strategies, or treatment recommendations based on outputs from this skill or the Alpha…

, r_str)\n if not match:\n raise ValueError(f'Invalid region format: {args.region}')\n r_chrom = match.group(1)\n r_start = int(match.group(2))\n r_end = int(match.group(3))\n t_df = gtf[\n (gtf['Chromosome'] == r_chrom) & (gtf['Feature'] == 'transcript')\n ]\n overlapping_t = t_df[(t_df['Start'] \u003c= r_end) & (t_df['End'] >= r_start)]\n if overlapping_t.empty:\n print(f'No transcripts found overlapping region {args.region}.')\n return\n target_rows = gtf[\n gtf['transcript_id'].isin(overlapping_t['transcript_id'].unique())\n ]\n\n else:\n raise ValueError(\n 'Must specify one of --gene, --gene_id, --transcript_id, --variant, or'\n ' --region.'\n )\n\n transcripts_data = []\n for t_id, group in target_rows.groupby('transcript_id'):\n t_feat_rows = group[group['Feature'] == 'transcript']\n t_feat = t_feat_rows.iloc[0] if not t_feat_rows.empty else group.iloc[0]\n gene_name = str(t_feat.get('gene_name', ''))\n gene_id = str(t_feat.get('gene_id', ''))\n chrom = str(t_feat.get('Chromosome', ''))\n strand = str(t_feat.get('Strand', ''))\n t_start = int(t_feat.get('Start', 0))\n t_end = int(t_feat.get('End', 0))\n t_type = str(t_feat.get('transcript_type', ''))\n tags = str(t_feat.get('tag', ''))\n is_mane = 'MANE_Select' in tags\n\n ascending = strand == '+'\n exon_rows = (\n group[group['Feature'] == 'exon']\n .sort_values('Start', ascending=ascending)\n .reset_index(drop=True)\n )\n exons_list = []\n for idx, e in exon_rows.iterrows():\n e_num = int(e.get('exon_number', idx + 1))\n e_start = int(e['Start'])\n e_end = int(e['End'])\n e_width = e_end - e_start + 1\n acceptor = e_start if strand == '+' else e_end\n donor = e_end if strand == '+' else e_start\n overlaps_v = False\n if query_pos is not None and chrom == query_chrom:\n overlaps_v = e_start \u003c= query_pos \u003c= e_end\n\n exons_list.append({\n 'exon_number': e_num,\n 'chromosome': chrom,\n 'start': e_start,\n 'end': e_end,\n 'width': e_width,\n 'strand': strand,\n 'acceptor': acceptor,\n 'donor': donor,\n 'overlaps_variant': overlaps_v,\n })\n if exon_rows.empty:\n print('No exons found for target.', file=sys.stderr)\n sys.exit(1)\n\n junctions_list = []\n num_exons = len(exon_rows)\n for i in range(num_exons - 1):\n e1 = exon_rows.iloc[i]\n e2 = exon_rows.iloc[i + 1]\n if strand == '+':\n j_start = int(e1['End'])\n j_end = int(e2['Start'])\n else:\n j_start = int(e2['End'])\n j_end = int(e1['Start'])\n score_id = None\n atlas_url = None\n if query_variant:\n v_enc = query_variant.replace('>', '%3E')\n track_name = (\n getattr(args, 'track', None)\n or 'junction_UBERON:0011907 gtex Muscle_Skeletal polyA plus RNA-seq'\n )\n track_enc = track_name.replace(' ', '%20')\n splice_score_id = (\n f'{v_enc}:SPLICE_JUNCTIONS:{track_enc}:Unstranded:'\n f'{gene_id}:{j_start}:{j_end}'\n )\n # Splicing visualization: pair SPLICE_JUNCTIONS with continuous RNA_SEQ\n rna_track_name = re.sub(r'^junction_', '', track_name)\n rna_track_enc = rna_track_name.replace(' ', '%20')\n rna_score_id = (\n f'{v_enc}:RNA_SEQ:{rna_track_enc}:Unstranded:{gene_id}:0:0'\n )\n scores_param = f'{splice_score_id},{rna_score_id}'\n score_id = splice_score_id\n i_start = max(1, t_start)\n i_end = t_end\n atlas_url = (\n f'{_ATLAS_TRACK_PREDICTIONS_URL}?'\n f'q={v_enc}&m=variant'\n '&lItems=avi,section:RNA_SEQ,section:SPLICE_JUNCTIONS,section:SPLICE_SITE_USAGE,section:SPLICE_SITES'\n f'&scores={scores_param}'\n f'&i={chrom}:{i_start}-{i_end}'\n )\n\n junctions_list.append({\n 'type': f'Canonical Intron {i+1}',\n 'upstream_exon': int(e1.get('exon_number', i + 1)),\n 'downstream_exon': int(e2.get('exon_number', i + 2)),\n 'junction_start': j_start,\n 'junction_end': j_end,\n 'junction_str': f'{j_start}:{j_end}',\n 'intron_length': j_end - j_start - 1,\n 'score_id': score_id,\n 'atlas_url': atlas_url,\n })\n\n for i in range(num_exons - 2):\n e1 = exon_rows.iloc[i]\n e_skipped = exon_rows.iloc[i + 1]\n e3 = exon_rows.iloc[i + 2]\n if strand == '+':\n j_start = int(e1['End'])\n j_end = int(e3['Start'])\n else:\n j_start = int(e3['End'])\n j_end = int(e1['Start'])\n\n junctions_list.append({\n 'type': f'Exon {e_skipped.get(\"exon_number\", i+2)} Skipping',\n 'upstream_exon': int(e1.get('exon_number', i + 1)),\n 'downstream_exon': int(e3.get('exon_number', i + 3)),\n 'junction_start': j_start,\n 'junction_end': j_end,\n 'junction_str': f'{j_start}:{j_end}',\n 'intron_length': j_end - j_start - 1,\n })\n\n cds_rows = group[group['Feature'] == 'CDS'].sort_values(\n 'Start', ascending=ascending\n )\n cds_list = [\n {\n 'start': int(r['Start']),\n 'end': int(r['End']),\n 'width': int(r['End']) - int(r['Start']) + 1,\n }\n for _, r in cds_rows.iterrows()\n ]\n\n utr_rows = group[group['Feature'] == 'UTR'].sort_values(\n 'Start', ascending=ascending\n )\n utr_list = [\n {\n 'start': int(r['Start']),\n 'end': int(r['End']),\n 'width': int(r['End']) - int(r['Start']) + 1,\n }\n for _, r in utr_rows.iterrows()\n ]\n\n transcripts_data.append({\n 'gene_name': gene_name,\n 'gene_id': gene_id,\n 'transcript_id': t_id,\n 'transcript_type': t_type,\n 'chromosome': chrom,\n 'start': t_start,\n 'end': t_end,\n 'strand': strand,\n 'is_mane_select': is_mane,\n 'num_exons': len(exons_list),\n 'exons': exons_list,\n 'junctions': junctions_list,\n 'cds': cds_list,\n 'utr': utr_list,\n })\n\n if not transcripts_data:\n print('No matching transcript records found.')\n return\n\n if getattr(args, 'format', 'table') == 'json':\n print(json.dumps(transcripts_data, indent=2))\n return\n\n if getattr(args, 'output', None):\n # Flatten exons or junctions for output export\n export_rows = []\n for t in transcripts_data:\n if getattr(args, 'junctions', False):\n for j in t['junctions']:\n row = {\n 'gene_name': t['gene_name'],\n 'gene_id': t['gene_id'],\n 'transcript_id': t['transcript_id'],\n **j,\n }\n export_rows.append(row)\n else:\n for e in t['exons']:\n row = {\n 'gene_name': t['gene_name'],\n 'gene_id': t['gene_id'],\n 'transcript_id': t['transcript_id'],\n **e,\n }\n export_rows.append(row)\n _write_tabular(args.output, export_rows)\n print(f'Exported {len(export_rows)} records to: {args.output}')\n return\n\n for t in transcripts_data:\n mane_badge = ' [MANE Select]' if t['is_mane_select'] else ''\n print(\n f'\\n### Gene: {t[\"gene_name\"]} ({t[\"gene_id\"]}) | Transcript:'\n f' {t[\"transcript_id\"]}{mane_badge}'\n )\n print(\n f'Coordinates: {t[\"chromosome\"]}:{t[\"start\"]}-{t[\"end\"]} ({t[\"strand\"]}'\n f' strand) | Type: {t[\"transcript_type\"]} | Exons: {t[\"num_exons\"]}\\n'\n )\n\n if getattr(args, 'exons', False) or (\n not getattr(args, 'junctions', False)\n and not getattr(args, 'cds', False)\n and not getattr(args, 'utr', False)\n ):\n print('#### Exon Boundaries:')\n exon_rows = [\n {\n 'Exon #': f'Exon {e[\"exon_number\"]}',\n 'Coordinates': f'`{e[\"start\"]}-{e[\"end\"]}`',\n 'Width (bp)': f'{e[\"width\"]} bp',\n \"5' Acceptor\": f'`{e[\"acceptor\"]}`',\n \"3' Donor\": f'`{e[\"donor\"]}`',\n 'Overlaps Query': (\n '**Yes (Mutation Site)**' if e['overlaps_variant'] else '-'\n ),\n }\n for e in t['exons']\n ]\n print(tabulate.tabulate(exon_rows, headers='keys', tablefmt='github'))\n print()\n\n if getattr(args, 'junctions', False):\n print('#### Splice Junctions (Canonical & Exon Skipping):')\n junction_rows = [\n {\n 'Junction Type': j['type'],\n 'Flanking Exons': (\n f'Exon {j[\"upstream_exon\"]} → Exon {j[\"downstream_exon\"]}'\n ),\n 'Junction Coordinates': f'`{j[\"junction_str\"]}`',\n 'Intron Length': f'{j[\"intron_length\"]} bp',\n }\n for j in t['junctions']\n ]\n print(tabulate.tabulate(junction_rows, headers='keys', tablefmt='github'))\n print()\n\n if getattr(args, 'cds', False):\n print('#### CDS Segments:')\n for idx, c in enumerate(t['cds'], start=1):\n print(\n f'- CDS {idx}: `{c[\"start\"]}-{c[\"end\"]}` (Width: {c[\"width\"]} bp)'\n )\n print()\n\n if getattr(args, 'utr', False):\n print('#### UTR Segments:')\n for idx, u in enumerate(t['utr'], start=1):\n print(\n f'- UTR {idx}: `{u[\"start\"]}-{u[\"end\"]}` (Width: {u[\"width\"]} bp)'\n )\n print()\n\n\ndef _add_common_args(parser: argparse.ArgumentParser) -> None:\n \"\"\"Adds shared CLI arguments across all subcommands.\"\"\"\n parser.add_argument(\n '--show_features',\n '--features',\n dest='show_features',\n action=argparse.BooleanOptionalAction,\n default=True,\n help='Display feature importance breakdowns',\n )\n parser.add_argument(\n '--include_features',\n action=argparse.BooleanOptionalAction,\n default=False,\n help='Include all 18 feature importance columns in exported files',\n )\n parser.add_argument(\n '--include_track_info',\n action=argparse.BooleanOptionalAction,\n default=False,\n help=(\n 'Resolve and include the exact underlying Atlas track index,'\n ' biosample, and target gene for each feature'\n ),\n )\n parser.add_argument('--output', '-o', help='Path to write output file')\n\n\ndef main() -> None:\n dotenv.load_dotenv(os.path.expanduser('~/.env'))\n\n parser = argparse.ArgumentParser(\n description='AlphaGenome Variant Impact (AVI) CLI',\n formatter_class=argparse.ArgumentDefaultsHelpFormatter,\n )\n subparsers = parser.add_subparsers(dest='subcommand', required=True)\n\n # Subcommand: annotate\n parser_annotate = subparsers.add_parser(\n 'annotate',\n help=(\n 'Annotate variant callset (VCF, CSV, TSV, Parquet) in Ensembl VEP'\n ' CSQ format'\n ),\n )\n parser_annotate.add_argument(\n '--input',\n '-i',\n required=True,\n help=(\n 'Path to input variant file (VCF or tabular CSV/TSV/Parquet with'\n ' 1-based coordinates)'\n ),\n )\n _add_common_args(parser_annotate)\n parser_annotate.add_argument(\n '--top_k',\n type=int,\n default=20,\n help='Number of top variants to summarize',\n )\n parser_annotate.add_argument(\n '--min_phred',\n type=float,\n default=0.0,\n help='Minimum Phred score for top filtering',\n )\n parser_annotate.add_argument(\n '--top_output',\n help='Optional path to export top-ranked summary (JSON/TSV/CSV)',\n )\n parser_annotate.add_argument(\n '--vep_csq_only',\n action='store_true',\n help='Only annotate within VEP CSQ tag',\n )\n\n # Subcommand: query\n parser_query = subparsers.add_parser(\n 'query',\n help=(\n 'Query one or more variant strings to get scores and full modality'\n ' feature importances'\n ),\n )\n parser_query.add_argument(\n 'variants',\n nargs='*',\n help=(\n 'Variant strings to score in 1-based chr:pos:ref>alt format (e.g.'\n ' chr9:128225994:G>A chr22:36201698:A>C)'\n ),\n )\n parser_query.add_argument(\n '--input_file',\n '-i',\n help=(\n 'Path to file containing variant strings in 1-based chr:pos:ref>alt'\n ' format (one per line)'\n ),\n )\n _add_common_args(parser_query)\n parser_query.add_argument(\n '--top_features',\n type=int,\n default=10,\n help='Number of top features to show in breakdown table',\n )\n parser_query.add_argument(\n '--format',\n choices=['table', 'json', 'tsv'],\n default='table',\n help='Output format',\n )\n\n # Subcommand: region\n parser_region = subparsers.add_parser(\n 'region',\n help='In silico saturation mutagenesis scan across a genomic window',\n )\n parser_region.add_argument(\n '--region',\n '-r',\n required=True,\n help=(\n 'Genomic interval in 1-based closed chr:start-end format (e.g.'\n ' chr9:128225900-128226050)'\n ),\n )\n _add_common_args(parser_region)\n parser_region.add_argument(\n '--top_k',\n type=int,\n default=20,\n help='Number of top variants to summarize',\n )\n parser_region.add_argument(\n '--min_phred',\n type=float,\n default=0.0,\n help='Minimum Phred score threshold for reporting',\n )\n parser_region.add_argument(\n '--max_window_size',\n type=int,\n default=1000,\n help='Maximum permitted window size in basepairs',\n )\n\n # Subcommand: metadata\n parser_metadata = subparsers.add_parser(\n 'metadata',\n help=(\n 'Dump and search Atlas database scorers, track catalogs, and AVI'\n ' feature attribution modalities'\n ),\n )\n parser_metadata.add_argument(\n '--type',\n choices=['scorers', 'tracks', 'features'],\n default='scorers',\n help='Type of metadata to dump or search',\n )\n parser_metadata.add_argument(\n '--scorers',\n action='store_const',\n const='scorers',\n dest='type',\n help='Shortcut for --type scorers',\n )\n parser_metadata.add_argument(\n '--tracks',\n action='store_const',\n const='tracks',\n dest='type',\n help='Shortcut for --type tracks',\n )\n parser_metadata.add_argument(\n '--features',\n action='store_const',\n const='features',\n dest='type',\n help='Shortcut for --type features',\n )\n parser_metadata.add_argument(\n '--scorer',\n help='Filter tracks by Atlas scorer name (e.g. CHIP_TF, RNA_SEQ)',\n )\n parser_metadata.add_argument(\n '--ontology',\n help='Filter tracks by ontology CURIE (e.g. UBERON:0002107, CL:0002545)',\n )\n parser_metadata.add_argument(\n '--query',\n '-q',\n help='Search text across track names, biosamples, and assay targets',\n )\n parser_metadata.add_argument(\n '--top_n',\n type=int,\n default=50,\n help='Maximum rows to print in table preview',\n )\n parser_metadata.add_argument(\n '--format',\n choices=['table', 'json', 'tsv'],\n default='table',\n help='Output format for stdout',\n )\n parser_metadata.add_argument(\n '--output',\n '-o',\n help='Optional path to export metadata (.parquet, .tsv, .csv, .json)',\n )\n\n # Subcommand: gtf\n parser_gtf = subparsers.add_parser(\n 'gtf',\n help=(\n 'Query GENCODE v46 gene annotations, extract exons, CDS, UTRs, and'\n ' compute splice junction coordinates'\n ),\n )\n parser_gtf.add_argument(\n '--gene',\n help='Gene symbol (e.g. CAPN3, NAGS, TERT, DNM1)',\n )\n parser_gtf.add_argument(\n '--gene_id',\n help='Ensembl Gene ID (e.g. ENSG00000092529 or ENSG00000092529.26)',\n )\n parser_gtf.add_argument(\n '--transcript_id',\n help='Ensembl Transcript ID (e.g. ENST00000397163.8)',\n )\n parser_gtf.add_argument(\n '--variant',\n help=(\n 'Variant string in 1-based chr:pos:ref>alt format (e.g.'\n ' chr15:42387805:C>G)'\n ),\n )\n parser_gtf.add_argument(\n '--region',\n '-r',\n help=(\n 'Genomic interval in 1-based closed chr:start-end format (e.g.'\n ' chr15:42380000-42420000)'\n ),\n )\n parser_gtf.add_argument(\n '--all_transcripts',\n action='store_true',\n default=False,\n help='Include all transcripts instead of filtering to MANE Select',\n )\n parser_gtf.add_argument(\n '--protein_coding',\n action='store_true',\n default=False,\n help='Filter to protein-coding genes/transcripts',\n )\n parser_gtf.add_argument(\n '--longest',\n action='store_true',\n default=False,\n help='Filter to longest transcript per gene',\n )\n parser_gtf.add_argument(\n '--exons',\n action='store_true',\n default=False,\n help=(\n 'Display detailed 1-based exon boundaries and donor/acceptor'\n ' coordinates'\n ),\n )\n parser_gtf.add_argument(\n '--junctions',\n action='store_true',\n default=False,\n help=(\n 'Display canonical and exon-skipping splice junctions with 1-based'\n ' coordinates and constructed Atlas ScoreIds'\n ),\n )\n parser_gtf.add_argument(\n '--track',\n type=str,\n default=None,\n help=(\n 'Track name for constructing splice junction ScoreIds (e.g.'\n ' junction_UBERON:0011907 gtex Muscle_Skeletal polyA plus RNA-seq)'\n ),\n )\n parser_gtf.add_argument(\n '--cds',\n action='store_true',\n default=False,\n help='Display 1-based coding sequence (CDS) intervals',\n )\n parser_gtf.add_argument(\n '--utr',\n action='store_true',\n default=False,\n help=\"Display 1-based 5' and 3' UTR intervals\",\n )\n parser_gtf.add_argument(\n '--format',\n choices=['table', 'json', 'tsv'],\n default='table',\n help='Output format',\n )\n parser_gtf.add_argument(\n '--output',\n '-o',\n help='Optional path to export tabular records (TSV, CSV, Parquet, JSON)',\n )\n\n args = parser.parse_args()\n\n if args.subcommand == 'annotate':\n handle_annotate(args)\n elif args.subcommand == 'query':\n handle_query(args)\n elif args.subcommand == 'region':\n handle_region(args)\n elif args.subcommand == 'metadata':\n handle_metadata(args)\n elif args.subcommand == 'gtf':\n handle_gtf(args)\n\n\nif __name__ == '__main__':\n main()\n","content_type":"text/x-python; charset=utf-8","language":"python","size":72835,"content_sha256":"7c1a0b7b16d8b5bb182eab606115522f751dc0c9a6113940cd98bf509f9b3288"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"AlphaGenome Variant Impact (AVI) Analysis","type":"text"}]},{"type":"paragraph","content":[{"text":"Score and prioritize genetic variants using AlphaGenome Variant Impact (AVI) models via ","type":"text"},{"text":"scripts/alphagenome_atlas_avi.py","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"[!IMPORTANT] ","type":"text"},{"text":"Research Use Only & Clinical Safety Rules","type":"text","marks":[{"type":"strong"}]},{"text":": The AlphaGenome AVI Skill and the underlying AlphaGenome model/Atlas are ","type":"text"},{"text":"strictly research tools","type":"text","marks":[{"type":"strong"}]},{"text":". Access to outputs requires an AlphaGenome API key subject to terms of service prohibiting clinical use.","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"No Medical Advice or Clinical Diagnosis","type":"text","marks":[{"type":"strong"}]},{"text":": You ","type":"text"},{"text":"MUST NOT","type":"text","marks":[{"type":"strong"}]},{"text":" provide medical advice, clinical diagnoses, disease management strategies, or treatment recommendations based on outputs from this skill or the AlphaGenome Atlas.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Strict Molecular & Functional Framing","type":"text","marks":[{"type":"strong"}]},{"text":": A high AVI score reflects ","type":"text"},{"text":"predicted molecular/functional impact","type":"text","marks":[{"type":"strong"}]},{"text":" (e.g., disruption of splicing, alteration of transcription factor binding, chromatin accessibility changes, or coding consequences). Frame all findings in terms of molecular mechanisms and biological annotations—never as clinical diagnoses or medical conclusions.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"No Diagnostic Leaps","type":"text","marks":[{"type":"strong"}]},{"text":": Never extrapolate high functional impact to clinical disease causation, penetrance, or patient prognosis. If a user asks a clinical or diagnostic question, explicitly clarify that AlphaGenome is a research tool and restrict your answer to the predicted molecular and functional effects.","type":"text"}]}]}]}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"[!IMPORTANT] ","type":"text"},{"text":"Always Use AlphaGenome GENCODE v46 GTF (","type":"text","marks":[{"type":"strong"}]},{"text":"scripts/alphagenome_atlas_avi.py gtf","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":") for Gene Annotations","type":"text","marks":[{"type":"strong"}]},{"text":": When retrieving gene models, transcript IDs, exon coordinates, CDS/UTR regions, or splice junction donor/acceptor boundaries, ","type":"text"},{"text":"always use the built-in ","type":"text","marks":[{"type":"strong"}]},{"text":"scripts/alphagenome_atlas_avi.py gtf","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" command","type":"text","marks":[{"type":"strong"}]},{"text":". Do ","type":"text"},{"text":"NOT","type":"text","marks":[{"type":"strong"}]},{"text":" query external sources (e.g., Ensembl REST API, UCSC, external GTF databases, or NCBI) for gene annotations or transcript coordinates. This ensures that the annotations match the scores and website.","type":"text"}]}]},{"type":"hr","attrs":{"markup":"--------------------------------------------------------------------------------"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Prerequisites","type":"text"}]},{"type":"paragraph","content":[{"text":"Run ","type":"text"},{"text":"scripts/alphagenome_atlas_avi.py","type":"text","marks":[{"type":"code_inline"}]},{"text":" using ","type":"text"},{"text":"uv run","type":"text","marks":[{"type":"code_inline"}]},{"text":":","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Display CLI help:\nuv run scripts/alphagenome_atlas_avi.py --help","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"[!TIP] ","type":"text"},{"text":"Agent & Programmatic Execution Format","type":"text","marks":[{"type":"strong"}]},{"text":": When invoking the CLI in agent workflows, prefer ","type":"text"},{"text":"--format json","type":"text","marks":[{"type":"code_inline"}]},{"text":" or direct file export (","type":"text"},{"text":"-o \u003cfile>","type":"text","marks":[{"type":"code_inline"}]},{"text":") for deterministic, structured parsing rather than extracting fields from stdout markdown tables.","type":"text"}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"1. Query Variants (","type":"text"},{"text":"query","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]},{"type":"paragraph","content":[{"text":"Query single or multiple variants in 1-based ","type":"text"},{"text":"chr:pos:ref>alt","type":"text","marks":[{"type":"code_inline"}]},{"text":" format to inspect scores and the 18 biological feature attribution weights:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Query single variant with basic feature importances (stdout JSON preview):\nuv run scripts/alphagenome_atlas_avi.py query \"chr9:128225994:G>A\" --format json\n\n# Query variant with exact underlying Atlas track indices, biosamples, and target genes:\nuv run scripts/alphagenome_atlas_avi.py query \"chr9:128225994:G>A\" --include_track_info --format json\n\n# Query multiple variants and export full track info to a file (prevents stdout overflow):\nuv run scripts/alphagenome_atlas_avi.py query \"chr9:128225994:G>A\" \"chr22:36201698:A>C\" \\\n --include_track_info --format json -o query_results.json","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Output Size & Redirection","type":"text","marks":[{"type":"strong"}]},{"text":": Single variant table/JSON queries are compact (~1.0–1.5 KB). When querying ","type":"text"},{"type":"math_inline","content":[{"text":">3","type":"text"}]},{"text":" variants or passing ","type":"text"},{"text":"--include_track_info --format json","type":"text","marks":[{"type":"code_inline"}]},{"text":" (which generates ~3.9 KB per variant), ","type":"text"},{"text":"always export directly to a file","type":"text","marks":[{"type":"strong"}]},{"text":" using ","type":"text"},{"text":"-o \u003cfile.json>","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"-o \u003cfile.tsv>","type":"text","marks":[{"type":"code_inline"}]},{"text":" to avoid exceeding context window limits.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Typical Runtime","type":"text","marks":[{"type":"strong"}]},{"text":": ~0.5–1.0 s per variant (~12–15 s total including environment startup). Single calls with ","type":"text"},{"type":"math_inline","content":[{"text":">100","type":"text"}]},{"text":" variants take ","type":"text"},{"type":"math_inline","content":[{"text":">1","type":"text"}]},{"text":" minute.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"2. Annotate & Rank Variant Files (","type":"text"},{"text":"annotate","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]},{"type":"paragraph","content":[{"text":"Annotate a VCF (or CSV/TSV/Parquet) in standard Ensembl VEP ","type":"text"},{"text":"CSQ","type":"text","marks":[{"type":"code_inline"}]},{"text":" format:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"uv run scripts/alphagenome_atlas_avi.py annotate \\\n --input test_data/example_variants.vcf \\\n --output annotated_variants.vcf \\\n --top_k 20 \\\n --min_phred 15.0 \\\n --top_output top_variants.json","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Output Size & Redirection","type":"text","marks":[{"type":"strong"}]},{"text":": ","type":"text"},{"text":"annotate","type":"text","marks":[{"type":"code_inline"}]},{"text":" streams the full callset directly to disk via ","type":"text"},{"text":"--output","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":".vcf","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":".vcf.gz","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":".parquet","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":".tsv","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":".csv","type":"text","marks":[{"type":"code_inline"}]},{"text":"). Stdout displays a bounded summary (top candidate table + top 3 modality breakdowns, ~4.0–5.5 KB). Use ","type":"text"},{"text":"--top_output \u003cfile.json>","type":"text","marks":[{"type":"code_inline"}]},{"text":" when downstream tools need machine-readable top candidate data.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Typical Runtime & Callset Scaling","type":"text","marks":[{"type":"strong"}]},{"text":": Throughput is ~10 variants/s (default) and ~5 variants/s (with track info). Small callsets (","type":"text"},{"type":"math_inline","content":[{"text":"\\le 100","type":"text"}]},{"text":" variants) take ~15 s. Callsets ","type":"text"},{"type":"math_inline","content":[{"text":"\\ge 500","type":"text"}]},{"text":" variants execute silently for ","type":"text"},{"type":"math_inline","content":[{"text":">1","type":"text"}]},{"text":" minute (e.g., 1,000 variants take ~2–3 min; 10,000 variants take ~20 min).","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"3. Saturation Mutagenesis Window Scan (","type":"text"},{"text":"region","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]},{"type":"paragraph","content":[{"text":"Scan a 1-based closed genomic window (","type":"text"},{"text":"chr:start-end","type":"text","marks":[{"type":"code_inline"}]},{"text":") to score all possible single nucleotide substitutions (","type":"text"},{"type":"math_inline","content":[{"text":"3 \\times N","type":"text"}]},{"text":" variants for an ","type":"text"},{"type":"math_inline","content":[{"text":"N","type":"text"}]},{"text":"-bp window):","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"uv run scripts/alphagenome_atlas_avi.py region \\\n --region chr9:128225990-128226000 \\\n --min_phred 15.0 \\\n --top_k 20 \\\n --output region_hotspots.tsv","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Output Size & Redirection","type":"text","marks":[{"type":"strong"}]},{"text":": Scanning a 100 bp window produces 300 SNVs (~42 KB TSV / ~105 KB JSON), while a 1,000 bp window produces 3,000 SNVs (~421 KB TSV / ~1.06 MB JSON). ","type":"text"},{"text":"Always specify ","type":"text","marks":[{"type":"strong"}]},{"text":"--output \u003cfile.tsv|parquet>","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" to save the complete dataset; stdout will only show a top-20 candidate preview.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Typical Runtime","type":"text","marks":[{"type":"strong"}]},{"text":": Queries precomputed dense scores over gRPC in ","type":"text"},{"text":"1.5–3.0 s","type":"text","marks":[{"type":"strong"}]},{"text":" for up to 1,000 bp (default ","type":"text"},{"text":"--max_window_size","type":"text","marks":[{"type":"code_inline"}]},{"text":").","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"4. Inspect Atlas Database Metadata (","type":"text"},{"text":"metadata","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]},{"type":"paragraph","content":[{"text":"Dump or search registered scorers, the 18 biological feature definitions, or experimental track catalogs:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# List all registered scorers:\nuv run scripts/alphagenome_atlas_avi.py metadata --scorers --format json\n\n# List the 18 biological feature attribution modalities:\nuv run scripts/alphagenome_atlas_avi.py metadata --features --format json\n\n# Search experimental tracks by query keyword with a controlled preview (top 20):\nuv run scripts/alphagenome_atlas_avi.py metadata --tracks --query \"GATA1\" --top_n 20\n\n# Dump complete 9,440-track catalog to Parquet or TSV for offline search:\nuv run scripts/alphagenome_atlas_avi.py metadata --tracks --output atlas_tracks.parquet","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Output Size & Redirection","type":"text","marks":[{"type":"strong"}]},{"text":": ","type":"text"},{"text":"--features","type":"text","marks":[{"type":"code_inline"}]},{"text":" (~1.3 KB) and ","type":"text"},{"text":"--scorers","type":"text","marks":[{"type":"code_inline"}]},{"text":" table (~1.7 KB) are safely under 4 KB. The experimental track catalog contains ","type":"text"},{"text":"9,440 tracks","type":"text","marks":[{"type":"strong"}]},{"text":" (~972 KB table / ~2.55 MB JSON). ","type":"text"},{"text":"Never dump unfiltered tracks to stdout","type":"text","marks":[{"type":"strong"}]},{"text":"; always supply a narrow ","type":"text"},{"text":"--query","type":"text","marks":[{"type":"code_inline"}]},{"text":", specify ","type":"text"},{"text":"--top_n 20","type":"text","marks":[{"type":"code_inline"}]},{"text":", or export to ","type":"text"},{"text":"--output atlas_tracks.parquet","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Typical Runtime","type":"text","marks":[{"type":"strong"}]},{"text":": ~1.5–2.5 s.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"5. Inspect Gene Structure & Splice Junctions (","type":"text"},{"text":"gtf","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]},{"type":"paragraph","content":[{"text":"Query GENCODE v46 gene annotations, extract 1-based exon boundaries with donor/acceptor coordinates, and compute canonical and exon-skipping splice junction coordinates:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Query MANE Select exon boundaries for a gene (stdout JSON preview):\nuv run scripts/alphagenome_atlas_avi.py gtf --gene CAPN3 --exons --format json\n\n# Query canonical and exon-skipping splice junctions for a variant locus:\nuv run scripts/alphagenome_atlas_avi.py gtf --variant \"chr15:42387805:C>G\" --junctions --format json\n\n# Extract CDS and UTR segments for an Ensembl transcript ID:\nuv run scripts/alphagenome_atlas_avi.py gtf --transcript_id ENST00000397163.8 --cds --utr --format json","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Output Size & Redirection","type":"text","marks":[{"type":"strong"}]},{"text":": Single-gene MANE Select queries with ","type":"text"},{"text":"--exons","type":"text","marks":[{"type":"code_inline"}]},{"text":" are compact (\u003c2.5 KB). ","type":"text"},{"text":"Always export to ","type":"text","marks":[{"type":"strong"}]},{"text":"--output \u003cfile.tsv|parquet>","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":"or redirect (","type":"text","marks":[{"type":"strong"}]},{"text":"> gtf_out.json","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":")","type":"text","marks":[{"type":"strong"}]},{"text":" when passing ","type":"text"},{"text":"--all_transcripts","type":"text","marks":[{"type":"code_inline"}]},{"text":"(30–500 KB),","type":"text"},{"text":"--region","type":"text","marks":[{"type":"code_inline"}]},{"text":"(","type":"text"},{"type":"math_inline","content":[{"text":">50\\text{ kb}","type":"text"}]},{"text":"),","type":"text"},{"text":"--format json","type":"text","marks":[{"type":"code_inline"}]},{"text":", or querying genes with ","type":"text"},{"type":"math_inline","content":[{"text":">30","type":"text"}]},{"text":" exons (e.g.","type":"text"},{"text":"TTN","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"DMD","type":"text","marks":[{"type":"code_inline"}]},{"text":").","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Typical Runtime & Memory","type":"text","marks":[{"type":"strong"}]},{"text":": Ingests the 318 MB GENCODE v46 feather dataset (~4.37 GB RAM). Cached queries execute in ","type":"text"},{"text":"~4–6 s","type":"text","marks":[{"type":"strong"}]},{"text":". Cold-start runs downloading the file from GCS take ","type":"text"},{"text":"~5–10 s","type":"text","marks":[{"type":"strong"}]},{"text":" on corp/Cloudtop networks, but can take up to ","type":"text"},{"text":"60–90 s","type":"text","marks":[{"type":"strong"}]},{"text":" on external networks. Do not kill the process prematurely during initial download.","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"--------------------------------------------------------------------------------"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Programmatic Python SDK Usage","type":"text"}]},{"type":"paragraph","content":[{"text":"When querying AlphaGenome programmatically in Python:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Client Factory","type":"text","marks":[{"type":"strong"}]},{"text":": Always instantiate the client using ","type":"text"},{"text":"atlas.create(api_key)","type":"text","marks":[{"type":"code_inline"}]},{"text":" — do ","type":"text"},{"text":"NOT","type":"text","marks":[{"type":"strong"}]},{"text":" instantiate ","type":"text"},{"text":"atlas.AtlasClient()","type":"text","marks":[{"type":"code_inline"}]},{"text":" directly (which requires an internal gRPC stub).","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Coordinate System","type":"text","marks":[{"type":"strong"}]},{"text":": ","type":"text"},{"text":"genome.Interval","type":"text","marks":[{"type":"code_inline"}]},{"text":" operates with ","type":"text"},{"text":"0-based half-open indexing","type":"text","marks":[{"type":"strong"}]},{"text":" (","type":"text"},{"text":"[start, end)","type":"text","marks":[{"type":"code_inline"}]},{"text":"). When querying a 1-based closed interval ","type":"text"},{"text":"chr:start_1_based-end_1_based","type":"text","marks":[{"type":"code_inline"}]},{"text":", pass ","type":"text"},{"text":"start = start_1_based - 1","type":"text","marks":[{"type":"code_inline"}]},{"text":" and ","type":"text"},{"text":"end = end_1_based","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Single Variants","type":"text","marks":[{"type":"strong"}]},{"text":": ","type":"text"},{"text":"genome.Variant.from_str(\"chr:pos:ref>alt\")","type":"text","marks":[{"type":"code_inline"}]},{"text":" expects ","type":"text"},{"text":"1-based","type":"text","marks":[{"type":"strong"}]},{"text":" position coordinates.","type":"text"}]}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"python"},"content":[{"text":"import os\nfrom alphagenome.atlas import atlas\nfrom alphagenome.data import genome\nimport dotenv\n\ndotenv.load_dotenv(os.path.expanduser('~/.env'))\nclient = atlas.create(os.environ['ALPHAGENOME_API_KEY'])\n\n# Query 1-based closed interval chr11:5225727-5226575 using 0-based half-open [5225726, 5226575)\ninterval = genome.Interval(chromosome='chr11', start=5225726, end=5226575)\nresults = client.query_interval(\n interval,\n requested_scorers=['AVI_SCORE', 'AVI_SCORE_FEATURE_IMPORTANCE'],\n)\n\n# Query single variant with 1-based coordinate\nvariant = genome.Variant.from_str('chr11:5225488:A>T')\nvariant_scores = client.query_variant(\n variant,\n requested_scorers=['AVI_SCORE', 'AVI_SCORE_FEATURE_IMPORTANCE'],\n)","type":"text"}]},{"type":"hr","attrs":{"markup":"--------------------------------------------------------------------------------"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Output Schemas & Response Structures","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"1. VCF CSQ & INFO Tag Schema (","type":"text"},{"text":"annotate","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]},{"type":"paragraph","content":[{"text":"When writing annotated VCF files, the following annotations are injected:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Ensembl VEP ","type":"text","marks":[{"type":"strong"}]},{"text":"CSQ","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" Format String","type":"text","marks":[{"type":"strong"}]},{"text":": ","type":"text"},{"text":"Allele|AVI_PHRED|AVI_RAW|AVI_QUANTILE|AVI_TOP_PERCENTILE|AVI_TOP_FEATURE","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Subfield Definitions","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Allele","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"string","type":"text","marks":[{"type":"em"}]},{"text":"): Alternate allele base(s) (e.g. ","type":"text"},{"text":"A","type":"text","marks":[{"type":"code_inline"}]},{"text":").","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"AVI_PHRED","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"float","type":"text","marks":[{"type":"em"}]},{"text":"): Calibrated Phred impact score (","type":"text"},{"type":"math_inline","content":[{"text":"\\text{Phred} =\n-10 \\cdot \\log_{10}(1.0 - \\text{quantile})","type":"text"}]},{"text":"). Range: ","type":"text"},{"text":"[0.0, ~70.0]","type":"text","marks":[{"type":"code_inline"}]},{"text":". Higher = greater functional impact.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"AVI_RAW","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"float","type":"text","marks":[{"type":"em"}]},{"text":"): Raw continuous model prediction.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"AVI_QUANTILE","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"float","type":"text","marks":[{"type":"em"}]},{"text":"): Calibrated tail quantile (","type":"text"},{"type":"math_inline","content":[{"text":"1 - \\text{CDF}","type":"text"}]},{"text":"). Range: ","type":"text"},{"text":"(0.0, 1.0]","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"AVI_TOP_PERCENTILE","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"float","type":"text","marks":[{"type":"em"}]},{"text":"): Top percentile of genome-wide SNVs (","type":"text"},{"type":"math_inline","content":[{"text":"10^{-\\text{Phred}/10} \\times 100\\%","type":"text"}]},{"text":", e.g. ","type":"text"},{"text":"0.0380","type":"text","marks":[{"type":"code_inline"}]},{"text":" for Top 0.038%).","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"AVI_TOP_FEATURE","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"string","type":"text","marks":[{"type":"em"}]},{"text":"): Display name of the top contributing biological modality (e.g. ","type":"text"},{"text":"Splicing","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"AlphaMissense","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"ChIP-TF","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"DNASE-seq","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"Cactus","type":"text","marks":[{"type":"code_inline"}]},{"text":").","type":"text"}]}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Standalone INFO Tags","type":"text","marks":[{"type":"strong"}]},{"text":" (unless ","type":"text"},{"text":"--vep_csq_only","type":"text","marks":[{"type":"code_inline"}]},{"text":"): ","type":"text"},{"text":"AVI_PHRED=Float","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"AVI_RAW=Float","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"AVI_QUANTILE=Float","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"AVI_TOP_PERCENTILE=Float","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"AVI_TOP_FEATURE=String","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"2. Tabular & JSON Record Schema (","type":"text"},{"text":"query","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"region","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"--top_output","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]},{"type":"paragraph","content":[{"text":"Output records exported to JSON, TSV, CSV, or Parquet contain the following fields:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"rank","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"integer","type":"text","marks":[{"type":"em"}]},{"text":", present in ","type":"text"},{"text":"--top_output","type":"text","marks":[{"type":"code_inline"}]},{"text":" and ","type":"text"},{"text":"region","type":"text","marks":[{"type":"code_inline"}]},{"text":" tabular exports): 1-based candidate rank sorted by Phred descending.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"variant","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"string","type":"text","marks":[{"type":"em"}]},{"text":"): Genomic variant string in ","type":"text"},{"text":"chr:pos_1_based:ref>alt","type":"text","marks":[{"type":"code_inline"}]},{"text":" format (e.g. ","type":"text"},{"text":"chr9:128225994:G>A","type":"text","marks":[{"type":"code_inline"}]},{"text":", where coordinate is 1-based).","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"chromosome","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"string","type":"text","marks":[{"type":"em"}]},{"text":"): Contig name with ","type":"text"},{"text":"chr","type":"text","marks":[{"type":"code_inline"}]},{"text":" prefix (e.g. ","type":"text"},{"text":"chr9","type":"text","marks":[{"type":"code_inline"}]},{"text":").","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"position","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"integer","type":"text","marks":[{"type":"em"}]},{"text":"): 1-based genomic coordinate.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"ref","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"string","type":"text","marks":[{"type":"em"}]},{"text":"): Reference allele base(s).","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"alt","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"string","type":"text","marks":[{"type":"em"}]},{"text":"): Alternate allele base(s).","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"avi_phred","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"float","type":"text","marks":[{"type":"em"}]},{"text":"): Calibrated Phred-scaled score.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"avi_raw","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"float","type":"text","marks":[{"type":"em"}]},{"text":"): Raw continuous model score.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"avi_quantile","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"float","type":"text","marks":[{"type":"em"}]},{"text":"): Tail quantile (","type":"text"},{"type":"math_inline","content":[{"text":"1 - \\text{CDF}","type":"text"}]},{"text":").","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"top_percentile","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"float","type":"text","marks":[{"type":"em"}]},{"text":"): Exact top percentile value (e.g. ","type":"text"},{"text":"0.3421","type":"text","marks":[{"type":"code_inline"}]},{"text":" for Top 0.34%).","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"top_modality","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"string","type":"text","marks":[{"type":"em"}]},{"text":"): Display name of the top contributing biological modality (e.g. ","type":"text"},{"text":"Splicing","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"AlphaMissense","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"ChIP-TF","type":"text","marks":[{"type":"code_inline"}]},{"text":").","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"top_feature_importance","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"float","type":"text","marks":[{"type":"em"}]},{"text":"): Attribution weight (SHAP value) of the top modality.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Optional Attribution Weights (","type":"text","marks":[{"type":"strong"}]},{"text":"--include_features","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":")","type":"text","marks":[{"type":"strong"}]},{"text":": 18 columns ","type":"text"},{"text":"fi_\u003cMODALITY>","type":"text","marks":[{"type":"code_inline"}]},{"text":" (e.g. ","type":"text"},{"text":"fi_MERGED_SPLICING","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"fi_ALPHAMISSENSE","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"fi_MAX_ABS_RNA_SEQ","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"fi_CACTUS_241_WAY","type":"text","marks":[{"type":"code_inline"}]},{"text":").","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Optional Track Provenance (","type":"text","marks":[{"type":"strong"}]},{"text":"--include_track_info","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":")","type":"text","marks":[{"type":"strong"}]},{"text":": ","type":"text"},{"text":"track_idx_\u003cMODALITY>","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"track_name_\u003cMODALITY>","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"track_biosample_\u003cMODALITY>","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"track_gene_\u003cMODALITY>","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"3. GTF Query Schema (","type":"text"},{"text":"gtf","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]},{"type":"paragraph","content":[{"text":"When querying gene structure with ","type":"text"},{"text":"gtf --format json","type":"text","marks":[{"type":"code_inline"}]},{"text":", each transcript object provides:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Gene & Transcript Metadata","type":"text","marks":[{"type":"strong"}]},{"text":": ","type":"text"},{"text":"gene_name","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"gene_id","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"transcript_id","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"transcript_type","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"chromosome","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"start","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"end","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"strand","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"is_mane_select","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"num_exons","type":"text","marks":[{"type":"code_inline"}]},{"text":" (coordinates are 1-based closed).","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Exons Array (","type":"text","marks":[{"type":"strong"}]},{"text":"--exons","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":")","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"exon_number","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"int","type":"text","marks":[{"type":"em"}]},{"text":"): 1-based exon index in 5' to 3' transcript order.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"start","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"end","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"width","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"int","type":"text","marks":[{"type":"em"}]},{"text":"): 1-based closed exon coordinates and length in bp.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"acceptor","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"donor","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"int","type":"text","marks":[{"type":"em"}]},{"text":"): 1-based 5' splice acceptor and 3' splice donor coordinates.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"overlaps_variant","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"bool","type":"text","marks":[{"type":"em"}]},{"text":"): True if overlapping the query mutation site.","type":"text"}]}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Junctions Array (","type":"text","marks":[{"type":"strong"}]},{"text":"--junctions","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":")","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"type","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"string","type":"text","marks":[{"type":"em"}]},{"text":"): ","type":"text"},{"text":"Canonical Intron {i}","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"Exon {k} Skipping","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"upstream_exon","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"downstream_exon","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"int","type":"text","marks":[{"type":"em"}]},{"text":"): 1-based flanking exon numbers in 5' to 3' transcript order.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"junction_start","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"junction_end","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"int","type":"text","marks":[{"type":"em"}]},{"text":"): 1-based genomic donor and acceptor coordinates.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"intron_length","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"int","type":"text","marks":[{"type":"em"}]},{"text":"): Intron length in bp.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"score_id","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"string","type":"text","marks":[{"type":"em"}]},{"text":"): Constructed Atlas track comparison token.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"atlas_url","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"string","type":"text","marks":[{"type":"em"}]},{"text":"): Clickable deep-link to Atlas track predictions.","type":"text"}]}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"CDS & UTR Arrays (","type":"text","marks":[{"type":"strong"}]},{"text":"--cds","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":", ","type":"text","marks":[{"type":"strong"}]},{"text":"--utr","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":")","type":"text","marks":[{"type":"strong"}]},{"text":": 1-based closed ","type":"text"},{"text":"start","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"end","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"width","type":"text","marks":[{"type":"code_inline"}]},{"text":" (","type":"text"},{"text":"int","type":"text","marks":[{"type":"em"}]},{"text":").","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"--------------------------------------------------------------------------------"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Score Metrics & Interpretation","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"AVI Phred","type":"text","marks":[{"type":"strong"}]},{"text":": Calibrated score (","type":"text"},{"text":"Phred = -10 * log10(1.0 - quantile)","type":"text","marks":[{"type":"code_inline"}]},{"text":"):","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phred >= 40","type":"text","marks":[{"type":"code_inline"}]},{"text":": ","type":"text"},{"text":"Top 0.01%","type":"text","marks":[{"type":"strong"}]},{"text":" predicted impact of all genome-wide SNVs.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phred >= 30","type":"text","marks":[{"type":"code_inline"}]},{"text":": ","type":"text"},{"text":"Top 0.10%","type":"text","marks":[{"type":"strong"}]},{"text":" predicted impact of all genome-wide SNVs.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phred >= 20","type":"text","marks":[{"type":"code_inline"}]},{"text":": ","type":"text"},{"text":"Top 1.0%","type":"text","marks":[{"type":"strong"}]},{"text":" predicted impact of all genome-wide SNVs.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phred >= 15","type":"text","marks":[{"type":"code_inline"}]},{"text":": ","type":"text"},{"text":"Top 3.16%","type":"text","marks":[{"type":"strong"}]},{"text":" predicted impact of all genome-wide SNVs.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phred >= 10","type":"text","marks":[{"type":"code_inline"}]},{"text":": ","type":"text"},{"text":"Top 10.0%","type":"text","marks":[{"type":"strong"}]},{"text":" predicted impact of all genome-wide SNVs.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phred \u003c 10","type":"text","marks":[{"type":"code_inline"}]},{"text":": ","type":"text"},{"text":"Bottom 90%","type":"text","marks":[{"type":"strong"}]},{"text":" of all genome-wide SNVs.","type":"text"}]}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Top Percentile","type":"text","marks":[{"type":"strong"}]},{"text":": Exact percentage of genome-wide SNVs with equal or greater impact: ","type":"text"},{"text":"Top Percentile = 10^(-Phred/10) * 100%","type":"text","marks":[{"type":"code_inline"}]},{"text":" (e.g. Phred 29.7 ","type":"text"},{"type":"math_inline","content":[{"text":"\\implies","type":"text"}]},{"text":" Top 0.11%).","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Top Modality","type":"text","marks":[{"type":"strong"}]},{"text":": Leading biological feature attribution (","type":"text"},{"text":"metadata --features","type":"text","marks":[{"type":"code_inline"}]},{"text":").","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"--------------------------------------------------------------------------------"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Visualizations & Atlas Deep-Linking","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"[!IMPORTANT] ","type":"text"},{"text":"Mandatory Atlas Deep-Linking with Variant Scores","type":"text","marks":[{"type":"strong"}]},{"text":": Whenever reporting, discussing, or displaying an AVI score for a variant (whether for a single variant query, a ranked candidate table, or a genomic region scan), you ","type":"text"},{"text":"MUST always provide a clickable deep-link to the ","type":"text","marks":[{"type":"strong"}]},{"text":"AlphaGenome Atlas","type":"text","marks":[{"type":"link","attrs":{"href":"https://deepmind.google.com/science/alphagenome/atlas","title":null}},{"type":"strong"}]},{"text":" for each variant.","type":"text"}]}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"User Context Prioritization","type":"text","marks":[{"type":"strong"}]},{"text":": Always prioritize ","type":"text"},{"text":"context from the user first","type":"text","marks":[{"type":"strong"}]},{"text":" (e.g., disease, tissue, or relevant cell types). When absent, use ","type":"text"},{"text":"--include_track_info","type":"text","marks":[{"type":"code_inline"}]},{"text":" with ","type":"text"},{"text":"query","type":"text","marks":[{"type":"code_inline"}]},{"text":" to discover the driving biosample, cell line, ontology CURIE, and track index.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Mandatory Splicing & RNA-seq Co-Plotting Rule","type":"text","marks":[{"type":"strong"}]},{"text":": Whenever plotting or visualizing splicing variants, ","type":"text"},{"text":"always plot continuous RNA-seq expression alongside splicing tracks","type":"text","marks":[{"type":"strong"}]},{"text":" (","type":"text"},{"text":"SPLICE_JUNCTIONS","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"SPLICE_SITE_USAGE","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"SPLICE_SITES","type":"text","marks":[{"type":"code_inline"}]},{"text":") to evaluate both structural splice disruption and resulting transcript abundance changes.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Atlas Link Construction","type":"text","marks":[{"type":"strong"}]},{"text":": Use the ","type":"text"},{"text":"alphagenome-atlas-website-links","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" skill","type":"text","marks":[{"type":"strong"}]},{"text":" (","type":"text"},{"text":"scripts/alphagenome_atlas_links.py","type":"text","marks":[{"type":"code_inline"}]},{"text":") for all URL generation, layout configuration (","type":"text"},{"text":"lItems","type":"text","marks":[{"type":"code_inline"}]},{"text":"), biosample filtering (","type":"text"},{"text":"f","type":"text","marks":[{"type":"code_inline"}]},{"text":"), and ","type":"text"},{"text":"/atlas/track-predictions","type":"text","marks":[{"type":"code_inline"}]},{"text":" comparison chart links.","type":"text"}]}]}]}]},"metadata":{"date":"2026-11-02","name":"alphagenome-variant-impact-score","author":"@skillopedia","source":{"stars":3384,"repo_name":"science-skills","origin_url":"https://github.com/google-deepmind/science-skills/blob/HEAD/skills/alphagenome_variant_impact_score/SKILL.md","repo_owner":"google-deepmind","body_sha256":"047e0b38f3ebbd56cf966c3263b86992d6101cbf4da501e113c19455468473fb","cluster_key":"e4cd89f68f18ec000f2b563f969ba6f3215eb883fda72a5b299bc1bf5167df83","clean_bundle":{"format":"clean-skill-bundle-v1","source":"google-deepmind/science-skills/skills/alphagenome_variant_impact_score/SKILL.md","text_bytes":73149,"source_commit":"4de6786171f1479026da5d3a00f110703c8ba35e","skills_sh_rank":18433,"attachment_count":2,"text_attachments":2,"attachment_storage":"skill_attachments","binary_attachments":0},"cluster_size":1,"skill_md_path":"skills/alphagenome_variant_impact_score/SKILL.md","import_metadata":{"date":"2026-11-02","author":"@skillopedia","version":"v1","category":"ai-agent-development","category_label":"AI"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"ai-agent-development","import_tag":"skills-sh-top20k-2026-11","description":"Score, annotate, and analyze the functional impact of genetic variants using AlphaGenome Variant Impact (AVI) scores. Query variants in chr:pos:ref>alt format, annotate VCF/tabular callsets, perform saturation mutagenesis window scans (1-based closed chr:start-end), and extract GENCODE v46 GTF gene/exon/junction coordinates all via the AlphaGenome Atlas API."}},"renderedAt":1793666698121}

AlphaGenome Variant Impact (AVI) Analysis Score and prioritize genetic variants using AlphaGenome Variant Impact (AVI) models via . [!IMPORTANT] Research Use Only & Clinical Safety Rules : The AlphaGenome AVI Skill and the underlying AlphaGenome model/Atlas are strictly research tools . Access to outputs requires an AlphaGenome API key subject to terms of service prohibiting clinical use. 1. No Medical Advice or Clinical Diagnosis : You MUST NOT provide medical advice, clinical diagnoses, disease management strategies, or treatment recommendations based on outputs from this skill or the Alpha…