<p>I think you are looking for <code>--rulegraph</code> instead of <code>--dag</code></p>

<pre><code>  --rulegraph           Do not execute anything and print the dependency graph
                        of rules in the dot language. This will be less
                        crowded than above DAG of jobs, but also show less
                        information. Note that each rule is displayed once,
                        hence the displayed graph will be cyclic if a rule
                        appears in several steps of the workflow. Use this if
                        above option leads to a DAG that is too large.
</code></pre>

CC BY-SA 4.0
2019-04-08T04:27:28.917Z
2019-04-08T04:27:28.917Z
finswimmer
<p>I am using snakemake to create workflows. It is very convenient to visualise my DAG using <code>snakemake --dag target{sampleA,sampleB,sampleC}File | dot -Tpdf &gt; dag.pdf</code>. The resulting pdf shows all the rules' dependencies to get to the target files. However, there is one node per rule/sample combination in the pdf image. When I have many samples, this creates an unreadable image with little added value. Is there an option to merge all the nodes from the same rule together so that I have the workflow for just one sample?</p>

<snakemake>
How can I ask snakemake to produce a dag where each node represents a rule?
# How can I ask snakemake to produce a dag where each node represents a rule?

(Asked by: username_0 on 2019-04-07)

I am using snakemake to create workflows. It is very convenient to visualise my DAG using `snakemake --dag target{sampleA,sampleB,sampleC}File | dot -Tpdf > dag.pdf`. The resulting pdf shows all the rules' dependencies to get to the target files. However, there is one node per rule/sample combination in the pdf image. When I have many samples, this creates an unreadable image with little added value. Is there an option to merge all the nodes from the same rule together so that I have the workflow for just one sample?

**Tags:** snakemake

---

## 1 answers

### Answer by username_1 on 2019-04-08. Score: 7 | Accepted answer

I think you are looking for --rulegraph instead of --dag
  --rulegraph           Do not execute anything and print the dependency graph
                        of rules in the dot language. This will be less
                        crowded than above DAG of jobs, but also show less
                        information. Note that each rule is displayed once,
                        hence the displayed graph will be cyclic if a rule
                        appears in several steps of the workflow. Use this if
                        above option leads to a DAG that is too large.


---

