lilinji/genetind-life-skills/bio-clinical-databases-clinvar-lookup

Claude Code and agent skill by lilinji/genetind-life-skills

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Queries ClinVar for variant pathogenicity classifications, ClinGen VCEP curations, and somatic-vs-germline interpretations via REST API, weekly VCF, or bulk XML. Use when determining clinical significance, triangulating conflicting interpretations, or aggregating evidence against the ACMG/AMP framework with ClinGen SVI specifications.

Install

npx vskill@latest install lilinji/genetind-life-skills/bio-clinical-databases-clinvar-lookup

SKILL.md

The same SKILL.md was published earlier as lilinji/genetind-life-skills/bio-clinical-databases-clinvar-lookup.

Version Compatibility

Reference examples tested with: requests 2.31+, cyvcf2 0.30+, pandas 2.2+, bcftools 1.19+, Entrez Direct 21.0+, lxml 5.0+ (for v2 XML schema).

Before using code patterns, verify installed versions match. If versions differ:

  • Python: pip show <package> then help(module.function) to check signatures
  • CLI: <tool> --version then <tool> --help to 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. ClinVar XML schema v2 (rolled out in 2024) replaces <ClinVarSet> with <VariationArchive> as the top-level anchor; XSLT or parsers targeting the legacy element silently emit zero records.

ClinVar Lookup and Clinical-Significance Triangulation

'Look up the clinical significance of this variant' -> Retrieve ClinVar VCV-level aggregate, SCV-level submissions, ClinGen Variant Curation Expert Panel (VCEP) overrides, and conflict-resolution status.

  • Python (REST): requests.get() against the E-utilities clinvar database
  • Python (local VCF): cyvcf2.VCF('clinvar.vcf.gz') for batch queries against the weekly snapshot
  • CLI: bcftools annotate -a clinvar.vcf.gz -c INFO/CLNSIG,INFO/CLNREVSTAT,INFO/CLNDN
  • Cross-database: ClinGen Allele Registry CA ID via https://reg.clinicalgenome.org/

The Identifier Hierarchy (VCV / SCV / RCV): Get This Wrong and Everything Downstream Breaks

LevelFormatWhat it aggregatesWhen to useFails when
SCVSCVxxxxxxxxx.NOne submitter, one variant, one condition (atomic submission unit)Auditing who said what; conflict triangulationAggregated reporting (use VCV); cross-condition analysis
RCVRCVxxxxxxxxx.NAll SCVs for a single (variant, condition) pairCondition-stratified analysis; legacy aggregationVariant-level reporting across all conditions (use VCV)
VCVVCVxxxxxxxxx.NAll RCVs for one variant across all conditionsCanonical anchor since 2017; default API entrypointCondition-specific clinical action (use RCV); CLNSIG collapses multi-condition

Operational footgun: the clinvar.vcf.gz CLNSIG field is the variant-level (VCV) aggregate. A variant Pathogenic for disease A but VUS for disease B collapses to "Pathogenic/Conflicting". For condition-stratified analysis, parse RCV-level XML, never CLNSIG alone.

2024 XML schema overhaul: ClinVar v2 XML separates GermlineClassification, SomaticClinicalImpact, and OncogenicityClassification under one <VariationArchive> anchor. The legacy <ClinicalSignificance> element is gone. Pipelines built before September 2024 against <ClinVarSet> silently emit zero records on new XML. The dual-release period ended December 2024.

Star Ratings and the Override Hierarchy

StarsReview statusWhat it means operationally
4Practice guidelineACMG/CAP CFTR-level (vanishingly rare)
3Expert panel reviewed (ClinGen VCEP)FDA-recognized tier; overrides lower-star records for clinical action
2Multiple submitters, criteria provided, no conflictsReliable aggregate
1Single submitter OR conflicting interpretations (often mis-reported as 2-star)Use with scrutiny
0No assertion criteria providedLiterature-only or legacy submissions

ClinVar does NOT retract or hide lower-star records when a VCEP publishes; a variant can simultaneously display "Pathogenic (3-star VCEP)" and "Conflicting interpretations (1-star)". Tools handle this differently (VarSeq, Franklin, GenoOx each pick a winner via different rules); this is a major source of inter-tool disagreement.

ClinGen Variant Curation Expert Panels (VCEPs)

As of 2025, ~80-90 VCEPs are approved or in progress across RASopathies, hereditary cancer (ENIGMA BRCA1/2, InSiGHT MMR), cardiomyopathy (sarcomere genes), hearing loss, RPE65/IRD, inborn errors of metabolism, and FH. The current count is moving; the authoritative directory is the Criteria Specification Registry at https://cspec.genome.network/cspec/ui/svi/all.

Each VCEP publishes a gene-disease-specific CSpec that re-weights ACMG/AMP criteria. The Hearing Loss VCEP downgrades PM2 to supporting by default and upgrades PS3 thresholds for OTOF. Treating "ACMG/AMP" as a single rubric across all genes is the most common error in non-specialist tooling.

ACMG/AMP, ClinGen SVI Specifications, and the Bayesian Point System

The Richards 2015 28-criterion framework is the foundation, but every modern automated classifier (InterVar, GeneBe, Franklin, VarSome) implements the Tavtigian 2018/2020 Bayesian point system, not the original combining rules. Strengths map to points: Supporting=1, Moderate=2, Strong=4, Very Strong=8 (benign codes negative). Final categories: P >=10, LP 6-9, VUS 0-5, LB -1 to -6, B <=-7.

For variant interpretation framework details, calibrated in-silico thresholds, and PVS1 decision-tree logic, defer to clinical-databases/acmg-classification. This skill focuses on querying ClinVar; it intentionally does not re-implement classification.

Conflicting Interpretations and Conflict Resolution

Harrison 2017 Genet Med 19:1096 (PMID 28301460) showed 87% of inter-lab conflicts were resolvable by reassessment plus data sharing. As of 2024, only 3.8% of conflicting BRCA1 missense VUS reached consensus despite years of effort; conflict resolution is slow even in best-curated genes.

Submission staleness is non-trivial: ClinVar does not push reclassifications to submitters; a 2017 SCV can persist on an active label in 2026 if the lab has not re-submitted. Genome Alert! (Yauy 2022 Genet Med) was built specifically to detect classification drift between weekly releases. The median delta is ~1,247 classification changes per month with potential clinical impact.

Decision Tree by Query Scenario

ScenarioRecommended pathWhy
Single variant, known gene/conditionE-utilities esummary against clinvar DBLowest latency, returns VCV-level summary
Batch (10-1000 variants) by HGVS or rsIDmyvariant.info with fields=clinvarAggregated, includes ClinVar review status
Batch (>1000) or coordinate-basedLocal clinvar.vcf.gz with bcftools annotate or cyvcf2No rate limits; weekly snapshot
Condition-stratified (variant in disease A vs B)Bulk XML VariationArchive parsingRCV is the only level that preserves per-condition classification
Cross-database join with gnomAD / dbSNP / COSMICClinGen Allele Registry CA IDBuild-agnostic, transcript-agnostic canonical identifier
Reproducible analysis with citable dateFirst-Thursday-of-month archive on FTPOnly monthly snapshots are archived; weekly releases disappear

REST API Query (E-utilities)

Goal: Retrieve VCV-level ClinVar summary for a single variant by ID, gene, or HGVS.

Approach: Hit esummary.fcgi or esearch.fcgi against db=clinvar, parse JSON, then optionally hydrate to full record with efetch.

python
import requests
EUTILS = 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils'
def clinvar_summary(variation_id):
'''Retrieve VCV-level summary by ClinVar VariationID (do not confuse with CA ID).
The germline / somatic / oncogenicity classification nesting shown below
follows the ClinVar 2024 eSummary v2 schema described in the data-access
documentation. Field names have changed between API versions -- inspect
the actual JSON returned by eSummary for the live ClinVar version before
pinning these key paths in production.
'''
r = requests.get(f'{EUTILS}/esummary.fcgi',
params={'db': 'clinvar', 'id': variation_id, 'retmode': 'json'},
timeout=30)
r.raise_for_status()
record = r.json()['result'][str(variation_id)]
return {
'vcv': record.get('accession'),
'name': record.get('title'),
'germline_class': record.get('germline_classification', {}).get('description'),
'germline_review_status': record.get('germline_classification', {}).get('review_status'),
'somatic_clinical': record.get('clinical_impact_classification', {}).get('description'),
'oncogenicity': record.get('oncogenicity_classification', {}).get('description'),
'last_evaluated': record.get('germline_classification', {}).get('last_evaluated')
}
def clinvar_search_gene(gene, pathogenic_only=False, retmax=500):
term = f'{gene}[gene]'
if pathogenic_only:
term += ' AND (clinsig_pathogenic[Properties] OR clinsig_likely_pathogenic[Properties])'
r = requests.get(f'{EUTILS}/esearch.fcgi',
params={'db': 'clinvar', 'term': term, 'retmax': retmax, 'retmode': 'json'},
timeout=30)
return r.json()['esearchresult']['idlist']

Local VCF Query (Weekly Snapshot)

Goal: Annotate or look up thousands of variants without rate limits.

Approach: Download the weekly clinvar.vcf.gz (note: only first-Thursday-of-month is archived; for longitudinal stability pin to monthly archives), query by genomic coordinates with cyvcf2 or annotate VCFs with bcftools.

bash
mkdir -p clinvar/$(date +%Y%m); cd clinvar/$(date +%Y%m)
wget https://ftp.ncbi.nlm.nih.gov/pub/clinvar/vcf_GRCh38/clinvar.vcf.gz
wget https://ftp.ncbi.nlm.nih.gov/pub/clinvar/vcf_GRCh38/clinvar.vcf.gz.tbi
python
from cyvcf2 import VCF
clinvar = VCF('clinvar.vcf.gz')
def lookup(chrom, pos, ref, alt):
'''Look up by GRCh38 coords. Returns variant-level (VCV) aggregate; not RCV.'''
for v in clinvar(f'{chrom}:{pos}-{pos}'):
if v.REF == ref and alt in v.ALT:
info = v.INFO
return {
'vcv_id': info.get('ALLELEID'),
'clnsig': info.get('CLNSIG'),
'clnsig_conf': info.get('CLNSIGCONF'),
'clnrevstat': info.get('CLNREVSTAT'),
'clndn': info.get('CLNDN'),
'clnvc': info.get('CLNVC'),
'clnhgvs': info.get('CLNHGVS'),
'clndisdb': info.get('CLNDISDB'),
'oncdn': info.get('ONCDN'),
'scidn': info.get('SCIDN')
}
return None
bash
bcftools annotate \
-a clinvar.vcf.gz \
-c INFO/CLNSIG,INFO/CLNREVSTAT,INFO/CLNDN,INFO/CLNVC,INFO/CLNHGVS,INFO/CLNSIGCONF \
input.vcf.gz -O z -o annotated.vcf.gz
bcftools index -t annotated.vcf.gz

ClinGen Allele Registry (CA IDs): The Real Cross-Database Anchor

ClinGen Allele Registry (https://reg.clinicalgenome.org/) computes a build-agnostic, transcript-agnostic CA ID (format CA######) for any allele projectable onto NCBI references (GRCh37, GRCh38, T2T-CHM13, any RefSeq transcript). The Registry covers ~700M+ alleles, vastly more than ClinVar. CA ID and ClinVar VariationID are one-to-one when a variant exists in ClinVar.

python
def car_id(hgvs_g):
'''Resolve HGVS-g to canonical ClinGen Allele Registry CA ID.'''
r = requests.put(f'https://reg.clinicalgenome.org/allele',
headers={'Content-Type': 'text/plain'},
data=hgvs_g, timeout=30)
return r.json().get('@id', '').split('/')[-1] if r.ok else None

Use CA ID for any join touching non-ClinVar resources (gnomAD, dbSNP, COSMIC, MAVEdb). VariationID was renumbered during the 2017 ClinVar schema redesign; treating it as a stable cross-build identifier is unsafe.

Per-Operation Failure Modes

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
8
Repository forks
2
7-day trend score
11

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 25 Aug 2026, 3 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Grok Build (Cursor)
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/lilinji/genetind-life-skills/bio-clinical-databases-clinvar-lookup/badge)](https://verified-skill.com/skills/lilinji/genetind-life-skills/bio-clinical-databases-clinvar-lookup)

Something wrong with this skill or its page? Tell us.