claude/skills/chimeric-read-validation/SKILL.md
Verify that structural-variant / breakpoint calls are actually real by checking the chimeric reads that support them. Use whenever the user has caller output (Severus, Manta, Sniffles2, Delly, GRIDSS, MELT, Arriba, SvABA) and wants to validate / audit / QC / double-check their calls — viral integrations (HTLV-1, HBV, HPV, EBV), gene fusions (BCR-ABL, IGH translocations), mobile element insertions (L1, Alu, SVA), translocations. Trigger on phrasings like "is this integration real?", "should I trust this fusion call?", "are these false positives?", "are these PASS calls actually supported by reads?", "QC my SV calls", or any per-call chimeric-read / contamination / bimodality / T-vs-N read overlap question. Also fires on BAM @PG -Y / SA-tag questions on chimeric BAMs, and on /chimeric-read-validation. Output is a per-call TSV with pass / needs_review / fail verdicts. Do not use for calling SVs (use the caller), IGV screenshots (use igv-reports), or RNA-level fusion FDR (use Arriba).
npx skillsauth add sahuno/llm_configs chimeric-read-validationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Caller PASS is necessary but not sufficient. PASS means the caller's internal heuristics fired correctly; it doesn't say whether the supporting reads actually agree with the called breakpoint at the read level. For breakpoint-style events the only ground truth is the chimeric reads themselves.
This skill takes a candidate breakpoint table + the BAMs and answers four questions per call:
Output is a per-call TSV with a verdict (pass / needs_review / fail) and explicit reasons, ready to drop into a manuscript Methods section as Supplementary Table.
The reference run on the ATLL HTLV-1 cohort (May 2026) classified 9/9 integrations as PASS with no false positives — but the skill's job is to catch them when they appear. The work pattern matters even when zero fire on a particular cohort.
extract — per-call chimeric-read extractionGiven a breakpoint table + tumor BAM (± normal BAM) + target contig name, write per-call chimeric-read TSVs with:
python scripts/extract_chimeric_reads.py \
--calls calls.tsv \
--target-contig HTLV1 \
--bam-dir analysis/realign \
--output-dir results/<run>/data
Samplesheet mode mirrors the igv-reports skill pattern — calls.tsv is a TSV with columns: event_id, patient, host_chrom, host_pos, tumor_bam, normal_bam (normal_bam optional).
validate — apply the verdict rubricGiven the per-call TSVs from extract, compute the validation report TSV:
python scripts/compute_validation_report.py \
--per-int-dir results/<run>/data/per_integration \
--calls calls.tsv \
--rubric viral_integration \
--output results/<run>/data/cohort_validation_report.tsv
report — manuscript-ready outputRender a one-page Markdown summary of the validation table for inclusion in a Methods section, plus a supplementary-table caption.
python scripts/render_supp_table_caption.py \
--validation-tsv results/<run>/data/cohort_validation_report.tsv \
--rubric viral_integration \
--output results/<run>/Methods_validation.md
These are the patterns that justify the skill — read references/best_practices.md for the full rationale and worked examples.
Per-read breakpoint positions, mapQ values, soft-clip lengths — anything where each read contributes one observation — should be summarized with median + median absolute deviation (MAD) + fraction within ±X bp of the median, NOT mean and standard deviation.
Why: stdev squares deviations, so one outlier read with a breakpoint 5,000 bp off the consensus dominates the metric and produces a false alarm. The ATLL cohort hit this exact pattern: p17424_2 chr7 had stdev = 2,867 bp (alarming) but 94% of its 18 chimeric reads sat within 10 bp of the median (clean). The integration is real; the metric was bad.
The skill encodes this rule globally — stdev never enters a verdict rubric; only median, MAD, and fraction-within-X do.
When chimeric reads cluster at TWO host positions separated by ~SVLEN bp, you're sampling both LTR-host junctions of an integration (or both ends of an inversion / large insertion). High overall stdev in this case is real biology, not an inference artifact.
The skill splits chimeric reads by dominant soft-clip side and checks whether the two cluster medians are separated by ~SVLEN. When yes, the call passes review even if the global breakpoint stdev looks alarming.
When a caller's matched-normal classifier rejects a call, that rejection itself is informative — it's a contamination signal, not a false-positive verdict. The skill surfaces this distinction explicitly: "rejected for contamination" ≠ "rejected for low evidence."
Generic SV-validation rubrics flag breakpoints in repeat-rich regions because repeats can cause mapping ambiguity. For viral integration biology, this is exactly backwards: HTLV-1, HBV, retrotransposons all preferentially integrate into AT-rich / repeat-dense regions. Flagging "breakpoint sits in 90%+ repeat content" as suspicious for a viral integration miscalls 60-90% of the cohort.
The skill ships with a small library of named rubrics. Pick the one that matches your event's biology — see references/rubrics.md:
| Rubric | Use for | Repeat-overlap |
|---|---|---|
| viral_integration | HTLV-1, HBV, HPV, EBV, MCV, AAV | informational; flag only when paired with low host mapQ |
| gene_fusion | BCR-ABL, RUNX1-RUNX1T1, IGH translocations | informational; pairs with breakpoint-coding-exon distance |
| mobile_element | L1, Alu, SVA, retrotransposons | informational; expected by biology |
| generic_sv | de novo SV in a non-special region | flags repeat-overlap directly |
Recommended sequence:
minimap2 -Y (or equivalent) so SA tags carry soft-clipped sequence. Check samtools view -H <bam> for the @PG line. The extract script does this preflight automatically and warns on missing -Y.event_id, patient, host_chrom, host_pos, tumor_bam, normal_bam. Include caller-side fields like svlen_bp, provirus_class (intact / defective), caller_vaf if you have them — they feed the rubric's defective-aware aligned-length thresholds and the per-patient VAF concordance metric.extract: produces <run>/data/per_integration/<event_id>.chimeric_reads.{tumor,normal}.tsv and a per-call summary TSV.validate: applies the chosen rubric and produces the verdict TSV.report: emits Markdown ready to paste into Methods.The defaults below are locked in per the design. Override only with documented reason.
| Argument | Default | Notes |
|---|---|---|
| --target-contig | required, no default | Skill validates the contig exists in the BAM header before extracting; fails fast on misconfiguration |
| --flanking-bp | 1000 | Half-window around the host position for samtools view region |
| --concordance-window-bp | 10 | The X in "fraction-within-X-bp-of-median" |
| --rubric | viral_integration | Other choices: gene_fusion, mobile_element, generic_sv |
| --min-chimeric-reads-pass | 8 | Below this, the call goes to needs_review |
| --min-chimeric-reads-fail | 5 | Below this, the call fails outright |
| --max-caller-vs-consensus-pass-bp | 50 | Caller-vs-chimeric-median offset above this triggers needs_review |
| --max-caller-vs-consensus-fail-bp | 1000 | Above this, the call fails |
| --min-concordance-frac | 0.7 | Minimum fraction-within-X-bp; bypassed when bimodality matches SVLEN |
Logs every run to logs/run_<TS>.log per the user's CLAUDE.md §Logging requirements.
These are baked into the scripts. Read references/best_practices.md for the full table with rationale.
mean / stdev on per-read metrics — never used in verdict; rubric uses median + MAD + fraction-within-Xsamtools view with -f 0x800 only catches half — skill defaults to primary-only (skip 0x100|0x800) + SA-tag parsing; see references/sa_tag_primer.mdminimap2 -L vs -Y produces different SA tag content — skill validates SA tag schema before extraction; warns if -Y flag absent in BAM @PG header--target-contig argument; skill validates the contig exists in the BAM header--mosdepth-summary <pattern> with {patient} substitution; falls back to running mosdepth if absent.bai mtime ≥ .bam mtime as a preflight checkprovirus_class; defectives get separate rubric rowsigv-reports or igv-screenshots.Read these as needed; they are not loaded into context by default.
references/best_practices.md — full rationale for the working patterns + extended gotcha table + per-event-type rubric guidancereferences/rubrics.md — the named rubrics with thresholds + rationale per event biologyreferences/sa_tag_primer.md — how to parse SA tags, soft-clip semantics, why -Y mattersexamples/htlv1_cohort_validation.sh — full reproduction of the ATLL HTLV-1 cohort runexamples/fusion_call_validation.sh — pattern for BCR-ABL / IGH translocation validationexamples/mobile_element_validation.sh — pattern for L1/Alu insertion validation/data1/greenbab/projects/ont/Project_17424/results/20260503_hg38plusHTLV1EBV_cohort_chimeric_read_evidence/. The 9/9 PASS verdict on the ATLL cohort is the proof-of-concept — see data/cohort_validation_report.tsv in that run.nfcore-module (when the user wants to wrap chimeric-read validation as an nf-core module), igv-reports (visual inspection layer for spot-checks), severus rules in ~/.claude/rules/severus.md (caller-side gotchas that explain why validation is needed).development
Decide whether and how to scatter genomics workloads across chromosomes or region tiles, then gather the per-shard outputs back together correctly. Use proactively whenever the user mentions parallelizing per-chromosome, sharding by chrom, tiling the genome, splitting a BAM/VCF/BED by region, merging per-chrom outputs, or has a workflow with obvious per-chromosome parallelism (variant calling, methylation pileup/DMR, coverage, liftover, peak calling, SV calling). Also triggers on /scatter-gather, "scatter X across chromosomes", "shard this", "chunked variant calling", "merge per-chrom VCFs", "gather these bedmethyl files", "concat these bigwigs", or any per-region parallelism question. **Trigger even when the user is also using Snakemake or Nextflow** — those skills handle DAG plumbing while this one defines *what* to scatter, *whether* it's even safe to scatter (some computations like DSS DMLtest pool globally and break under naive sharding), and *how* to gather each output format without silent corruption. Especially trigger on questions about merging per-chromosome BAM / VCF / BED / bedMethyl / bigwig outputs, or whether a scatter-gather is equivalent to running on the whole genome.
tools
Build self-contained, offline HTML genomic-region reports with igv-reports (create_report). Each HTML bundles igv.js viewers per region with embedded BAM/VCF data slices and default tracks (CpG islands, gencode, RepeatMasker); a reviewer clicks the variant table to inspect read-level evidence with no internet, no server, no IGV install. USE this skill whenever the user wants an HTML, clickable, or browseable viewer of genomic data — phrases like "HTML IGV report", "offline IGV", "self-contained HTML", "clickable viewer", "create_report", "igv-reports", "email this viewer", or any browseable HTML of reads at variants, fusion breakpoints, SV junctions, viral integrations, ChIP peaks, or ROIs. Trigger even when the user doesn't say "igv-reports" — giveaway is HTML/clickable/offline plus genomic regions. Also fire on /igv-reports. DO NOT use for static PNG/PDF/SVG IGV screenshots — use the igv-screenshots skill. Supports hg38, mm10, mm39, T2T. Defaults: --flanking 300, --standalone, genome-tagged output.
tools
Run a stage-gated runtime/resource optimization study for any bioinformatics tool or command-line program on a SLURM HPC cluster. Walks through preflight, OFAT factor scan, 2^k confirmation factorial, build-mode + alternative-implementation comparison, input-size scan, out-of-sample validation, and produces a fitted predictive resource model (wall_s and peak_rss as functions of input size), a machine-readable model.yaml with caveats, a full REPORT.md, and a one-page exec summary PDF. Trigger PROACTIVELY whenever the user asks to "benchmark", "optimize", "tune", "characterize runtime/memory", "find best config", "build a resource model", "how does X scale", or "what should I put in my Snakemake resources directive for tool Y" — for any compute-bound bioinformatics step (sort, dedup, alignment, variant calling, methylation calling, basecalling, indexing, pileup, liftover). Also triggers on /runtime-resource-study or /benchmark-tool. Skip only for one-off quick timing where a single number suffices and no model is needed.
tools
End-to-end builder for new nf-core modules. Scaffolds all required files, runs lint and nf-test in a loop until both pass, and produces PR-ready artifacts (description, Slack draft, checklist). Use this skill proactively whenever the user wants to: create a new nf-core module, add a tool to nf-core/modules, write a DORADO_BASECALLER or MODKIT_LOCALIZE style process, wrap a bioinformatics tool in Nextflow for nf-core, or asks "how do I submit a module to nf-core". Also trigger for: adding GPU support to a module, wrapping an R or Python script as an nf-core process, handling licensed/ non-bioconda tools in nf-core, fixing nf-core lint failures on a new module. Do NOT trigger for: editing existing pipelines, writing Snakemake rules, or debugging non-module Nextflow code.