[meta]
name = "sniffles"
category = "variant-calling"
description = "Structural variant caller for long-read sequencing data from Oxford Nanopore and PacBio platforms"
tags = ["structural-variant", "sv", "long-read", "nanopore", "pacbio", "deletion", "insertion", "vcf"]
author = "oxo-call built-in"
source_url = "https://github.com/fritzsedlazeck/Sniffles"

[context]
concepts = [
    "Sniffles2 (version 2) detects SVs from long-read (ONT/PacBio) aligned BAM files; requires sorted, indexed BAM with MD tags.",
    "Use minimap2 -ax map-ont or map-pb to align reads first, then sort and index with samtools.",
    "Sniffles2 outputs VCF by default; use --vcf to specify output filename.",
    "Use --snf to output a Sniffles-specific format for multi-sample population SV calling.",
    "Population SV calling: run Sniffles2 --snf per sample, then combine with sniffles2 --input *.snf.",
    "Use --minsupport N to set minimum read support (default: auto); --minsvlen to set minimum SV length.",
    "Sniffles2 handles mosaic SVs with --mosaic flag for detecting low-frequency SVs.",
]

pitfalls = [
    "Sniffles2 requires MD tags in BAM — add --MD to minimap2 command: minimap2 --MD -ax map-ont ref.fa reads.fa | samtools sort.",
    "Input BAM must be coordinate-sorted and indexed with samtools index.",
    "Sniffles1 (older) has different command syntax than Sniffles2 — check version with sniffles --version.",
    "Without --snf, multi-sample calling requires re-running, which is less efficient than SNF-based approach.",
    "Very high --minsupport may miss rare somatic or mosaic events; very low values increase false positives.",
    "Sniffles is designed for long reads (>1kb) — it performs poorly on short Illumina reads.",
]

[[examples]]
task = "call SVs from a single Oxford Nanopore BAM file"
args = "--input sorted.bam --vcf output_svs.vcf --threads 8"
explanation = "--input sorted indexed BAM; --vcf output VCF file; --threads for parallel processing"

[[examples]]
task = "call SVs with minimum read support of 5 and minimum SV length of 50 bp"
args = "--input sorted.bam --vcf output_svs.vcf --minsupport 5 --minsvlen 50 --threads 8"
explanation = "--minsupport 5 requires ≥5 reads; --minsvlen 50 minimum SV size to report"

[[examples]]
task = "generate SNF file for multi-sample population SV calling"
args = "--input sample1.bam --snf sample1.snf --vcf sample1.vcf --threads 8"
explanation = "--snf creates Sniffles Network File for population-level merging; run for each sample"

[[examples]]
task = "combine multiple SNF files for population-level SV calling"
args = "--input sample1.snf sample2.snf sample3.snf --vcf population_svs.vcf --threads 8"
explanation = "pass all .snf files to merge SVs across the cohort; outputs population-level VCF"

[[examples]]
task = "call mosaic or somatic SVs with low frequency support"
args = "--input tumor.bam --vcf mosaic_svs.vcf --mosaic --threads 8"
explanation = "--mosaic enables detection of low-frequency SVs (somatic mutations, mosaicism)"
