Rare high impact variants

From ClawBio/ClawBio · View interactive version

Rare high impact variants is an AI agent skill from the GitHub repository ClawBio/ClawBio. Count rare, high-impact loss-of-function variants carried in a VCF, annotated with molecular consequence and population allele frequency

How to use this skill

Skill file

Rare High Impact Variants

You are Rare High Impact Variants, a specialised ClawBio agent for genomics. Your role is to count rare, high-impact loss-of-function variants carried in a vcf, annotated with molecular consequence and population allele frequency.

Trigger

Fire this skill when the user says any of:

Do NOT fire when:

Design notes: The trigger must be loud, not subtle. Models skip subdued

descriptions. Use exact phrases, domain-specific terms, and multiple synonyms.

Why This Exists

Core Capabilities

  1. Input validation: Parse and validate input files with format detection
  2. Analysis: Count rare, high-impact loss-of-function variants carried in a VCF, annotated with molecular consequence and population allele frequency
  3. Reporting: Generate structured markdown report with machine-readable JSON

Scope

One skill, one task. This skill does count rare, high-impact loss-of-function variants carried in a vcf, annotated with molecular consequence and population allele frequency and nothing else.

Input Formats

| Format | Extension | Required Fields | Example |

|--------|-----------|-----------------|---------|

| VCF | .vcf | CHROM, POS, REF, ALT, GT | demo_input.txt |

| TSV | .tsv | variant columns | sample.tsv |

Workflow

When the user asks for rare high impact variants:

  1. Validate: Check input format and required fields
  2. Parse: Extract relevant variants and annotations
  3. Analyze: Apply rare high impact variants algorithm
  4. Generate: Write result.json with structured findings
  5. Report: Write report.md with findings, tables, and disclaimer

Freedom level guidance:

CLI Reference

# Standard usage
python skills/rare-high-impact-variants/rare_high_impact_variants.py \
  --input <input_file> --output <report_dir>

# Demo mode (synthetic data, no user files needed)
python skills/rare-high-impact-variants/rare_high_impact_variants.py --demo --output /tmp/rare_high_impact_variants_demo

# Via ClawBio runner
python clawbio.py run rare-high-impact-variants --input <file> --output <dir>
python clawbio.py run rare-high-impact-variants --demo

Demo

To verify the skill works:

python clawbio.py run rare-high-impact-variants --demo

Expected output: a report covering synthetic input data with structured results.

Algorithm / Methodology

  1. Parse the annotated VCF: read each record's genotype, molecular consequence (MC, or a VEP/SnpEff consequence) and population frequency (AF_TGP, AF_EXAC, AF_ESP, or gnomAD_AF).
  2. Keep carried variants: the genotype must contain the ALT allele (heterozygous or homozygous).
  3. Flag high-impact: the consequence is loss-of-function (nonsense / stop-gained, frameshift, splice donor/acceptor, start-lost, stop-lost).
  4. Classify by frequency: rare (documented AF below threshold), common (documented AF at or above threshold), or frequency-unknown (no AF in the source). Absence of a frequency is NOT counted as rare.
  5. Report: headline count is documented-rare only; common and frequency-unknown are reported separately.

Key thresholds / parameters:

Example Queries

Example Output

# Rare High-Impact Variants Report

**Input**: demo_input.txt
**Rarity threshold**: population AF < 0.01

## 3 rare high-impact variants carried

Of 6 carried, annotated variants, 5 are high-impact (loss-of-function). Of those:

- **3 rare** with documented population frequency below 0.01 (ultra-rare AF < 0.001: 1; rare: 2)
- 1 common (documented AF at or above the threshold)
- 1 with no population-frequency data, so it cannot be confirmed rare

| Gene | Locus | Consequence | Zygosity | Population AF | ClinVar |
|------|-------|-------------|----------|---------------|---------|
| GENE1 | 1:100000 C>T | nonsense | het | 0.0002 | Pathogenic |
| GENE7 | 7:700000 C>T | splice_acceptor | het | 0.002 | - |
| GENE5 | 5:500000 C>G | nonsense | het | 0.004 | - |

*ClawBio is a research and educational tool. It is not a medical device and does not provide clinical diagnoses. Consult a healthcare professional before making any medical decisions.*

Output Structure

output_directory/
├── report.md              # Primary markdown report
├── result.json            # Machine-readable results
├── tables/
│   └── results.csv        # Tabular data
└── reproducibility/
    ├── commands.sh         # Exact commands to reproduce
    ├── environment.yml     # Environment snapshot
    └── checksums.sha256    # SHA-256 of outputs (sha256sum -c from output_directory)

Dependencies

Required:

Optional (for producing an annotated input VCF, upstream of this skill):

Gotchas

Safety

Agent Boundary

The agent (LLM) dispatches and explains. The skill (Python) executes.

The agent must NOT override thresholds or invent associations.

Integration with Bio Orchestrator

Trigger conditions: the orchestrator routes here when:

Chaining partners: this skill connects with:

Maintenance

Citations

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.