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.

1,802 stars

Best use case

bio-clinical-databases-variant-prioritization is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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.

Teams using bio-clinical-databases-variant-prioritization 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

$curl -o ~/.claude/skills/bio-clinical-databases-variant-prioritization/SKILL.md --create-dirs "https://raw.githubusercontent.com/FreedomIntelligence/OpenClaw-Medical-Skills/main/skills/bio-clinical-databases-variant-prioritization/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/bio-clinical-databases-variant-prioritization/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How bio-clinical-databases-variant-prioritization Compares

Feature / Agentbio-clinical-databases-variant-prioritizationStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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.

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: pandas 2.2+

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.

# Variant Prioritization

**"Prioritize candidate disease variants from my exome data"** → Filter and rank variants by pathogenicity scores, population frequency, inheritance pattern, and clinical evidence to identify candidate disease-causing mutations.
- Python: `pandas` for multi-criteria filtering with ACMG/AMP classification logic

## Basic Filtering Pipeline

**Goal:** Filter variants to retain rare, potentially pathogenic candidates for rare disease analysis.

**Approach:** Apply gnomAD population frequency and ClinVar significance filters, retaining pathogenic, VUS, and unannotated variants.

```python
import pandas as pd

def prioritize_variants(df, gnomad_af_col='gnomad_af', clinvar_col='clinvar_sig'):
    '''Basic variant prioritization pipeline

    Filters:
    1. Rare in population (gnomAD AF < 0.01)
    2. Pathogenic/likely pathogenic in ClinVar OR VUS with low AF
    '''
    # Filter rare variants (ACMG PM2: AF < 1%)
    rare = df[df[gnomad_af_col].isna() | (df[gnomad_af_col] < 0.01)]

    # Prioritize by ClinVar
    pathogenic_terms = ['Pathogenic', 'Likely_pathogenic', 'Pathogenic/Likely_pathogenic']
    prioritized = rare[
        rare[clinvar_col].isin(pathogenic_terms) |
        rare[clinvar_col].isna() |  # No ClinVar = needs review
        (rare[clinvar_col] == 'Uncertain_significance')
    ]

    return prioritized
```

## ACMG-Style Filtering

**Goal:** Score variants using ACMG-style evidence criteria for pathogenicity assessment.

**Approach:** Evaluate PM2 (population rarity) and PVS1 (loss-of-function) evidence, then compute a weighted priority score.

```python
def acmg_filter(df):
    '''Apply ACMG-style filtering criteria

    Strong pathogenic evidence:
    - PVS1: Null variant in gene where LOF is disease mechanism
    - PS1: Same amino acid change as established pathogenic
    - PS3: Functional studies support damaging effect

    Moderate evidence:
    - PM1: Located in mutational hot spot
    - PM2: Absent/rare in population databases (AF < 0.01)
    - PM5: Novel missense at position of known pathogenic
    '''
    # PM2: Rare in gnomAD
    df['pm2'] = df['gnomad_af'].isna() | (df['gnomad_af'] < 0.01)

    # PVS1: Loss of function variants
    lof_consequences = ['frameshift', 'stop_gained', 'splice_donor', 'splice_acceptor']
    df['pvs1'] = df['consequence'].isin(lof_consequences)

    # Score based on evidence
    df['priority_score'] = df['pm2'].astype(int) + df['pvs1'].astype(int) * 2

    return df.sort_values('priority_score', ascending=False)
```

## Multi-Database Prioritization

**Goal:** Prioritize variants using aggregated evidence from ClinVar, gnomAD, CADD, and REVEL in a single query.

**Approach:** Fetch annotations via myvariant.info, then compute a composite priority score weighting clinical, population, and computational evidence.

```python
import myvariant

def annotate_and_prioritize(variants):
    '''Annotate variants and apply prioritization'''
    mv = myvariant.MyVariantInfo()

    # Fetch annotations
    results = mv.getvariants(
        variants,
        fields=[
            'clinvar.clinical_significance',
            'clinvar.review_status',
            'gnomad_exome.af.af',
            'cadd.phred',
            'dbnsfp.revel.score'
        ]
    )

    records = []
    for r in results:
        clinvar = r.get('clinvar', {})
        gnomad = r.get('gnomad_exome', {})
        cadd = r.get('cadd', {})
        revel = r.get('dbnsfp', {}).get('revel', {})

        records.append({
            'variant': r.get('query'),
            'clinvar_sig': clinvar.get('clinical_significance'),
            'clinvar_stars': clinvar.get('review_status'),
            'gnomad_af': gnomad.get('af', {}).get('af'),
            'cadd_phred': cadd.get('phred'),
            'revel_score': revel.get('score') if isinstance(revel, dict) else None
        })

    df = pd.DataFrame(records)
    return prioritize_with_scores(df)

def prioritize_with_scores(df):
    '''Apply multi-evidence prioritization'''
    # Computational predictions
    # CADD phred > 20 suggests deleteriousness
    # REVEL > 0.5 suggests pathogenicity
    df['cadd_deleterious'] = df['cadd_phred'].fillna(0) > 20
    df['revel_pathogenic'] = df['revel_score'].fillna(0) > 0.5

    # Rare in population
    df['is_rare'] = df['gnomad_af'].isna() | (df['gnomad_af'] < 0.01)

    # ClinVar pathogenic
    pathogenic = ['Pathogenic', 'Likely_pathogenic']
    df['clinvar_pathogenic'] = df['clinvar_sig'].apply(
        lambda x: any(p in str(x) for p in pathogenic) if pd.notna(x) else False
    )

    # Priority score
    df['priority'] = (
        df['clinvar_pathogenic'].astype(int) * 10 +
        df['is_rare'].astype(int) * 3 +
        df['cadd_deleterious'].astype(int) * 2 +
        df['revel_pathogenic'].astype(int) * 2
    )

    return df.sort_values('priority', ascending=False)
```

## Inheritance-Based Filtering

**Goal:** Filter variants by expected inheritance pattern (autosomal dominant, recessive, or X-linked).

**Approach:** Select heterozygous ultra-rare variants for AD, or homozygous plus compound heterozygous candidates for AR.

```python
def filter_by_inheritance(df, inheritance='AD'):
    '''Filter variants by inheritance pattern

    AD: Autosomal dominant - heterozygous variants
    AR: Autosomal recessive - homozygous or compound het
    XL: X-linked
    '''
    if inheritance == 'AD':
        # Dominant: heterozygous, rare
        return df[(df['zygosity'] == 'HET') & (df['gnomad_af'] < 0.0001)]

    elif inheritance == 'AR':
        # Recessive: homozygous or two variants in same gene
        hom = df[df['zygosity'] == 'HOM']

        # Find genes with 2+ het variants (compound het candidates)
        het = df[df['zygosity'] == 'HET']
        compound_genes = het['gene'].value_counts()
        compound_genes = compound_genes[compound_genes >= 2].index
        compound_het = het[het['gene'].isin(compound_genes)]

        return pd.concat([hom, compound_het])

    return df
```

## Output Priority Tiers

**Goal:** Assign clinical interpretation tiers (1-4) for structured reporting of prioritized variants.

**Approach:** Combine ClinVar pathogenicity, population rarity, and computational predictions to classify into strong, potential, uncertain, or benign tiers.

```python
def assign_tiers(df):
    '''Assign clinical interpretation tiers

    Tier 1: Strong pathogenic evidence
    Tier 2: Potential pathogenic
    Tier 3: Uncertain significance
    Tier 4: Likely benign
    '''
    def get_tier(row):
        if row['clinvar_pathogenic'] and row['is_rare']:
            return 1
        elif row['is_rare'] and (row['cadd_deleterious'] or row['revel_pathogenic']):
            return 2
        elif row['is_rare']:
            return 3
        else:
            return 4

    df['tier'] = df.apply(get_tier, axis=1)
    return df
```

## Related Skills

- clinvar-lookup - ClinVar pathogenicity queries
- gnomad-frequencies - Population frequency filtering
- variant-calling/clinical-interpretation - ACMG classification
- variant-calling/filtering-best-practices - Quality filtering

Related Skills

tooluniverse-variant-interpretation

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Systematic clinical variant interpretation from raw variant calls to ACMG-classified recommendations with structural impact analysis. Aggregates evidence from ClinVar, gnomAD, CIViC, UniProt, and PDB across ACMG criteria. Produces pathogenicity scores (0-100), clinical recommendations, and treatment implications. Use when interpreting genetic variants, classifying variants of uncertain significance (VUS), performing ACMG variant classification, or translating variant calls to clinical actionability.

tooluniverse-variant-analysis

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Production-ready VCF processing, variant annotation, mutation analysis, and structural variant (SV/CNV) interpretation for bioinformatics questions. Parses VCF files (streaming, large files), classifies mutation types (missense, nonsense, synonymous, frameshift, splice, intronic, intergenic) and structural variants (deletions, duplications, inversions, translocations), applies VAF/depth/quality/consequence filters, annotates with ClinVar/dbSNP/gnomAD/CADD via ToolUniverse, interprets SV/CNV clinical significance using ClinGen dosage sensitivity scores, computes variant statistics, and generates reports. Solves questions like "What fraction of variants with VAF < 0.3 are missense?", "How many non-reference variants remain after filtering intronic/intergenic?", "What is the pathogenicity of this deletion affecting BRCA1?", or "Which dosage-sensitive genes overlap this CNV?". Use when processing VCF files, annotating variants, filtering by VAF/depth/consequence, classifying mutations, interpreting structural variants, assessing CNV pathogenicity, comparing cohorts, or answering variant analysis questions.

tooluniverse-structural-variant-analysis

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Comprehensive structural variant (SV) analysis skill for clinical genomics. Classifies SVs (deletions, duplications, inversions, translocations), assesses pathogenicity using ACMG-adapted criteria, evaluates gene disruption and dosage sensitivity, and provides clinical interpretation with evidence grading. Use when analyzing CNVs, large deletions/duplications, chromosomal rearrangements, or any structural variants requiring clinical interpretation.

tooluniverse-clinical-trial-matching

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

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

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

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

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

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.

tooluniverse-cancer-variant-interpretation

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Provide comprehensive clinical interpretation of somatic mutations in cancer. Given a gene symbol + variant (e.g., EGFR L858R, BRAF V600E) and optional cancer type, performs multi-database analysis covering clinical evidence (CIViC), mutation prevalence (cBioPortal), therapeutic associations (OpenTargets, ChEMBL, FDA), resistance mechanisms, clinical trials, prognostic impact, and pathway context. Generates an evidence-graded markdown report with actionable recommendations for precision oncology. Use when oncologists, molecular tumor boards, or researchers ask about treatment options for specific cancer mutations, resistance mechanisms, or clinical trial matching.

clinicaltrials-database

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

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

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Search ClinicalTrials.gov with natural language queries. Find clinical trials, enrollment, and outcomes using Valyu semantic search.

clinical-trial-protocol-skill

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

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

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

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

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

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.