Skip to content

Spec reference

A map is described by a YAML file, called the spec. slitherflow draft writes a starter spec for you; this page lists everything it can contain.

Example

Here's a small spec that uses most of the options. Everything except lines is optional.

title: "My pipeline"
subtitle: "v1.0  ·  Snakemake"
input: {label: "Input", sublabel: "Paired-end", file: "FASTQ"}

trunk:
  stations:
    - {name: "Trimming", tool: "cutadapt"}
    - {name: "Alignment", tool: "Bowtie2", outputs: [{file: "BAM", label: "Aligned reads"}]}
  lines: [peaks, qc]           # lines that run along the trunk, top to bottom

lines:
  peaks:
    name: "Peak calling"
    color: "#009E73"
    row: -1
    to: terminus
    stations:
      - {name: "Peak calling", tool: "MACS3"}
      - {name: "Peak filtering", tool: "bedtools", outputs: [{file: "BED", label: "Filtered peaks"}]}
  qc:
    name: "Quality control"
    row: 1
    to: terminus
    stations: [{name: "Fingerprints", tool: "deepTools"}]
  spike:
    name: "Spike-in normalization"
    optional: true
    from: "Trimming"           # leaves a trunk station (or use `input`)
    row: -1.6
    to: {line: peaks, station: "Peak filtering"}
    stations: [{name: "Spike-in alignment", tool: "Bowtie2"}]
  fragments:
    from: {line: qc, station: "Fingerprints"}   # a branch
    row: 1.6
    stations: [{name: "Fragment sizes", tool: "deepTools"}]

terminus: {name: "MultiQC", sublabel: "QC report", row: 1, file: "HTML"}
footnote: "One line of explanation under the legend."

Top level

Key Meaning
title, subtitle Text at the top of the map
input The start of the map: {label, sublabel, file}. file is the text on the input icon, such as "FASTQ", "CSV" or "NC" (default "IN")
trunk The shared steps every run goes through (see below)
lines Required. A mapping of line ID → line (see below)
terminus The end station (see below)
footnote One line of explanation under the legend
palette Line colours: a palette name such as tol-bright, or a list of colours (see below)
theme light (default), dark, or auto to follow the viewer's light/dark setting (see below)
style Overrides for the default look (see below)

Trunk

Key Meaning
stations The trunk's stations, drawn as pills spanning its lines
lines The line IDs that run along the trunk, top to bottom
labels: above Put the trunk's station labels above it
split_gap Extra space before the lines split apart
branch_gap Extra space before the first station after the split

Lines

Key Meaning
name The name shown in the legend (defaults to the line ID)
color Line colour (defaults to the next palette colour)
row Vertical position. Negative is above the trunk, positive below, and fractions are fine
optional: true Draw the line dashed, and add "(optional)" to its legend entry
from Where the line starts: a trunk station's name, input, or {line, station} to make it a branch
to Where the line ends: terminus, or {line, station} to join another line. By default it just stops
stations The line's stations, left to right

Stations

Key Meaning
name, tool The label, and the smaller grey text under it
optional: true Dashed station circle, with "optional" added to the tool text
x Exact horizontal position
gap Extra space before this station
label: above / below Which side the label goes on. By default it goes away from the trunk (or, on a branch, away from its parent line), and moves to the other side if a line is in the way
outputs File icons: a list of {file, label, color, dx, dy, label_side}
feeds A list of {line, station} that this step also feeds into. The target has to be further right, on a different line

Terminus

Key Meaning
name, sublabel The end station's label
row Vertical position
file Draw an output icon with this file type
x Exact horizontal position
outputs Extra file icons, as for stations

Style

Anything under style overrides these defaults:

Key Default Meaning
font 'Helvetica Neue', Helvetica, Arial, sans-serif Font family
line_width 7 Width of every line
gap 10 Spacing between parallel lines on the trunk
spacing 170 Distance between trunk stations
branch_spacing 140 Distance between stations on a branch
row_height 130 Vertical distance per row
corner 22 Corner radius of 90° bends
dash 16 9 Dash pattern for optional lines
margin 48 Space around the map
background, ink, muted, faint, rule the theme's Colours of the page, outlines and names, tool text, output connectors, and the line above the legend

Themes

theme: sets the colours of everything except the lines:

Theme Background Text and outlines Notes
light ■ #ffffff ■ #1f2328 Default
dark ■ #0d1117 ■ #e6edf3 Written straight into the file, so PNG and PDF are dark too
auto light, or dark when the viewer is in dark mode The SVG carries both sets of colours and switches by itself, in a browser or on GitHub. PNG and PDF come out light

Colours under style: win over the theme's, e.g. style: {ink: "#000000"}.

Colour palettes

Lines without their own color take the palette's colours in order, starting again from the first if there are more lines than colours. Branches share their parent line's colour. Pick a palette by name:

palette: tol-bright
Name Colours Notes
okabe-ito ■ ■ ■ ■ ■ ■ ■ ■ Default. Colour-blind safe (Okabe & Ito)
tol-bright ■ ■ ■ ■ ■ ■ ■ Colour-blind safe (Paul Tol)
tol-vibrant ■ ■ ■ ■ ■ ■ ■ Colour-blind safe (Paul Tol)
tol-muted ■ ■ ■ ■ ■ ■ ■ ■ ■ Colour-blind safe (Paul Tol); softer, with nine colours
ibm ■ ■ ■ ■ ■ Colour-blind safe (IBM Design Library). Only five colours, so on a map with more lines some share a colour
tab10 ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ matplotlib's default colours. Familiar, but not colour-blind safe

To see each one on a real map, look at the palette previews.

Or give your own colours, in the order lines should use them:

palette: ["#1b9e77", "#d95f02", "#7570b3"]

slitherflow render --palette NAME (and auto/draft --palette NAME) picks a named palette from the command line. On render it overrides the spec's palette: without changing the file.