nf-metro¶
Generate metro-map-style SVG diagrams from Mermaid graph definitions with %%metro directives. Designed for visualizing bioinformatics pipeline workflows (e.g., nf-core pipelines) as transit-style maps where each analysis route is a colored "metro line."
Installation¶
pip (PyPI)¶
Conda (Bioconda)¶
Container (Seqera Containers)¶
A pre-built container is available via Seqera Containers:
Requires Python 3.10+.
Quick start¶
Render a metro map from a .mmd file:
Validate your input without rendering:
Inspect structure (sections, lines, stations):
CLI reference¶
nf-metro render¶
Render a Mermaid metro map definition to SVG.
| Option | Default | Description |
|---|---|---|
-o, --output PATH |
<input>.svg |
Output SVG file path |
--theme [nfcore\|light] |
nfcore |
Visual theme |
--width INTEGER |
auto | SVG width in pixels |
--height INTEGER |
auto | SVG height in pixels |
--x-spacing FLOAT |
60 |
Horizontal spacing between layers |
--y-spacing FLOAT |
40 |
Vertical spacing between tracks |
--max-layers-per-row INTEGER |
auto | Max layers before folding to next row |
--animate / --no-animate |
off | Add animated balls traveling along lines |
--debug / --no-debug |
off | Show debug overlay |
--logo PATH |
none | Logo image path (overrides %%metro logo: directive) |
--from-nextflow |
off | Convert Nextflow -with-dag input before rendering |
--title TEXT |
none | Pipeline title (used with --from-nextflow) |
nf-metro convert¶
Convert a Nextflow -with-dag mermaid file to nf-metro format.
| Option | Default | Description |
|---|---|---|
-o, --output PATH |
stdout | Output .mmd file path |
--title TEXT |
auto | Pipeline title |
See Importing from Nextflow for details and examples.
nf-metro validate¶
Check a .mmd file for errors without producing output.
nf-metro info¶
Print a summary of the parsed map: sections, lines, stations, and edges.
Writing metro maps¶
Read the Guide to learn how to write .mmd files, from minimal examples to multi-section pipelines with custom grid layouts.
Gallery¶
See the Gallery for rendered examples covering simple pipelines, complex multi-line topologies, fan-out/fan-in patterns, fold layouts, and realistic bioinformatics workflows.