drclaw/agent_hub/templates/genomics/skills/variant-genomic-location/SKILL.md
Query dbSNP + NCBI Gene to get variant genomic position (chromosome, coordinates, ref/alt alleles, mutation type) and associated gene coordinates.
npx skillsauth add qzzqzzb/drclaw variant-genomic-locationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Step 1: Query NCBI dbSNP REST API to get variant position, ref/alt alleles, gene association.
API: GET https://api.ncbi.nlm.nih.gov/variation/v0/refsnp/{rsid_number}
Step 2: Query NCBI Gene API to get the full coordinate range of the associated gene.
API: GET https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=gene&id={gene_id}&retmode=json
Args:
rs_id (str): dbSNP rsID (e.g. "rs7412")
Return:
染色体, 突变位置(0-based start/end), 突变类型(SNV/insertion/deletion),
ref/alt等位基因, 关联基因名称及其完整坐标范围.
import requests
rs_id = "rs7412"
# ── Step 1: dbSNP 查询变异信息 ──
url = f"https://api.ncbi.nlm.nih.gov/variation/v0/refsnp/{rs_id.replace('rs','')}"
resp = requests.get(url, timeout=30).json()
snapshot = resp.get("primary_snapshot_data", {})
variant_type = snapshot.get("variant_type", "unknown") # snv, ins, del 等
# 提取 GRCh38 坐标
chrom, start, end, ref, alt, hgvs = "", 0, 0, "", "", ""
for p in snapshot.get("placements_with_allele", []):
for trait in p.get("placement_annot", {}).get("seq_id_traits_by_assembly", []):
if "GRCh38" in trait.get("assembly_name", ""):
for allele in p.get("alleles", []):
spdi = allele.get("allele", {}).get("spdi", {})
r = spdi.get("deleted_sequence", "")
a = spdi.get("inserted_sequence", "")
if r != a:
chrom = spdi.get("seq_id", "")
start = spdi.get("position", 0)
ref, alt = r, a
end = start + len(ref)
hgvs = allele.get("hgvs", "")
# 判断突变类型
if len(ref) == 1 and len(alt) == 1:
mut_type = f"SNV (替换: {ref}→{alt})"
elif len(ref) > len(alt):
mut_type = f"Deletion (缺失: 丢失{len(ref)-len(alt)}个碱基)"
elif len(ref) < len(alt):
mut_type = f"Insertion (插入: 增加{len(alt)-len(ref)}个碱基)"
else:
mut_type = f"MNV (多核苷酸替换: {ref}→{alt})"
print(f"[dbSNP] rsID: {rs_id}")
print(f"[dbSNP] 染色体: {chrom}")
print(f"[dbSNP] 突变位置: start={start}, end={end} (0-based)")
print(f"[dbSNP] 突变类型: {mut_type}")
print(f"[dbSNP] HGVS: {hgvs}")
# 提取关联基因 ID 和名称
gene_id, gene_name = None, ""
for ann in snapshot.get("allele_annotations", []):
for asm in ann.get("assembly_annotation", []):
for gene in asm.get("genes", []):
gene_id = gene.get("id")
gene_name = gene.get("locus", "")
print(f"[dbSNP] 关联基因: {gene_name} ({gene.get('name','')}), NCBI Gene ID: {gene_id}")
break
if gene_id:
break
# ── Step 2: NCBI Gene 查询基因完整坐标范围 ──
if gene_id:
gene_url = f"https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=gene&id={gene_id}&retmode=json"
gene_resp = requests.get(gene_url, timeout=30).json()
gene_info = gene_resp.get("result", {}).get(str(gene_id), {})
for g in gene_info.get("genomicinfo", []):
g_chr = g.get("chraccver", "")
g_start = g.get("chrstart", 0)
g_stop = g.get("chrstop", 0)
exon_count = g.get("exoncount", 0)
print(f"[Gene] {gene_name} 完整坐标: {g_chr}:{g_start}-{g_stop} (0-based)")
print(f"[Gene] 基因长度: {abs(g_stop - g_start) + 1} bp, 外显子数: {exon_count}")
content-media
当用户明确要求“写/生成 NSFC 预算说明书”“写预算说明”“生成 budget.tex / budget.pdf”“写国自然预算 justification”时使用。基于用户标书正文或补充材料,输出一份可提交的预算说明书 LaTeX 项目并渲染 `budget.pdf`。若用户未指定工作目录,必须暂停并先要求其指定。⚠️ 不适用:用户只是想了解预算原则;用户仅要预算表数字而不写说明书;或用户是 2026 青年 A/B/C 默认包干制且无需预算说明书的场景。
tools
当用户明确要求"写/润色 NSFC 标书摘要""生成中文摘要和英文摘要""把中文摘要翻译成英文摘要"时使用。输出中文、英文两个版本(英文必须是中文的忠实翻译版),同时输出标题建议(1个推荐标题+5个候选标题及理由)。中文摘要默认≤400字符,英文摘要默认≤4000字符。输出方式:将结果写入工作目录下的 `NSFC-ABSTRACTS.md`。⚠️ 不适用:用户只想翻译一段与标书无关的通用文本(应直接翻译);用户只想写立项依据/研究内容/研究基础正文(应使用对应 nsfc 系列 skill)。
documentation
当用户明确要求"更新项目指南""同步指南""沉淀洞见到指南"时使用。将对话中新产生的可复用写作洞见实时沉淀到项目指南文件,保持术语口径一致、结构稳定、可检验与可复现。调用时必须指定指南文件路径。
content-media
当用户明确要求"从文件/图片/网页/描述中提取综述主题"或"生成主题+关键词+核心问题结构化输出"时使用。支持文件(PDF/Word/Markdown/Tex)、文件夹、图片、自然语言描述、网页 URL 等多种输入源,自动识别输入类型并提取内容,生成可直接用于 systematic-literature-review 及其他文献综述技能的结构化输出。