Variant Annotation
Query and interpret gene variant clinical significance from ClinVar and dbSNP databases with ACMG guideline support.
Purpose
Provide comprehensive variant annotation including:
- - Clinical significance classification (Pathogenic, Likely Pathogenic, VUS, Likely Benign, Benign)
- ACMG guideline-based pathogenicity assessment
- Population allele frequencies (gnomAD, ExAC, 1000 Genomes)
- Disease and phenotype associations
- Functional predictions (SIFT, PolyPhen, CADD)
Supported Input Formats
| Format | Example | Description |
|---|
| rsID | INLINECODE0 | dbSNP reference SNP ID |
| HGVS cDNA |
NM_007294.3:c.5096G>A | Coding DNA change |
|
HGVS Protein |
NP_009225.1:p.Arg1699Gln | Protein change |
|
HGVS Genomic |
NC_000017.11:g.43094692G>A | Genomic coordinate |
|
VCF-style |
chr17:43094692:G>A | Chromosome:position:ref>alt |
|
Gene:AA |
BRCA1:R1699Q | Gene with amino acid change |
Usage
Python API
CODEBLOCK0
Command Line
CODEBLOCK1
Output Format
CODEBLOCK2
ACMG Classification Criteria
The annotator implements the ACMG/AMP guidelines for variant interpretation:
Pathogenic Evidence (Score)
- - PVS1 (8.0): Null variant in a gene where LOF is known mechanism
- PS1 (4.0): Same amino acid change as known pathogenic
- PS2 (4.0): De novo with confirmed paternity/maternity
- PS3 (4.0): Well-established functional studies show damaging effect
- PS4 (4.0): Prevalence in affected > controls
- PM1 (2.0): Located in critical functional domain
- PM2 (2.0): Absent from controls (MAF <0.0001)
- PM3 (2.0): AR disorder, detected in trans with pathogenic
- PM4 (2.0): Protein length changing
- PM5 (2.0): Novel missense at same position as known pathogenic
- PM6 (2.0): Assumed de novo without confirmation
- PP1 (1.0): Cosegregation with disease
- PP2 (1.0): Missense in gene with low benign rate
- PP3 (1.0): Multiple computational evidence support
- PP4 (1.0): Phenotype/patient history matches gene
- PP5 (1.0): Reputable source reports pathogenic
Benign Evidence
- - BA1 (-8.0): MAF >5% in population
- BS1 (-4.0): MAF >expected for disorder
- BS2 (-4.0): Observed in healthy adult
- BS3 (-4.0): Functional studies show no damage
- BS4 (-4.0): Lack of cosegregation
- BP1 (-1.0): Missense in gene where truncating are pathogenic
- BP2 (-1.0): Observed in trans with pathogenic
- BP3 (-1.0): In-frame indel in repetitive region
- BP4 (-1.0): Multiple computational evidence benign
- BP5 (-1.0): Alternate cause found
- BP6 (-1.0): Reputable source reports benign
- BP7 (-1.0): Synonymous with no splicing impact
Classification Thresholds
| Classification | Score Range |
|---|
| Pathogenic | ≥ 10 |
| Likely Pathogenic |
6-9 |
| Uncertain Significance | 0-5 |
| Likely Benign | -5 to -1 |
| Benign | ≤ -6 |
Technical Difficulty: HIGH
⚠️ AI自主验收状态: 需人工检查
This skill requires:
- - NCBI E-utilities API integration (ClinVar, dbSNP)
- HGVS notation parsing and validation
- VCF format handling
- ACMG guideline implementation
- Multiple prediction algorithm integration
- Complex data transformation and scoring
Data Sources
| Database | Data Type | API/Access |
|---|
| ClinVar | Clinical significance, disease associations | NCBI E-utilities |
| dbSNP |
SNP data, allele frequencies | NCBI E-utilities |
|
gnomAD | Population frequencies | gnomAD API |
|
Ensembl VEP | Functional predictions | REST API |
|
CADD | Deleteriousness scores | REST API |
Limitations
- - Requires internet connection for database queries
- NCBI API rate limits: 3 requests/second (API key increases to 10/sec)
- Some variants may not be present in ClinVar (VUS without clinical data)
- HGVS notation parsing may fail for complex variants
- Population frequencies not available for all variants
- Functional predictions are computational estimates only
References
See references/ for:
- - ACMG guidelines publication (Richards et al. 2015)
- ClinVar documentation
- HGVS nomenclature guide
- dbSNP data dictionary
- Example variant outputs
Safety & Disclaimer
⚠️ IMPORTANT: This tool is for research and educational purposes only. Variant interpretations are computational predictions and should not be used as the sole basis for clinical decisions. Always consult certified genetic counselors and clinical laboratories for diagnostic purposes. ACMG classifications in this tool are algorithmic estimates and may differ from expert panel reviews.
Risk Assessment
| Risk Indicator | Assessment | Level |
|---|
| Code Execution | Python scripts with tools | High |
| Network Access |
External API calls | High |
| File System Access | Read/write data | Medium |
| Instruction Tampering | Standard prompt guidelines | Low |
| Data Exposure | Data handled securely | Medium |
Security Checklist
- - [ ] No hardcoded credentials or API keys
- [ ] No unauthorized file system access (../)
- [ ] Output does not expose sensitive information
- [ ] Prompt injection protections in place
- [ ] API requests use HTTPS only
- [ ] Input validated against allowed patterns
- [ ] API timeout and retry mechanisms implemented
- [ ] Output directory restricted to workspace
- [ ] Script execution in sandboxed environment
- [ ] Error messages sanitized (no internal paths exposed)
- [ ] Dependencies audited
- [ ] No exposure of internal service architecture
Prerequisites
CODEBLOCK3
Evaluation Criteria
Success Metrics
- - [ ] Successfully executes main functionality
- [ ] Output meets quality standards
- [ ] Handles edge cases gracefully
- [ ] Performance is acceptable
Test Cases
- 1. Basic Functionality: Standard input → Expected output
- Edge Case: Invalid input → Graceful error handling
- Performance: Large dataset → Acceptable processing time
Lifecycle Status
- - Current Stage: Draft
- Next Review Date: 2026-03-06
- Known Issues: None
- Planned Improvements:
- Performance optimization
- Additional feature support
Parameters
| Parameter | Type | Default | Description |
|---|
| INLINECODE7 | str | Required | |
| INLINECODE8 |
str | Required | |
|
--output | str | Required | |
|
--format | str | "json" | |
|
--api-key | str | Required | NCBI API key for increased rate limits |
|
--delay | float | 0.34 | |
变异注释
从ClinVar和dbSNP数据库中查询和解读基因变异的临床意义,支持ACMG指南。
目的
提供全面的变异注释,包括:
- - 临床意义分类(致病性、可能致病性、意义不明确、可能良性、良性)
- 基于ACMG指南的致病性评估
- 群体等位基因频率(gnomAD、ExAC、千人基因组计划)
- 疾病和表型关联
- 功能预测(SIFT、PolyPhen、CADD)
支持的输入格式
| 格式 | 示例 | 描述 |
|---|
| rsID | rs80357410 | dbSNP参考SNP ID |
| HGVS cDNA |
NM_007294.3:c.5096G>A | 编码DNA变化 |
|
HGVS蛋白质 | NP_009225.1:p.Arg1699Gln | 蛋白质变化 |
|
HGVS基因组 | NC_000017.11:g.43094692G>A | 基因组坐标 |
|
VCF风格 | chr17:43094692:G>A | 染色体:位置:参考>替代 |
|
基因:氨基酸 | BRCA1:R1699Q | 基因与氨基酸变化 |
使用方法
Python API
python
from scripts.main import VariantAnnotator
初始化注释器
annotator = VariantAnnotator()
通过rsID查询
result = annotator.query_variant(rs80357410)
通过HGVS表示法查询
result = annotator.query
variant(NM007294.3:c.5096G>A)
通过基因组坐标查询
result = annotator.query_variant(chr17:43094692:G>A)
批量查询
results = annotator.batch_query([rs80357410, rs28897696, rs11571658])
命令行
bash
单个变异查询
python scripts/main.py --variant rs80357410
HGVS表示法
python scripts/main.py --variant NM_007294.3:c.5096G>A
基因组坐标
python scripts/main.py --variant chr17:43094692:G>A
从文件批量查询
python scripts/main.py --file variants.txt --output results.json
指定输出格式
python scripts/main.py --variant rs80357410 --format json
输出格式
json
{
variant_id: rs80357410,
gene: BRCA1,
chromosome: 17,
position: 43094692,
ref_allele: G,
alt_allele: A,
hgvsgenomic: NC000017.11:g.43094692G>A,
hgvscdna: NM007294.3:c.5096G>A,
hgvsprotein: NP009225.1:p.Arg1699Gln,
clinical_significance: {
clinvar: 致病性,
acmg_classification: 致病性,
acmg_criteria: [PS4, PM1, PM2, PP2, PP3, PP5],
acmg_score: 13.0,
review_status: 已提供标准,多个提交者,无冲突
},
disease_associations: [
{
disease: 家族性乳腺癌-卵巢癌1型,
medgen_id: C2676676,
significance: 致病性
}
],
population_frequencies: {
gnomADgenomeall: 0.000008,
gnomADexomeall: 0.000012,
1000G_all: 0.0
},
functional_predictions: {
sift: 有害,
polyphen2: 可能有害,
cadd_score: 24.5,
mutation_taster: 致病性
},
literature_count: 42,
last_evaluated: 2023-12-15,
interpretation_summary: 该变异(BRCA1 p.Arg1699Gln)根据ACMG指南被分类为致病性。其致病性证据充分,包括群体数据(极罕见)、计算预测(有害)以及显著的临床意义(与遗传性乳腺癌-卵巢癌的确定关联)。
}
ACMG分类标准
注释器实现了ACMG/AMP变异解读指南:
致病性证据(分值)
- - PVS1 (8.0):功能丧失是已知机制的基因中的无效变异
- PS1 (4.0):与已知致病变异相同的氨基酸变化
- PS2 (4.0):经确认父母本的新发变异
- PS3 (4.0):完善的功能研究显示有害效应
- PS4 (4.0):患者中患病率高于对照组
- PM1 (2.0):位于关键功能域
- PM2 (2.0):对照组中不存在(MAF <0.0001)
- PM3 (2.0):常染色体隐性遗传病,与致病变异反式检测
- PM4 (2.0):蛋白质长度改变
- PM5 (2.0):与已知致病变异相同位置的新错义变异
- PM6 (2.0):假定新发但未经确认
- PP1 (1.0):与疾病共分离
- PP2 (1.0):良性率低的基因中的错义变异
- PP3 (1.0):多项计算证据支持
- PP4 (1.0):表型/患者病史与基因匹配
- PP5 (1.0):权威来源报告为致病性
良性证据
- - BA1 (-8.0):群体中MAF >5%
- BS1 (-4.0):MAF高于疾病预期值
- BS2 (-4.0):在健康成人中观察到
- BS3 (-4.0):功能研究显示无损害
- BS4 (-4.0):缺乏共分离
- BP1 (-1.0):截断变异为致病性的基因中的错义变异
- BP2 (-1.0):与致病变异反式观察到
- BP3 (-1.0):重复区域中的框内插入缺失
- BP4 (-1.0):多项计算证据为良性
- BP5 (-1.0):发现其他原因
- BP6 (-1.0):权威来源报告为良性
- BP7 (-1.0):同义变异且无剪接影响
分类阈值
6-9 |
| 意义不明确 | 0-5 |
| 可能良性 | -5 至 -1 |
| 良性 | ≤ -6 |
技术难度:高
⚠️ AI自主验收状态:需人工检查
此技能需要:
- - NCBI E-utilities API集成(ClinVar、dbSNP)
- HGVS表示法解析和验证
- VCF格式处理
- ACMG指南实现
- 多种预测算法集成
- 复杂数据转换和评分
数据来源
| 数据库 | 数据类型 | API/访问方式 |
|---|
| ClinVar | 临床意义、疾病关联 | NCBI E-utilities |
| dbSNP |
SNP数据、等位基因频率 | NCBI E-utilities |
|
gnomAD | 群体频率 | gnomAD API |
|
Ensembl VEP | 功能预测 | REST API |
|
CADD | 有害性评分 | REST API |
局限性
- - 需要网络连接进行数据库查询
- NCBI API速率限制:3次请求/秒(API密钥可提高至10次/秒)
- 某些变异可能不在ClinVar中(无临床数据的意义不明确变异)
- 复杂变异的HGVS表示法解析可能失败
- 并非所有变异都有群体频率数据
- 功能预测仅为计算估计
参考文献
参见 references/ 目录:
- - ACMG指南出版物(Richards等人,2015年)
- ClinVar文档
- HGVS命名指南
- dbSNP数据字典
- 示例变异输出
安全性与免责声明
⚠️ 重要提示:此工具仅用于研究和教育目的。变异解读为计算预测,不应作为临床决策的唯一依据。诊断目的请始终咨询认证的遗传咨询师和临床实验室。本工具中的ACMG分类为算法估计,可能与专家小组评审结果不同。
##