tooluniverse-protein-sae-variant-interpretation

mims-harvard/tooluniverse

Интерпретация миссенс-варианта через активации признаков SAE модели ESMC-6B: какие признаки теряются или появляются.

Звёзды1 795
Авторmims-harvard

Установка

SKILL.md

Protein SAE Variant Interpretation

Interpret a single missense variant by comparing reference vs mutant Sparse Autoencoder (SAE) feature activations from the ESMC-6B protein language model. SAE features are interpretable latent dimensions of the model's hidden state — many activate on biologically meaningful patterns (active sites, ligand-binding pockets, PTM sequons, structural motifs).


When to use this skill

Apply when users:

  • Ask "why is variant X (a missense) loss-of-function?" and need a mechanistic answer beyond a pathogenicity score
  • Have an AlphaMissense / ClinVar "damaging" variant and want to know which functional feature breaks (catalytic? binding? PTM site? structural?)
  • Want to compare ref vs mutant protein representation at a specific residue
  • Are interpreting why a structurally subtle change (single AA) has a big functional impact

Not for (use other skills instead):

  • ACMG pathogenicity classification → tooluniverse-variant-interpretation
  • Regulatory / non-coding variants → tooluniverse-variant-to-mechanism
  • Variant-to-disease association without mechanism → tooluniverse-gene-disease-association
  • Cancer-specific variant interpretation → tooluniverse-cancer-variant-interpretation

Required inputs

InputFormatExample
Protein identifierUniProt accession or HGNC gene symbolP04637 or TP53
VariantSingle-letter code: {ref_aa}{position_1idx}{alt_aa}R175H

Optional:

  • Window radius (default 8): residues around the mutation to analyze
  • Reference protein sequence (skip the UniProt lookup if already known)

Prerequisites

  • ESM_API_KEY env var with a valid EvolutionaryScale Forge token (https://forge.evolutionaryscale.ai)
  • esm package with SAE support:<!-- -->
    pip install 'esm @ git+https://github.com/evolutionaryscale/esm@ee891c52'
    
    <!-- -->The PyPI release of esm does NOT yet include SAEConfig. Install from the upstream feature branch.

License note: SAE outputs from Forge are governed by the Cambrian Inference Clickthrough License — non-commercial / academic research use only unless a separate commercial agreement applies.


Workflow (5 steps)

Step 1: Resolve gene → UniProt accession (if needed)

If the user gave a gene symbol, resolve to a reviewed human accession:

UniProt_search(
    query="gene:TP53 AND organism_id:9606 AND reviewed:true",
    fields=["accession", "gene_names", "protein_name"],
)
# → returns accession P04637 as the canonical reviewed human TP53

Step 2: Fetch the canonical reference sequence

UniProt_get_sequence_by_accession(accession="P04637")
# → returns the canonical isoform 1 sequence (393 AA for TP53)

Step 3: Validate the reference residue + build mutant sequence

Parse the variant string (e.g. R175H):

  • ref_aa = "R", position = 175 (1-indexed), alt_aa = "H"
  • Verify ref_sequence[174] == "R" (Python is 0-indexed, position is 1-indexed)
  • Build mutant: mutant_sequence = ref_sequence[:174] + "H" + ref_sequence[175:]

If the reference residue does NOT match, return an explicit error — do not silently mutate the wrong position.

Quick path (recommended for variant analysis): composite tool

For the standard variant-interpretation use case, use one of two composite tools depending on how much you need:

Fullest one-call — disruption + per-feature biological category labels + mechanism summary:

ESM_explain_variant_mechanism(
    sequence=ref_sequence,
    position=175, ref_aa="R", alt_aa="H",
    window=8,
    top_k_features=5,       # describe top 5 lost + top 5 gained
)
# data["mechanism_summary"] e.g. "Disrupted feature categories (lost): catalytic=2, ligand-binding=1"
# data["lost_feature_categories"] / ["gained_feature_categories"] — category counts
# data["top_features_lost"] / ["top_features_gained"] — per-feature delta + category + confidence

This is the right default for variant-mechanism reports — saves you from chaining ESM_score_variant_sae_disruption + N ESM_describe_sae_feature calls. Set include_descriptions=false to skip labeling (2 Forge calls only) when you just need the deltas.

Raw delta only (no category labels, no describe calls — faster):

ESM_score_variant_sae_disruption(
    sequence=ref_sequence,
    position=175, ref_aa="R", alt_aa="H",
    window=8, top_k_features=10,
)
# → returns top_features_lost + top_features_gained ranked by |delta|
#   plus ref / mut activation sums per feature

If ref_aa doesn't match the sequence at the given position, both tools return a clear error (you supplied the wrong isoform / mis-labeled the variant). The longer path below is for inspecting raw per-residue features.

Multiple variants at once (e.g. saturation at residue 175 — all 19 alternates):

alts = "ACDEFGHIKLMNPQRSTVWY".replace("R", "")
variants = [{"position": 175, "ref_aa": "R", "alt_aa": a} for a in alts]
ESM_score_variant_sae_batch(sequence=ref_sequence, variants=variants, top_k_features=5)
# 1 + 19 = 20 Forge calls, not 38

Step 4 (long path): Get SAE features for reference and mutant

ref_features = ESM_get_sae_features(
    sequence=ref_sequence,
    position=175,          # 1-indexed mutation position
    window=8,              # +/- 8 residues = 17-residue window
    top_k_per_residue=64,  # full sparsity (k=64 is the SAE's actual k)
)

mut_features = ESM_get_sae_features(
    sequence=mutant_sequence,
    position=175,
    window=8,
    top_k_per_residue=64,
)

Each call returns a list of {residue_idx_1based, active_features: [{feature_id, activation}]} for residues in the window. Typical latency: ~1-3 seconds per call (so ~2-6s total). Forge cost: 2 credits (1 per call).

Step 5: Compute per-feature activation deltas

Aggregate gained / lost features over the window:

# Build per-feature activation arrays across the window
def feature_to_window_sum(features_response):
    sums = {}  # feature_id -> sum of activations across all residues in window
    for residue in features_response["data"]["activations"]:
        for f in residue["active_features"]:
            sums[f["feature_id"]] = sums.get(f["feature_id"], 0.0) + f["activation"]
    return sums

ref_sums = feature_to_window_sum(ref_features)
mut_sums = feature_to_window_sum(mut_features)

# Delta = mut - ref. Positive = gained on mutation. Negative = lost.
all_features = set(ref_sums) | set(mut_sums)
deltas = {
    f: mut_sums.get(f, 0.0) - ref_sums.get(f, 0.0)
    for f in all_features
}

top_lost = sorted(deltas.items(), key=lambda x: x[1])[:10]       # most negative
top_gained = sorted(deltas.items(), key=lambda x: -x[1])[:5]     # most positive

Interpretation table

The 16,384 SAE features have been categorized (by UniRef90 activation patterns) into ~6 biological types. Interpret features by their dominant category:

CategoryWhat it means biologicallyVariant types it often catches
Catalytic functionActivates on residues at or near enzyme active sitesVariants that disrupt enzymatic activity (kinases, hydrolases, transferases)
Ligand-binding siteActivates on residues that contact small-molecule / ion / nucleotide ligandsVariants disrupting drug binding, ATP/GTP binding, metal coordination, DNA/RNA binding
Post-translational modification (PTM)Activates on phospho-sites, glycosylation sequons, ubiquitin sites, acetylation sitesVariants disrupting phospho-regulation, N-glycosylation, ubiquitin-mediated degradation
Domain / motifActivates on classic structural domains (Zn finger, leucine zipper, EF-hand, etc.)Variants disrupting tertiary fold within a domain
Structural stabilityActivates on residues critical to local foldVariants destabilizing the protein → folding LoF
Secondary structure / surfaceActivates on alpha helices, beta strands, solvent-exposed residuesLower-specificity; weak mechanism signal

When SAE features are lost in mutation → that biological capability is plausibly disrupted.
<!-- -->When SAE features are gained → mutation may have introduced a non-native signal (often disorder / alternative fold).

Look up the biological category of any specific feature_id via ESM_describe_sae_feature(feature_id=...). The first call for a given feature is slow (~30s, ~10 Forge credits as the tool runs SAE on a 10-protein labeling panel + checks UniProt annotations); subsequent calls for the same feature hit a local cache and are instant.


Honest limitations

  1. SAE features ≠ ground-truth function. SAE features are LEARNED from sequence patterns. "Feature 16076 looks like an N-glycosylation detector" is a hypothesis from how the feature behaves across UniRef90, not a per-residue functional annotation. Use it as evidence, not proof.
  2. ±8 residue window only. The window covers local effects (active-site disruption, motif breakage). It does NOT capture long-range allosteric effects, dimerization interface effects, or domain-domain rearrangements that change features far from the mutation.
  3. Feature label coverage is partial. Some of the 16,384 features have not been categorized well — they activate diffusely or on unclear patterns. For uncategorized features, the SAE delta is still informative (something changed) but the biological interpretation is weaker.
  4. Single-isoform only. Uses UniProt canonical sequence. If the variant lives in a non-canonical isoform, results may not apply.
  5. 6b SAE only. Currently TU supports the esmc-6b-2024-12_k64_codebook16384_layer60 SAE. The smaller 600m SAE exists but has not been validated against the LoF benchmark from the source repo.
  6. Forge API non-commercial. Outputs from this skill cannot be used for commercial purposes without a separate license from EvolutionaryScale.

Cross-validation pattern (recommended)

A single SAE-based analysis can be misleading on its own. For high-stakes interpretation, cross-validate with structural / population evidence:

LayerToolConfirms
Population frequencygnomad_get_variant / gnomad_search_variantsIs the variant rare? (LoF candidates are usually rare or absent)
Pathogenicity predictionAlphaMissense_get_variant_scoreDoes an independent ML predictor agree it's damaging?
Clinical evidenceClinVar_search_variants + ClinVar_get_variant_detailsIs this variant already curated with clinical significance?
Structural contextalphafold_get_prediction (returns pLDDT per residue)Is the mutated residue in a well-folded region (pLDDT > 70)?
Functional annotationUniProt_get_disease_variants_by_accession, UniProt_get_function_by_accessionIs the mutated residue in a known catalytic / binding / PTM site?

If 3+ layers agree the variant is damaging, the SAE feature analysis is the mechanistic explanation layer: "AlphaMissense says it's damaging, gnomAD confirms it's absent in population, SAE shows the catalytic feature is lost → this is a catalytic LoF variant."


Reporting format

After completing the workflow, summarize as:

Variant: {VARIANT_ID}  (e.g. P04637_R175H = TP53 R175H)
Protein: {gene} ({uniprot_accession})

Top features LOST at position {position} ± {window}:
  - Feature {id}: activation Δ = {delta:.2f}  (category: {category})
    {one-line biological summary}
  ...

Top features GAINED at position {position} ± {window}:
  - Feature {id}: Δ = +{delta:.2f}  (category: {category if known else "uncategorized"})
  ...

Mechanistic interpretation: {2-3 sentences synthesizing the SAE evidence
with cross-validation layers}

Confidence: {high|medium|low}, based on:
  - SAE evidence: {how clear is the dominant category?}
  - Cross-validation: {how many layers agree?}
  - Limitations encountered: {any of the 6 caveats above that apply}

Вставить в README

Ссылка на карточку для вашего README — без картинок и счётчиков.

[DarkPlay: tooluniverse-protein-sae-variant-interpretation](https://darkplay.ru/ai/skills/mims-harvard-tooluniverse-tooluniverse-protein-sae-variant-interpretation)

Из того же репозитория

tooluniverse-lipidomics Анализ липидов и их связи с заболеваниями через LIPID MAPS, HMDB, KEGG и PubChem. ★1,8K tooluniverse-model-organism-genetics Межвидовой генетический анализ через базы модельных организмов: MGI, ZFIN, FlyBase, SGD и ★1,8K tooluniverse-kegg-disease-drug Сеть болезнь–лекарство–вариант на основе баз KEGG для репозиционирования препаратов. ★1,8K tooluniverse-adverse-outcome-pathway Связь химических веществ с неблагоприятными исходами (AOP) через AOPWiki, GHS и IARC. ★1,8K tooluniverse-metabolomics-pathway Анализ метаболических путей: идентификация метаболитов, картирование путей, связи с болезн ★1,8K tooluniverse-comparative-genomics Сравнение генов между видами и анализ ортологов через Ensembl, NCBI, UniProt и другие базы ★1,8K tooluniverse-pathway-disease-genetics Связывание вариантов GWAS с генами, путями (Reactome, KEGG, WikiPathways) и лекарствами-ми ★1,8K tooluniverse-protein-modification-analysis Анализ посттрансляционных модификаций: фосфорилирование, убиквитинирование, ацетилирование ★1,8K

Похожие скиллы и другие разделы каталога

Популярное в разделе «Скиллы»

Самые востребованные скиллов раздела по установкам и звёздам.

find-skillsvercel-labs · Помогает находить и устанавливать навыки агентов по запросам вроде «как сделать X»…
4 400 000 устан.
grill-memattpocock · Настойчивое интервью для доработки плана или дизайна.
1 600 000 устан.
hyperframesheygen-com · Обязательная точка входа для любых задач по видео, анимации и motion-графике в…
1 600 000 устан.
hyperframes-cliheygen-com · Цикл разработки HyperFrames CLI: init, add, render, preview, publish и другие команды.
1 600 000 устан.
agent-browservercel-labs · CLI для автоматизации браузера для ИИ-агентов: навигация по страницам, заполнение форм…
1 600 000 устан.
media-useheygen-com · Agent Media OS: единый навык для медиа в HyperFrames — BGM, SFX, изображения, голос, LUT.
1 500 000 устан.
hyperframes-registryheygen-com · Установка и подключение блоков реестра в композиции HyperFrames через add и catalog.
1 400 000 устан.
grill-with-docsmattpocock · Настойчивое интервью для доработки плана или дизайна, попутно создающее документацию (ADR…
1 300 000 устан.
improve-codebase-architecturemattpocock · Поиск в кодовой базе возможностей для углубления, визуальный HTML-отчёт о них и детальный…
1 300 000 устан.
tddmattpocock · Разработка через тестирование (TDD): red-green-refactor и интеграционные тесты.
1 300 000 устан.
Похожее в других разделах каталога

Соседние разделы каталога: возможно, нужный инструмент живёт там.

Spec Mineraffaan-m · Извлекает поведенческие спецификации из кода для OpenSpec в виде блоков Requirement и…
225 587 ★
Type Design Analyzeraffaan-m · Анализ дизайна типов: инкапсуляция, инварианты, полезность, соблюдение.
225 587 ★
boltzanthropics · Предсказание структур, скрининг молекул и белков, дизайн биндеров с Boltz из Claude Code.
100 комп.
oh-my-claudecodeYeachan-Heo · Нативная мультиагентная оркестрация Claude Code с интеллектуальной маршрутизацией…
89 комп.
Amplitude Experiment Implementationgithub · Этот кастомный агент использует MCP-инструменты Amplitude для запуска новых экспериментов…
36 140 ★
Type Design Analyzeranthropics · Агент для анализа типов в кодовой базе: инкапсуляция, инварианты, ревью новых типов в PR.
31 495 ★
semgrep-rule-variant-creatortrailofbits · Создаёт языковые варианты существующих правил Semgrep с анализом применимости и проверкой…
122 комп.
variant-analysistrailofbits · Поиск похожих уязвимостей и багов в кодовых базах с помощью анализа по шаблонам.
122 комп.
trailofbits:variantstrailofbits · Находит похожие уязвимости с помощью анализа по паттернам.
5 976 ★
backend-security-skillsanthropics · Аудитор безопасности для бэкенд-API на Node.js и Python. Четыре навыка охватывают…
38 комп.

Лучшие ИИ-инструменты для программирования

ИИ для программирования

Подборка нейросетей и ИИ-ассистентов для разработки и автоматизации кода. Сервисы, которые ускоряют написание, ревью и отладку, экономят часы рутины и снижают порог входа в сложные

GenAPIGenapi
По запросу
5.0
Notepad++ AINotepad-plus-plus
По запросу
4.9
GitHub CopilotGitHub
По подписке
4.9
Creatium MaxCremax
По запросу
4.8
Emacs AIGnu
По запросу
4.8
KiteKite
По запросу
4.8
Amazon Q DeveloperAmazon
По запросу
4.8
VECTA
Есть бесплатный тариф
4.8
SoftPractice
Есть бесплатный тариф
4.8
VibeForge
Есть бесплатный тариф
4.7

Лучшие ИИ-инструменты для генерации видео

Генерация видео

Подборка нейросетей для генерации и монтажа видео. Инструменты, которые превращают текст в готовые ролики, экономят часы на съемках и постпродакшне. Подходит для SMM-специалистов,

VEED.IOVeed
По запросу
5.0
MootionMootion
По запросу
5.0
FlyviFlyvi
Есть бесплатный тариф
4.9
Google Veo 3.1Google
Платно
4.9
Sora (OpenAI)OpenAI
Платно
4.9
PikaPika
Платно
4.9
captions space
Есть бесплатный тариф
4.8
Клайп
Есть бесплатный тариф
4.8
viralpulse.appViralpulse
По запросу
4.8
Viral Maker AIViral-maker
Есть бесплатный тариф
4.8

Лучшие ИИ-инструменты для генерации текста и копирайтинга

Генерация текста и копирайтинг

Подборка нейросетей для генерации текстов и копирайтинга. Сервисы, которые помогают создавать статьи, посты и рекламные объявления с нуля или по черновику, экономя часы рутинной ра

NeuroscribeNeuroscribe
Есть бесплатный тариф
5.0
GoGPTGogpt
По запросу
5.0
ChatsonicChatsonic
По запросу
4.9
НейроТекстерNeuro-texter
По запросу
4.9
ChatGPTOpenAI
По подписке
4.9
Редактум
Есть бесплатный тариф
4.8
ChadGPTChadgpt
По запросу
4.8
Cosmo ScribeCosmoscribe
Есть бесплатный тариф
4.8
Memo HelperCopilot33
По запросу
4.8
LibraChatLibrachat
Есть бесплатный тариф
4.8