google-deepmind/science-skills3 files

Clinvar Database

>

Specification
Skill ID
google-deepmind/science-skills/clinvar-database
Publisher
google-deepmind
Repository
science-skills
Installs
0
Files
3
Synced
Sep 23, 2026
How to use it

Open any RiverX project, open the Skills panel in the chat, and search for this identifier. The files are fetched from the source repository at install time.

google-deepmind/science-skills/clinvar-databaseInstalls these files
  • SKILL.md
  • references/citation.bib
  • scripts/clinvar_api.py

What this skill tells the agent

ClinVar Database

Prerequisites

  1. `uv`: Read the uv skill and follow its Setup instructions to ensure uv is installed and on PATH.
  2. User Notification: If .licenses/clinvar_database_LICENSE.txt does not already exist in the workspace root directory then (1) prominently notify the user to check the terms at https://www.ncbi.nlm.nih.gov/clinvar/, then (2) create the file recording the notification text and timestamp.
  3. `.env` file: Make sure the .env file exists in your home directory. Create one if it does not exist.
  4. `NCBI_API_KEY` (optional): Raises the NCBI rate limit from 3 to 10 requests/second. The skill works without it, but a key is recommended if the user plans many queries or encounters a 429 error. You can register for a key for free at https://www.ncbi.nlm.nih.gov/account/settings/. You MUST use the safe credentials protocol in the credentials skill to check for and request this key if this skill looks relevant to the user's request.

Overview

ClinVar is the primary consensus record for clinical classifications of human genomic variations. It provides the "clinical ground truth" for pathogenicity labels (Pathogenic, Likely Pathogenic, Benign, VUS) based on assertions from global laboratories.

When to Use

Use when you need to:

  • Find the current clinical significance and star rating (review status) for a specific variant.
  • Fetch clinician notes, assertion criteria, or rationales for previous clinical laboratory classifications.
  • Retrieve the preferred condition name and associated HPO terms for a specific variant.
  • Find a list of variant controls (e.g., "Find all Pathogenic variants in the HBB gene within 50bp of a signal").
  • Check for conflicting interpretations for a given variant and identify the organizations submitting each classification.

Do NOT use when you need to:

  • Find specific allele frequencies in global populations (use gnomAD).
  • Describe the normal biological role of a protein and typical inheritance patterns (use OMIM).
  • Predict mechanistic effects of novel mutations, like frameshifts or exon skipping (use AlphaGenome).
  • Find recommended surveillance schedules for patients with a pathogenic variant (use GeneReviews).
  • Generate or view 3D structural models of affected proteins (use PDB / AlphaFold).

Quick Start

ClinVar queries are executed via a robust Python wrapper script to handle strict rate limiting and XML/JSON parsing.

Example: Search for BRCA1 variants

uv run scripts/clinvar_api.py search --query "BRCA1[gene]" --output results.json

Core Rules

  • Retmax Constraint: The search command defaults to --retmax 200. For any "List all" or gene-wide request, you MUST explicitly set --retmax higher (e.g., 1000) to ensure data completeness.
  • Use the Wrapper: Prefer the wrapper script for standard queries. It handles rate limiting, retries, and the complex XML parsing for you. If the script's parsed output does not contain the specific fields you need, you may modify the script or query the NCBI E-utilities API directly — but be aware that the raw XML schemas are complex and vary between record types.
  • If the rate limit is hit, the script will throw a clear error. You MUST use the safe credentials protocol in the credentials skill to check for and request the NCBI_API_KEY to help the user add it to their .env file.
  • Notification: If this skill is used, ensure this is mentioned in the output.

Utility Scripts

1. count — Count Matching Variants

Purpose: Check how many variants match a query without fetching IDs. Use to decide whether a full search is warranted.

Arguments:

  • --query: (Required) NCBI Entrez search query string.
  • --output: (Required) Output JSON file path.

Example: uv run scripts/clinvar_api.py count \ --query "TP53[gene] AND \"uncertain significance\"[clinsig]" \ --output count.json Output: {"total_count": <int>}

2. search — Search Variants

Purpose: Identify variants based on genomic location, gene symbols, or clinical attributes using NCBI Entrez search syntax. The search command automatically paginates through all matching results to ensure complete, deterministic retrieval.

# Fetch ALL matching variants (default behavior)
uv run scripts/clinvar_api.py search \
  --query "BRCA1[gene]" --output results.json

# Search by Chromosome and Position Range
uv run scripts/clinvar_api.py search \
  --query "11[chr] AND 5225000:5226000[chrpos]" --output results.json

# Combine terms using Entrez syntax
uv run scripts/clinvar_api.py search \
  --query "HBB[gene] AND pathogenic[clinsig]" --output results.json

# Cap results at 50
uv run scripts/clinvar_api.py search \
  --query "TP53[gene]" --retmax 50 --output results.json

Arguments:

  • --query: (Required) NCBI Entrez search query string.
  • --retmax: Maximum total number of variant IDs to return. Default is 0, which means "fetch all matching results." Set to a positive integer to cap the result set.
  • --page_size: Number of IDs to fetch per API request (default: 500, max: 10000 per NCBI limits).
  • --output: (Required) Output JSON file path.

Output: A JSON object containing:

  • total_count — Total number of matching variants in ClinVar.
  • fetched_count — Number of IDs actually retrieved.
  • variant_ids — List of ClinVar Variation ID strings.

3. summary — Get Interpretation Summary

Purpose: Retrieve top-line clinical significance labels, star ratings (review status), and basic phenotype data for rapid variant screening.

# Get summary for one or more Variation IDs
uv run scripts/clinvar_api.py summary \
  --variant_ids 12345 67890 --output summary.json

Arguments:

  • --variant_ids: (Required) One or more ClinVar Variation IDs.
  • --output: (Required) Output JSON file path.

Output: A JSON list of summary objects, each containing:

  • variant_id, title, clinical_significance, review_status, \ last_evaluated, phenotypes
  • genes — list of {gene_id, symbol, strand}
  • variation_type — e.g., single nucleotide variant, Deletion, Insertion
  • molecular_consequences — list of strings (e.g., ["missense variant", \ "nonsense"])

4. evidence — Get Clinical Evidence

Purpose: Fetch the full clinical record for a single variant, including free-text clinician rationales, assertion methods, and specific submitter notes.

# Get full evidence for a single Variation ID
uv run scripts/clinvar_api.py evidence \
  --variant_id 12345 --output evidence.json

Arguments:

  • --variant_id: (Required) A single ClinVar Variation ID.
  • --output: (Required) Output JSON file path.

Output: A JSON object containing:

  • variant_id
  • allele_info — {chromosome, position_start, position_stop, reference_allele, alternate_allele, cytogenetic_band, dbsnp_rsid} (GRCh38 preferred)
  • conditions — list of {name, medgen_cui, omim_id, orphanet_id, hpo_terms}
  • functional_consequences — list of {value, sequence_ontology_id}
  • structural_variant_details — {outer_start, inner_start, inner_stop, outer_stop, copy_number} (present only for CNVs, otherwise null)
  • citation_references — list of PubMed IDs cited in the global "Citations" section
  • submissions — list of per-submitter records, each containing:
  • submitter_name, classification, curator_notes, assertion_criteria
  • date_last_evaluated — when the submitter last reviewed the classification

Typical Workflows

Count-First Workflow (Recommended)

For large or unknown result sets, use count first to decide whether to

Use this skill in a project

Open any RiverX project, search the Skills panel for google-deepmind/science-skills/clinvar-database, and install it in one click.

Use this skill