Skip to content

Getting Started

This is the command-line walkthrough. If you just want to look at one region without installing anything, use the Web App instead.

Prerequisites

  • Rust toolchain with cargo (builds the analysis core)
  • Node.js 18+ with npm (runs the SVG/HTML renderer)
  • An indexed BAM file (.bam plus a .bai or .csi)

How it runs

The cigar-sashimi wrapper script lives at the repository root and orchestrates the two stages for you: the Rust core reads the BAM and emits JSON, and the Node renderer turns that JSON into SVG or HTML. Run it from the repository root.

When you ask for svg or html, the wrapper also writes the intermediate JSON next to your output (e.g. plot.svg is accompanied by plot.json), so you always keep the machine-readable results.

Generate a plot

Interactive HTML:

./cigar-sashimi \
  --bam path/to/sample.bam \
  --region chr1:1000-2000 \
  --format html \
  --output sample.html

Static SVG:

./cigar-sashimi \
  --bam path/to/sample.bam \
  --region chr1:1000-2000 \
  --format svg \
  --output sample.svg

Raw JSON (written to stdout unless you pass --output):

./cigar-sashimi \
  --bam path/to/sample.bam \
  --region chr1:1000-2000 \
  --format json

Add a gene model

Supply a reference GTF to draw exon/intron structure. Without one, the tool infers a coarse exon/intron layout from coverage so the backbone still compresses long introns.

./cigar-sashimi \
  --bam path/to/sample.bam \
  --region chr7:55019017-55211628 \
  --gtf annotation.gtf \
  --format html \
  --output egfr.html

To compare an assembly against the reference and highlight novel features:

./cigar-sashimi \
  --bam path/to/sample.bam \
  --region chr7:55019017-55211628 \
  --gtf reference.gtf \
  --assembly assembly.gtf \
  --show-novel-exon \
  --show-novel-intron \
  --format html \
  --output egfr.html

Sample data

The repository ships a minimal fixture at test/data/test.bam (with its .bai). It is small, and the default filters are tuned for real data, so relax the thresholds to make every event type visible in the example:

./cigar-sashimi \
  --bam test/data/test.bam \
  --region chr1:100-300 \
  --min-junction 1 \
  --min-insertion 1 \
  --min-clip-len 1 \
  --min-ins-len 1 \
  --min-mapq 0 \
  --format svg \
  --output test.svg

See the CLI Reference for every option and its default.