Skip to content

Development

Build

cargo build -p cigar-sashimi-core     # analysis core
cd render && npm install               # renderer deps (first time)

Tests

Rust core:

cargo test -p cigar-sashimi-core

Renderer + wrapper (Node's built-in test runner, Node 18+):

cd render && node --test

Lint:

cargo clippy -- -D warnings

Manual verification

# JSON
./cigar-sashimi --bam test/data/test.bam --region chr1:100-300 --format json

# SVG / HTML (relaxed filters so the tiny fixture shows every event type)
./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 html --output /tmp/cigar-sashimi.html

Running the stages directly

# Core only → JSON on stdout
cargo run -q -p cigar-sashimi-core -- --bam test/data/test.bam --region chr1:100-300

# Pipe core JSON into the renderer
cargo run -q -p cigar-sashimi-core -- --bam test/data/test.bam --region chr1:100-300 \
  | node render/src/cli.js --format html --output plot.html

WASM build (browser app)

Install wasm-pack once:

cargo install wasm-pack

Build the package into web/pkg/ and serve the app:

wasm-pack build wasm --target web --out-dir ../web/pkg
python3 -m http.server 8080 --directory web/
# open http://localhost:8080

web/pkg/ is generated and git-ignored. The build emits cigar_sashimi_wasm.js (JS bindings) and cigar_sashimi_wasm_bg.wasm (the compiled binary, ~300 KB).

Documentation

The docs site is MkDocs Material (mkdocs.yml, sources in docs/).

mkdocs serve     # live preview
mkdocs build     # build static site

CI/CD

  • CI (.github/workflows/ci.yml) runs cargo test, cargo clippy -D warnings, and node --test on every push and PR.
  • Deploy (.github/workflows/deploy.yml) triggers on v*.*.* tags: builds the WASM app and the docs, assembles them (app at root, docs under /docs/), and publishes to GitHub Pages.