Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Query myvariant.info API for aggregated variant annotations from multiple databases (ClinVar, gnomAD, dbSNP, COSMIC, etc.) in a single request. Use when annotating variants with clinical and population data from multiple sources simultaneously.
.claude/skills/bio-clinical-databases-myvariant-queries/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | — | — |
| case-17 | ✗→✓ | ▲ Improved | — | — |
| case-05 | ✗→✓ | ▲ Improved | — | — |
| case-14 | ✗→✓ | ▲ Improved | — | — |
| case-12 | ✗→✓ | ▲ Improved | — | — |
Reference examples tested with: SnpEff 5.2+, pandas 2.2+
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.
"Annotate my variants from multiple databases at once" → Query the myvariant.info aggregation API to retrieve ClinVar, gnomAD, dbSNP, COSMIC, and other annotations in a single request per variant.
myvariant.MyVariantInfo().getvariants(ids, fields='clinvar,gnomad,dbnsfp')pythonimport myvariant
pythonmv = myvariant.MyVariantInfo()
Goal: Retrieve aggregated annotations for a single variant from multiple databases in one request.
Approach: Query myvariant.info by HGVS notation or rsID, which returns ClinVar, gnomAD, dbSNP, COSMIC, and CADD data.
python# Query by HGVS notation (recommended) result = mv.getvariant('chr7:g.140453136A>T') # Query by rsID result = mv.getvariant('rs121913527') # Query by gene and protein change result = mv.getvariant('BRAF:p.V600E')
Goal: Batch-query up to 1000 variants in a single API call with field selection for efficiency.
Approach: Pass a list of variant identifiers to getvariants() with specific field filters to minimize response size.
pythonvariants = [ 'chr7:g.140453136A>T', 'chr17:g.7577120C>T', 'rs121913527' ] # Batch query (up to 1000 variants per request) results = mv.getvariants(variants) # With specific fields results = mv.getvariants( variants, fields=['clinvar', 'gnomad_exome', 'dbsnp'] )
Goal: Search for variants by gene, clinical significance, or genomic region using query syntax.
Approach: Use Lucene-style query strings with mv.query() to filter by gene symbol, ClinVar fields, or coordinate ranges.
python# Search by gene results = mv.query('clinvar.gene.symbol:BRCA1', size=100) # Search pathogenic variants in gene results = mv.query( 'clinvar.gene.symbol:BRCA1 AND clinvar.clinical_significance:Pathogenic', size=100 ) # Search by genomic region results = mv.query('chr7:140400000-140500000')
Common field paths for annotations:
| Field | Description | |-------|-------------| | clinvar | ClinVar annotations | | gnomad_exome | gnomAD exome frequencies | | gnomad_genome | gnomAD genome frequencies | | dbsnp | dbSNP annotations | | cosmic | COSMIC cancer mutations | | cadd | CADD deleteriousness scores | | dbnsfp | dbNSFP functional predictions | | snpeff | SnpEff annotations |
Goal: Extract ClinVar classification, gnomAD frequency, and CADD score from a variant result.
Approach: Navigate the nested JSON response using dictionary access to reach specific annotation fields.
pythonresult = mv.getvariant('chr7:g.140453136A>T') # ClinVar classification clinvar_sig = result.get('clinvar', {}).get('clinical_significance') # gnomAD allele frequency gnomad_af = result.get('gnomad_exome', {}).get('af', {}).get('af') # CADD score cadd_phred = result.get('cadd', {}).get('phred')
Goal: Convert batch variant query results into a structured pandas DataFrame for downstream analysis.
Approach: Query multiple rsIDs with selected fields, extract key annotations per variant, and assemble into a DataFrame.
pythonimport pandas as pd variants = ['rs121913527', 'rs1800566', 'rs104894155'] results = mv.getvariants(variants, fields=['clinvar', 'gnomad_exome']) records = [] for r in results: records.append({ 'query': r.get('query'), 'clinvar_sig': r.get('clinvar', {}).get('clinical_significance'), 'gnomad_af': r.get('gnomad_exome', {}).get('af', {}).get('af') }) df = pd.DataFrame(records)
Goal: Handle large variant sets exceeding the 1000-variant-per-request API limit.
Approach: Split variants into chunks and query sequentially, relying on myvariant's built-in rate limiting.
python# myvariant handles rate limiting automatically # For large batches, use chunks def batch_query(variants, chunk_size=1000): all_results = [] for i in range(0, len(variants), chunk_size): chunk = variants[i:i + chunk_size] results = mv.getvariants(chunk) all_results.extend(results) return all_results
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-03 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-10 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-14 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-08 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-18 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-01 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
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 +45 percentage points is the difference between those two pass rates over the 22 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
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.