Skip to content

Commit

Permalink
move viz to earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
samumantha committed Mar 15, 2024
1 parent 16322a9 commit 89119b4
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions content/workflow-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)?

Expand All @@ -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

Expand All @@ -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%
```

0 comments on commit 89119b4

Please sign in to comment.