diff --git a/content/workflow-management.md b/content/workflow-management.md index ab78e5a..66ab543 100644 --- a/content/workflow-management.md +++ b/content/workflow-management.md @@ -194,7 +194,23 @@ Steps: - 8: Probably only the two lines containing "shell". ``` ```` +## Visualizing the workflow +We can visualize the directed acyclic graph (DAG) of our current Snakefile +using the `--dag` option, which will output the DAG in `dot` language. + +**Note**: This requires the [Graphviz software](https://www.graphviz.org/), +which can be installed by `conda install graphviz`. + +```console +$ snakemake -j 1 --dag | dot -Tpng > dag.png +``` +Rules that have yet to be completed are indicated with solid outlines, while already completed rules are indicated with dashed outlines. + +```{figure} img/snakemake_dag.png +:alt: Snakemake DAG +:width: 100% +``` ## Why [Snakemake](https://snakemake.readthedocs.io/)? @@ -209,6 +225,8 @@ Steps: - If several workflow steps are independent of each other, and you have multiple cores available, Snakemake can run them in parallel. - Nice functionality for archiving the workflow, see: [the official documentation](https://snakemake.readthedocs.io/en/stable/snakefiles/deployment.html#sustainable-and-reproducible-archiving) +Tools like Snakemake help us with **reproducibility** by supporting us with **automation**, **scalability** and **portability** of our workflows. + ## Similar tools @@ -220,20 +238,4 @@ Steps: - [Book on building reproducible analytical pipelines with R](https://raps-with-r.dev/) -## Visualizing the workflow - -We can visualize the directed acyclic graph (DAG) of our current Snakefile -using the `--dag` option, which will output the DAG in `dot` language. - -**Note**: This requires the [Graphviz software](https://www.graphviz.org/), -which can be installed by `conda install graphviz`. - -```console -$ snakemake -j 1 --dag | dot -Tpng > dag.png -``` -Rules that have yet to be completed are indicated with solid outlines, while already completed rules are indicated with dashed outlines. -```{figure} img/snakemake_dag.png -:alt: Snakemake DAG -:width: 100% -```