bio-clinical-databases-dbsnp-queries
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.
Best use case
bio-clinical-databases-dbsnp-queries is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
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.
Teams using bio-clinical-databases-dbsnp-queries should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/bio-clinical-databases-dbsnp-queries/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How bio-clinical-databases-dbsnp-queries Compares
| Feature / Agent | bio-clinical-databases-dbsnp-queries | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
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.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
## Version Compatibility
Reference examples tested with: BioPython 1.83+, Entrez Direct 21.0+
Before using code patterns, verify installed versions match. If versions differ:
- Python: `pip show <package>` then `help(module.function)` to check signatures
If code throws ImportError, AttributeError, or TypeError, introspect the installed
package and adapt the example to match the actual API rather than retrying.
# dbSNP Queries
**"Look up variant information by rsID"** → Retrieve variant annotations, genomic coordinates, and cross-references to ClinVar/gnomAD from dbSNP using REST API queries.
- Python: `myvariant.MyVariantInfo().getvariant('rs12345')`
## Query rsID via myvariant.info
**Goal:** Retrieve variant information including dbSNP, ClinVar, and gnomAD annotations by rsID.
**Approach:** Query myvariant.info with the rsID and request specific annotation fields.
```python
import 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')
```
## Query via NCBI Entrez
**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.
```python
from 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
```
## Map Coordinates to rsID
**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.
```python
def 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
```
## Map rsID to Coordinates
```python
def 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')
}
```
## Batch rsID Lookup
```python
def 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
```
## Parse dbSNP Annotations
```python
def 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')
}
```
## Variant Classes in dbSNP
| Class | Description |
|-------|-------------|
| snv | Single nucleotide variant |
| ins | Insertion |
| del | Deletion |
| indel | Insertion/deletion |
| mnv | Multiple nucleotide variant |
## Query NCBI Variation Services API
```python
import 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
```
## Related Skills
- myvariant-queries - Aggregated variant queries
- clinvar-lookup - ClinVar pathogenicity
- database-access/entrez-search - General Entrez queriesRelated Skills
tooluniverse-clinical-trial-matching
AI-driven patient-to-trial matching for precision medicine and oncology. Given a patient profile (disease, molecular alterations, stage, prior treatments), discovers and ranks clinical trials from ClinicalTrials.gov using multi-dimensional matching across molecular eligibility, clinical criteria, drug-biomarker alignment, evidence strength, and geographic feasibility. Produces a quantitative Trial Match Score (0-100) per trial with tiered recommendations and a comprehensive markdown report. Use when oncologists, molecular tumor boards, or patients ask about clinical trial options for specific cancer types, biomarker profiles, or post-progression scenarios.
tooluniverse-clinical-trial-design
Strategic clinical trial design feasibility assessment using ToolUniverse. Evaluates patient population sizing, biomarker prevalence, endpoint selection, comparator analysis, safety monitoring, and regulatory pathways. Creates comprehensive feasibility reports with evidence grading, enrollment projections, and trial design recommendations. Use when planning Phase 1/2 trials, assessing trial feasibility, or designing biomarker-driven studies.
tooluniverse-clinical-guidelines
Search and retrieve clinical practice guidelines across 12+ authoritative sources including NICE, WHO, ADA, AHA/ACC, NCCN, SIGN, CPIC, CMA, CTFPHC, GIN, MAGICapp, PubMed, EuropePMC, TRIP, and OpenAlex. Covers disease management, cardiology, oncology, diabetes, pharmacogenomics, and more. Use when users ask about clinical guidelines, treatment recommendations, standard of care, evidence-based medicine, or drug-gene dosing recommendations.
clinicaltrials-database
Query ClinicalTrials.gov via API v2. Search trials by condition, drug, location, status, or phase. Retrieve trial details by NCT ID, export data, for clinical research and patient matching.
clinical-trials-search
Search ClinicalTrials.gov with natural language queries. Find clinical trials, enrollment, and outcomes using Valyu semantic search.
clinical-trial-protocol-skill
Generate clinical trial protocols for medical devices or drugs. This skill should be used when users say "Create a clinical trial protocol", "Generate protocol for [device/drug]", "Help me design a clinical study", "Research similar trials for [intervention]", or when developing FDA submission documentation for investigational products.
clinical-reports
Write comprehensive clinical reports including case reports (CARE guidelines), diagnostic reports (radiology/pathology/lab), clinical trial reports (ICH-E3, SAE, CSR), and patient documentation (SOAP, H&P, discharge summaries). Full support with templates, regulatory compliance (HIPAA, FDA, ICH-GCP), and validation tools.
clinical-diagnostic-reasoning
Identify and counteract cognitive biases in medical decision-making through systematic error analysis and contextual algorithm application. For diagnostic reasoning, treatment decisions, and clinical judgment improvement. NOT for basic medical knowledge, technical procedures, or non-clinical healthcare domains.
clinical-decision-support
Generate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
bio-variant-calling-clinical-interpretation
Clinical variant interpretation using ClinVar, ACMG guidelines, and pathogenicity predictors. Prioritize variants for diagnostic and research applications. Use when interpreting clinical significance of variants.
bio-clinical-databases-variant-prioritization
Filter and prioritize variants by pathogenicity, population frequency, and clinical evidence for rare disease analysis. Use when identifying candidate disease-causing variants from exome or genome sequencing.
bio-clinical-databases-tumor-mutational-burden
Calculate tumor mutational burden from panel or WES data with proper normalization and clinical thresholds. Use when assessing immunotherapy eligibility or characterizing tumor immunogenicity.