long-read-sequencing/structural-variants/SKILL.md
Detects structural variants (deletions, insertions, inversions, duplications, translocations) from Oxford Nanopore and PacBio long-read alignments with Sniffles2, cuteSV, SVIM, and assembly-based callers, joint-genotypes cohorts via the Sniffles2 .snf workflow, and benchmarks with Truvari against GIAB. Covers why an SV call is a representation artifact (the tandem-repeat BED, aligner, and Truvari params set precision/recall as much as the caller), the cuteSV per-platform parameter trap, soft-clipped supplementary alignments as the SV substrate, and the somatic/mosaic boundary to Severus/nanomonsv. Use when calling germline or somatic SVs from ONT/HiFi reads, joint-genotyping a cohort, choosing or tuning an SV caller, or benchmarking SV calls.
npx skillsauth add GPTomics/bioSkills bio-long-read-sequencing-structural-variantsInstall 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.
Reference examples tested with: Sniffles 2.2+, cuteSV 2.1+, minimap2 2.28+, samtools 1.19+, truvari 4.0+.
Before using code patterns, verify installed versions match. If versions differ:
<tool> --version then <tool> --help to confirm flagsResults depend on inputs that outlive the binary version - record them:
--tandem-repeats) drives the FP rate in repeats more than any other setting. Record which TR BED was used.If code throws an error, introspect the installed tool (sniffles --help, cuteSV --help) and adapt the example to the actual API rather than retrying.
"Find structural variants in my long reads" -> Map with the SV-ready preset (soft-clipped supplementaries), call with a TR-aware caller, and benchmark stating the region set and Truvari params.
sniffles --input aln.bam --vcf svs.vcf --reference ref.fa --tandem-repeats TR.bedLong reads are the killer app for SVs: a single read spans the breakpoint (within-read CIGAR or split alignment) and resolves repeats short reads cannot. By convention SV = >=50 bp; the 30-100 bp range is a VNTR-dominated gray zone where callers disagree most.
In tandem repeats and segmental duplications, the same biological event has many valid VCF encodings - a deletion can be written as the reciprocal insertion on the other allele, and a VNTR expansion's breakpoints slide freely across repeat units. Consequently:
--tandem-repeats makes clustering repeat-aware (widening the merge window inside annotated TRs) - the single biggest FP-reduction lever, not a nicety.truvari refine exists precisely to re-harmonize representations within TR regions; benchmarking TR-dense regions without it systematically understates recall.| Tool | Regime | Best for | Citation | |------|--------|----------|----------| | Sniffles2 | germline + population + mosaic | the default germline workhorse; cohort joint genotyping; .snf merge | Smolka 2024 Nat Biotechnol 42:1571 | | cuteSV | germline | high sensitivity, speed; per-platform tuning required | Jiang 2020 Genome Biol 21:189 | | SVIM | germline | scores (not hard-filters) SVs; good INS detection | Heller 2019 Bioinformatics 35:2907 | | pbsv | germline (PacBio) | two-step discover->call; official PacBio tool | PacBio (no journal paper) | | NanoVar | germline, low-depth | 4-8x ONT clinical | Tham 2020 Genome Biol 21:56 | | dipcall / SVIM-asm / PAV | assembly-based germline | most accurate single sample with phased HiFi; truth-set generation | Li 2018; Heller 2021; Ebert 2021 | | Severus | somatic (tumor-normal) | cancer T/N, complex/subclonal | Keskus 2026 Nat Biotechnol | | nanomonsv | somatic (tumor-normal) | precise somatic breakpoints, MEI | Shiraishi 2023 NAR 51:e74 | | SVision-pro | de novo + somatic, complex | resolving nested CSVs | Wang 2025 Nat Biotechnol 43:181 |
| Scenario | Recommended | Why |
|----------|-------------|-----|
| Single ONT/HiFi germline sample | Sniffles2 + --tandem-repeats | TR-aware, auto support, fast |
| Cohort germline | Sniffles2 per-sample .snf -> merge | re-genotypes from raw signal; true joint genotypes |
| Maximum sensitivity / speed | cuteSV with the platform-matched param set | per-platform tuning is mandatory |
| Phased HiFi, want best per-sample accuracy | assembly-based (dipcall/SVIM-asm) -> hifi-assembly | resolves the alt haplotype directly |
| Tumor-normal somatic SVs | Severus or nanomonsv | paired callers; Sniffles --mosaic is single-sample only |
| Low-VAF mosaic in one sample | Sniffles2 --mosaic | lowers support, reports VAF (not a T/N caller) |
| Low coverage (4-8x) | NanoVar | designed for low-depth clinical |
| Benchmarking | Truvari (+refine) vs GIAB Tier1/CMRG | the field standard; state region + params |
Map with minimap2 (the modern default; NGMLR is a higher-precision/slower legacy niche for Sniffles). Use the platform preset and keep soft-clipped supplementary alignments - split-read callers reconstruct breakpoints from the clipped sequence on those records.
minimap2 -ax map-ont --MD -Y ref.fa ont.fq.gz | samtools sort -o aln.bam && samtools index aln.bam
# -Y keeps SEQ on supplementaries (the SV substrate); --MD for cuteSV; map-hifi/map-pb for PacBio
# Single sample (always supply --reference for INS sequence and --tandem-repeats for repeats)
sniffles --input aln.bam --vcf svs.vcf --reference ref.fa --tandem-repeats human_GRCh38_TR.bed
# Cohort: per-sample .snf signature index, then merge + joint-genotype
sniffles --input s1.bam --snf s1.snf --reference ref.fa --tandem-repeats TR.bed
sniffles --input s2.bam --snf s2.snf --reference ref.fa --tandem-repeats TR.bed
sniffles --input s1.snf s2.snf --vcf cohort.vcf --reference ref.fa
# Force-call / regenotype a known SV set in a new sample
sniffles --input new.bam --genotype-vcf known_svs.vcf --vcf genotyped.vcf
# Single-sample low-VAF / mosaic (NOT a tumor-normal caller)
sniffles --input tumor.bam --vcf mosaic.vcf --mosaic
The .snf is a binary signature index (NOT a VCF - never bcftools it); it retains sub-threshold signatures so the merge re-genotypes an SV even in a sample that did not independently pass support.
cuteSV's defaults are not platform-appropriate; the README gives distinct sets by error rate. --genotype is OFF by default. Positional args: cuteSV <bam> <ref> <out.vcf> <work_dir>. Force-calling moved to the separate cuteFC tool.
| Platform | --max_cluster_bias_INS | --diff_ratio_merging_INS | --max_cluster_bias_DEL | --diff_ratio_merging_DEL | |----------|------------------------|--------------------------|------------------------|--------------------------| | ONT | 100 | 0.3 | 100 | 0.3 | | PacBio HiFi/CCS | 1000 | 0.9 | 1000 | 0.5 | | PacBio CLR | 100 | 0.3 | 200 | 0.5 |
mkdir cutesv_work
cuteSV aln.bam ref.fa cutesv.vcf cutesv_work --genotype \
--max_cluster_bias_INS 100 --diff_ratio_merging_INS 0.3 \
--max_cluster_bias_DEL 100 --diff_ratio_merging_DEL 0.3 # ONT set
truvari bench --base giab_tier1.vcf.gz --comp calls.vcf.gz \
--includebed tier1_regions.bed --pctseq 0.7 --refdist 500 --passonly -o bench/
truvari refine bench/ # re-harmonize TR-region representations for a fair comparison
--pctseq (default 0.7) compares the actual inserted/deleted sequence, not just coordinates - set 0 for depth-based callers lacking alt sequence, keep 0.7 for long-read callers. Region set dominates the headline: Tier1 (resolvable INS/DEL >=50 bp) overstates whole-genome performance; CMRG reflects hard clinical loci. Tier1 v0.6 is INS/DEL only - do not report INV recall against it.
Trigger: calling in tandem repeats without a TR BED. Mechanism: the breakpoint slides across repeat units, scattering signatures. Symptom: several calls with inconsistent breakpoints where one event exists. Fix: supply --tandem-repeats to the caller; truvari refine when benchmarking.
Trigger: running cuteSV with one parameter set across platforms. Mechanism: HiFi settings over-merge ONT noise; ONT settings fragment clean HiFi signatures. Symptom: FP inflation or split calls. Fix: use the platform-matched set; remember --genotype is off by default.
Trigger: Sniffles without --reference, or alignment without -Y. Mechanism: no reference -> no ALT sequence; hard-clipped supplementaries -> lost breakpoint sequence. Symptom: INS lack sequence; imprecise breakpoints. Fix: add --reference and align with -Y.
Trigger: somatic SV calling with single-sample --mosaic. Mechanism: mosaic mode lowers support in one sample; it has no normal to subtract. Symptom: germline SVs reported as somatic; FP at low VAF. Fix: Severus or nanomonsv (paired tumor-normal).
Trigger: quoting F1 without region + TR BED + Truvari params. Mechanism: representation handling moves the number more than the caller. Symptom: apples-to-oranges comparisons. Fix: fix the region set, TR BED, and Truvari params; run truvari refine.
| Threshold | Source | Rationale |
|-----------|--------|-----------|
| SV >= 50 bp | GIAB convention | 30-100 bp is a VNTR gray zone where callers disagree |
| Sniffles --minsvlen 35, --mapq 25, --minsupport auto | Sniffles2 manpage | the actual defaults (support is coverage-derived, not a fixed 3) |
| Coverage ~20-30x germline; >30-60x mosaic/somatic | SV practice | large SVs callable from 5-10x; low-VAF needs depth |
| Truvari --pctseq 0.7, --refdist 500 | English 2022 | sequence-aware INS matching; loosen refdist to 1000 only for fuzzy callers |
| cuteSV params per platform | cuteSV README | error rate sets cluster bias / merge ratio |
| Error / symptom | Cause | Solution |
|-----------------|-------|----------|
| Many FP calls in repeats | no TR BED | supply --tandem-repeats |
| cuteSV VCF has no GT | --genotype off by default | add --genotype |
| Cannot bcftools the .snf | .snf is a binary signature index | use it as Sniffles input, not a VCF |
| INS records lack sequence | --reference not supplied | add --reference ref.fa |
| Imprecise/missing breakpoints | supplementaries hard-clipped | align with minimap2 -Y |
| Looking for cuteSV force-calling flag | moved to cuteFC | use the cuteFC tool |
| Somatic SVs from a single sample | germline/mosaic caller | Severus / nanomonsv (paired) |
-Y soft-clip, platform preset)tools
End-to-end CLIP-seq pipeline from FASTQ to ENCODE-compliant binding sites, single-nucleotide crosslink maps, annotation, motifs, and (optionally) differential binding. Use when running the full Yeo lab eCLIP / iCLIP / iCLIP2 / iCLIP3 / irCLIP / PAR-CLIP analysis with SMInput control, protocol-specific UMI extraction, ENCODE STAR parameters, CLIPper or Skipper peak calling with stringent log2 FC and -log10 p thresholds, IDR rescue and self-consistency QC, and downstream motif registration with mCross or PEKA.
development
Detect, date, and contextualize whole-genome duplication (WGD / paleopolyploidy) events using wgd v2 (Chen et al 2024), KsRates (Sensalari 2022 substitution-rate-corrected Ks dating), DupGen_finder (Qiao 2019), MAPS (Li 2018 phylogenomic), POInT (Conant 2008 ordered-block), SLEDGe (2024 ML-based), Whale.jl (Bayesian DL+WGD), and synteny-anchored paranome construction. Use when identifying ancient polyploidy from Ks distributions and synteny block analysis, positioning WGD events relative to speciation, distinguishing tandem from segmental from WGD duplications, dating the 2R/3R vertebrate / fish / salmonid WGDs, building paranome and Ks-age mixture models, applying KsRates substitution-rate correction across lineages, or testing alternative biased-fractionation / dosage-balance models post-WGD.
tools
Build whole-genome alignments using Progressive Cactus (Armstrong 2020 reference-free clade-level WGA), Minigraph-Cactus (Hickey 2024 pangenome-aware), LASTZ chain/net (UCSC pipeline), MUMmer4 (Marçais 2018 pairwise), minimap2 -x asm5/10/20 (Li 2018 fast pairwise), AnchorWave (Song 2022 WGD-aware), and Mauve / progressiveMauve (bacterial). Operates the HAL toolkit (Hickey 2013) for downstream extraction including halSynteny, halLiftover, halBranchMutations, and hal2maf. Use when constructing multi-species alignments for comparative-annotation projection (TOGA), synteny detection, conservation analyses (phyloP / PhastCons), or pangenome graph construction; selecting between reference-free (Cactus) and reference-anchored (LASTZ chains/nets) approaches; tuning sensitivity for closely vs distantly related genomes; or producing HAL files for genome-wide downstream tools.
development
Detect syntenic blocks and structural rearrangements between genomes using MCScanX (Wang 2012), JCVI/MCScan (Tang 2008 Python), GENESPACE (Lovell 2022) for orthology-anchored riparian visualization, SyRI for structural variation, AnchorWave for sequence-level synteny, i-ADHoRe 3.0 for highly diverged species, SynNet for synteny networks, and ntSynt for multi-genome macrosynteny. Use when identifying collinear gene blocks across species, distinguishing macrosynteny from microsynteny, detecting inversions/translocations/duplications, anchoring orthology in WGD lineages, producing publication riparian plots, computing synteny block age via Ks (cross-references whole-genome-duplication), or running synteny-aware ortholog inference in polyploids.