Skip to content

Commands

slitherflow auto    PROJECT [-o map.svg]   [--scan [--compare] | --rulegraph FILE.dot] [--palette NAME] [--theme THEME] [--png] [--pdf] [--strict] [-- SNAKEMAKE ARGS]
slitherflow draft   PROJECT [-o spec.yaml] [--scan [--compare] | --rulegraph FILE.dot] [--palette NAME] [-- SNAKEMAKE ARGS]
slitherflow render  SPEC    [-o map.svg]   [--palette NAME] [--theme THEME] [--png] [--pdf] [--strict]
slitherflow preview SPEC    [--palette NAME] [--theme THEME] [--port N] [--no-browser]
slitherflow --version
Command What it does
auto Writes a draft spec (if there isn't one yet) and renders it, in one step
draft Only writes the draft spec
render Renders a YAML spec
preview Opens a live view of a spec in your browser, redrawn every time you save it (see below)

Getting the rule graph (auto, draft)

Option Meaning
PROJECT The Snakemake project folder (where you normally run snakemake). Its name becomes the map's title.
(default) Runs snakemake --rulegraph --nolock in PROJECT, so it's safe to use while the pipeline is running.
--scan Reads the Snakefiles directly instead of running Snakemake, so every optional rule shows up. See Show every optional step.
--compare With --scan: also runs snakemake --rulegraph and marks the rules your current config doesn't use as optional. See Show every optional step.
--rulegraph FILE.dot Uses a saved snakemake --rulegraph output instead of running Snakemake. PROJECT is then only used for the title.
--save-rulegraph FILE.dot Keeps a copy of the rule graph that was used, from Snakemake or from --scan.
--snakemake PATH Uses a specific Snakemake executable (default: snakemake on your PATH).
-- ARGS… Everything after -- is passed to Snakemake, e.g. -- --configfile config/test.yaml. With --scan, only together with --compare.

--scan and --rulegraph can't be used together.

Output (auto, draft, render)

Option Commands Meaning
-o, --output auto The map .svg (default: <project>_subway.svg). The spec is written next to it with a .yaml suffix.
-o, --output draft The spec .yaml (default: <project>_subway.yaml).
-o, --output render The map .svg (default: next to the spec).
--overwrite-spec auto Replace an existing spec. By default auto keeps it, so your edits are safe.
--palette NAME auto, draft, render Line colours: okabe-ito (default), tol-bright, tol-vibrant, tol-muted, ibm or tab10. A new draft gets palette: NAME; on render (and auto with a kept spec) it overrides the spec's palette: without changing the file. See Colour palettes.
--theme THEME auto, render, preview light (default), dark, or auto to follow the viewer's light/dark setting (SVG only: PNG and PDF come out light). Overrides the spec's theme: without changing the file. See Dark mode.
--png auto, render Also write a PNG at 3× resolution. Needs rsvg-convert.
--pdf auto, render Also write a vector PDF. Needs rsvg-convert.
--strict auto, render Exit with an error if the overlap check finds anything. Useful in CI.

Live preview (preview)

slitherflow preview SPEC serves a page on your own computer (at http://127.0.0.1:8000/) and opens it in your browser. Every time you save the spec, the map is redrawn. The page shows:

  • the map, with any overlaps listed under it;
  • the error that stopped it drawing, if the spec has a mistake (the last good map stays on screen, faded);
  • the x and row under the mouse. Click the map to copy x: <number>.
Option Meaning
--palette NAME, --theme THEME As for render
--port N The port to use (default: 8000, or any free port if 8000 is taken)
--no-browser Don't open a browser; just print the address

Press Ctrl-C to stop it. The preview never writes any files: run render when you're happy with the map.