Skip to content

Commit

Permalink
Merge pull request #281 from timtroendle/feature-dag-rule
Browse files Browse the repository at this point in the history
Add rule that generates the DAG
  • Loading branch information
timtroendle authored Mar 14, 2024
2 parents b5b3a95 + de42728 commit 1685e78
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

### Added (workflow)

* **ADD** DAG rule that generates a visualisation of Snakemake's directed acyclic graph (#208).
* **ADD** IPython debugger to all conda environments to ease debugging (#254).
* **ADD** a default Snakemake profile to run on local machines in addition to the existing profile for Euler (#211).
* **ADD** a Snakemake profile to run using conda instead of mamba (#211).
Expand Down
15 changes: 15 additions & 0 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,21 @@ rule build_metadata:
script: "scripts/metadata.py"


rule dag_dot:
output: temp("build/dag.dot")
shell:
"snakemake --rulegraph > {output}"


rule dag:
message: "Plot dependency graph of the workflow."
input: rules.dag_dot.output[0]
# Output is deliberatly omitted so rule is executed each time.
conda: "envs/dag.yaml"
shell:
"dot -Tpdf {input} -o build/dag.pdf"


rule clean: # removes all generated results
shell:
"""
Expand Down
5 changes: 5 additions & 0 deletions envs/dag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: dag
channels:
- conda-forge
dependencies:
- graphviz=2.50.0

0 comments on commit 1685e78

Please sign in to comment.