Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Query dbSNP for rsID lookups, variant annotations, and cross-references to other databases. Use when mapping between rsIDs and genomic coordinates or retrieving basic variant information.
.claude/skills/bio-clinical-databases-dbsnp-queries/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-06 | ✗→✓ | ▲ Improved | — | — |
| case-10 | ✗→✓ | ▲ Improved | — | — |
| case-01 | ✗→✓ | ▲ Improved | — | — |
| case-13 | ✗→✓ | ▲ Improved | — | — |
| case-02 | ✗→✓ | ▲ Improved | — | — |
Reference examples tested with: BioPython 1.83+, Entrez Direct 21.0+
Before using code patterns, verify installed versions match. If versions differ:
pip show <package> then help(module.function) to check signaturesIf code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
"Look up variant information by rsID" → Retrieve variant annotations, genomic coordinates, and cross-references to ClinVar/gnomAD from dbSNP using REST API queries.
myvariant.MyVariantInfo().getvariant('rs12345')Goal: Retrieve variant information including dbSNP, ClinVar, and gnomAD annotations by rsID.
Approach: Query myvariant.info with the rsID and request specific annotation fields.
pythonimport myvariant mv = myvariant.MyVariantInfo() def get_rsid_info(rsid): '''Get variant info by rsID''' result = mv.getvariant(rsid, fields=['dbsnp', 'clinvar', 'gnomad_exome']) return result result = get_rsid_info('rs121913527')
Goal: Search and fetch dbSNP records directly from NCBI using Entrez E-utilities.
Approach: Use BioPython Entrez esearch to find SNP IDs, then efetch to retrieve full XML records.
pythonfrom Bio import Entrez import xml.etree.ElementTree as ET Entrez.email = 'your@email.com' def search_dbsnp(rsid): '''Search dbSNP by rsID''' handle = Entrez.esearch(db='snp', term=rsid) record = Entrez.read(handle) handle.close() return record def fetch_dbsnp(snp_id): '''Fetch dbSNP record by internal ID''' handle = Entrez.efetch(db='snp', id=snp_id, rettype='xml') xml_data = handle.read() handle.close() return xml_data
Goal: Find the rsID corresponding to a genomic position and allele change.
Approach: Construct an HGVS notation from coordinates and query myvariant.info for the dbSNP rsID field.
pythondef coords_to_rsid(chrom, pos, ref, alt): '''Find rsID for genomic coordinates''' mv = myvariant.MyVariantInfo() # Query by HGVS notation hgvs = f'chr{chrom}:g.{pos}{ref}>{alt}' result = mv.getvariant(hgvs, fields=['dbsnp.rsid']) if result: return result.get('dbsnp', {}).get('rsid') return None
pythondef rsid_to_coords(rsid): '''Get genomic coordinates for rsID''' mv = myvariant.MyVariantInfo() result = mv.getvariant(rsid, fields=['dbsnp', 'vcf']) if not result: return None dbsnp = result.get('dbsnp', {}) return { 'chrom': dbsnp.get('chrom'), 'pos': dbsnp.get('hg38', {}).get('start'), 'ref': dbsnp.get('ref'), 'alt': dbsnp.get('alt') }
pythondef batch_rsid_lookup(rsids, fields=None): '''Look up multiple rsIDs''' mv = myvariant.MyVariantInfo() if fields is None: fields = ['dbsnp', 'clinvar.clinical_significance', 'gnomad_exome.af.af'] results = mv.getvariants(rsids, fields=fields) return results
pythondef parse_dbsnp(result): '''Extract key dbSNP annotations''' dbsnp = result.get('dbsnp', {}) return { 'rsid': dbsnp.get('rsid'), 'chrom': dbsnp.get('chrom'), 'pos_hg38': dbsnp.get('hg38', {}).get('start'), 'pos_hg19': dbsnp.get('hg19', {}).get('start'), 'ref': dbsnp.get('ref'), 'alt': dbsnp.get('alt'), 'gene': dbsnp.get('gene', {}).get('symbol'), 'class': dbsnp.get('class'), # snv, ins, del, etc. 'validated': dbsnp.get('validated') }
| Class | Description | |-------|-------------| | snv | Single nucleotide variant | | ins | Insertion | | del | Deletion | | indel | Insertion/deletion | | mnv | Multiple nucleotide variant |
pythonimport requests def query_spdi(rsid): '''Query NCBI Variation Services for SPDI notation''' url = f'https://api.ncbi.nlm.nih.gov/variation/v0/refsnp/{rsid[2:]}' response = requests.get(url) if response.ok: return response.json() return None
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-19 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-10 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-01 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-14 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-18 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-08 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-03 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +27 percentage points is the difference between those two pass rates over the 22 comparable cases.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
Other measured skills in the registry, with their headline benchmark lift.