bio-clinical-databases-dbsnp-queries
Resolves rsIDs, navigates RsMergeArch/SNPHistory merge chains, and converts between rsID, SPDI, HGVS, and VCF representations using the dbSNP Build 156 JSON…
от BioTender-max★ 235 звёзд на GitHub
Установить bio-clinical-databases-dbsnp-queries в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Version Compatibility
Reference examples tested with: myvariant 1.0+, requests 2.31+, biopython 1.83+, Entrez Direct 21.0+. dbSNP Build 156 (September 2022) is the current schema; Build 151 (2017) was the last with relational SQL dumps. Builds 152-155 dual-released JSON+SQL; 156+ is JSON-only.
Before using code patterns, verify installed versions match. If versions differ:
- Python:
pip show <package>thenhelp(module.function)to check signatures - CLI:
<tool> --versionthen<tool> --helpto confirm flags
If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying. The Variation Services REST API uses path-based versioning (/variation/v0/); E-utilities db=snp returns thin legacy summaries missing build-156 schema fields.
dbSNP Queries and rsID Normalization
'Look up this rsID / normalize variant representations' -> Resolve rsIDs through merge chains, compute canonical SPDI, and convert between rsID, HGVS-g, HGVS-c, and VCF allele representations.
- Python (aggregator):
myvariant.MyVariantInfo().getvariant(rsid, fields=['dbsnp', 'clinvar', 'gnomad_exome']) - Python (direct):
requests.get(f'https://api.ncbi.nlm.nih.gov/variation/v0/refsnp/{rsid_int}') - Python (E-utilities, legacy):
Bio.Entrez.esearch(db='snp', term=rsid); returns thin summary - Bulk:
ftp.ncbi.nlm.nih.gov/snp/latest_release/JSON/refsnp-chr{N}.json.bz2
rsID Is a Cluster Identifier, Not a Variant Identifier
This is the load-bearing concept. dbSNP cluster definition: ss records (submitted SNPs) are mapped to the genome and clustered into RefSNPs by position + variant type, not by allele. A single rsID can point to a locus with multiple alleles:
rs12345may resolve to {A>G, A>T, A>C} at one position; the RefSNP JSONprimary_snapshot_data.placements_with_allele[*].allelesenumerates them.- ~6-8% of dbSNP rsIDs are multi-allelic (Phan 2025 NAR 25-year review).
- PLINK and many older tools historically misuse rsIDs as if they were variant identifiers, which fails for multi-allelic sites and yields wrong genotype assignments.
Rule: Use rsID as a human-facing label only; use SPDI or ClinGen Allele Registry CA ID for joins.
Build 156 Schema Overhaul: What Changed
| Aspect | Build 151 (2017) | Build 156 (2022) and current |
|---|---|---|
| Distribution | Relational SQL dumps + XML | JSON per RefSNP, partitioned by chromosome |
| FTP path | ftp/snp/organisms/human_9606/ |
ftp.ncbi.nlm.nih.gov/snp/latest_release/JSON/ |
| Primary key | snp_id, ss_id |
refsnp_id, with primary_snapshot_data block |
| Frequency data | Embedded sparse | ALFA aggregated populations |
| Merge tracking | RsMergeArch.bcp.gz |
refsnp-merged.json.bz2 (also RsMergeArch.bcp.gz retained for legacy) |
| Withdrawn | SNPHistory.bcp.gz |
refsnp-withdrawn.json.bz2 |
| API access | Legacy E-utilities db=snp only |
Variation Services REST /v0/refsnp/{id} returns the full JSON |
E-utilities still works for db=snp but returns a thin pre-156 summary missing key fields like primary_snapshot_data.placements_with_allele; pipelines reliant on Entrez get out-of-date data.
RsMergeArch: The Multi-Hop Merge Footgun
When two rsIDs are found to refer to the same allele cluster, the higher (later-assigned) rsID is merged into the lower. RsMergeArch.bcp.gz stores (rsHigh, rsLow, rsCurrent) tuples.
The trap: rsCurrent in any given row is the merge target at the time of that merge event, NOT the current dbSNP rsID. A multi-merge chain (rs3 -> rs2 -> rs1, then later rs1 -> rs0) appears as multiple rows. Naive one-hop lookup resolves to a stale ID.
Withdrawn rsIDs (submitter-withdrawn or QC-failed) live in SNPHistory.bcp.gz, not RsMergeArch. Both tables must be consulted to resolve any historical rsID.
SPDI: The Canonical Variant Representation
SPDI (Sequence:Position:Deletion:Insertion) format: NC_000017.11:43044294:G:A. Position is 0-based, half-open (differs from HGVS's 1-based, fully-closed).
The Contextual Allele transformation (Variant Overprecision Correction Algorithm) returns the right-aligned, normalized canonical form across left-aligned VCFs and right-aligned HGVS conventions. This is the basis for ClinGen Allele Registry CA ID computation.
| Representation | Build dependency | Transcript dependency | Bijective? | Best for |
|---|---|---|---|---|
| VCF (chrom-pos-ref-alt) | Yes | No | Yes (same build) | Pipelines, bulk |
| SPDI | Yes (via RefSeq accession) | No | Yes for SNV/small indel | Canonical normalization |
| HGVS-g | Yes (NC_xxxxx.N) |
No | Yes for SNV/small indel | Human-readable genomic |
| HGVS-c | Indirect (via transcript) | Yes | No (one HGVS-c -> many HGVS-g) | Clinical reporting |
| HGVS-p | Indirect | Yes | Degenerate (one HGV |
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- examples/dbsnp_lookup.py
- usage-guide.md
FAQ
Что делает скилл bio-clinical-databases-dbsnp-queries?
Resolves rsIDs, navigates RsMergeArch/SNPHistory merge chains, and converts between rsID, SPDI, HGVS, and VCF representations using the dbSNP Build 156 JSON architecture. Use when normalizing variant identifiers, joining variant databases by cluster ID, or tracking deprecated rsIDs through historical merges.
Как установить скилл bio-clinical-databases-dbsnp-queries?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл bio-clinical-databases-dbsnp-queries запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…