a-h-b / dadasnake

Amplicon sequencing workflow heavily using DADA2 and implemented in snakemake
GNU General Public License v3.0
45 stars 17 forks source link

Visualize DAG #24

Closed thierryjanssens closed 2 years ago

thierryjanssens commented 2 years ago

How can I visualize the workflow of dadasnake? This would allow me to get an insight in the separate processes of the pipeline.

I do not succeed in creating a dag file with the snakemake --dag option with the dadasnake wrapper.

a-h-b commented 2 years ago

Hi - you need to call snakemake directly. DIR: path to your dadasnake directory CONFIG: path to your config file

you may also have to activate the conda environment with snakemake first If you followed the normal install instructions, it sits here:

conda activate $DIR/conda/snakemake_env

snakemake --cores 1 -s $DIR/Snakefile --dag --configfile $CONFIGFILE --use-conda --conda-prefix $DIR/conda

also mind the description here about visualization.

Hope this helps - A

thierryjanssens commented 2 years ago

Hi,

yes this help. But converting it to a pdf does not work.

$ cat dag | dot -Tpdf > dag.pdf Error: : syntax error in line 1 near 'laptop'

Somewhere an undesired print statement gets introduced. It is not coming from the main Snaekfile apparently. Maybe some of the smk modules?

a-h-b commented 2 years ago

Hi, I am sorry, but for the time being, you need to catch those prints with grep -v , as in

snakemake --cores 1 -s $DIR/Snakefile --dag --configfile $CONFIGFILE --use-conda --conda-prefix $DIR/conda | grep -v laptop | grep "Final" -v | grep "maxCores" -v | dot -Tpdf > dag.pdf

you may have to add more. Alternatively, you can do

snakemake --cores 1 -s $DIR/Snakefile --dag --configfile $CONFIGFILE --use-conda --conda-prefix $DIR/conda >> my_dag.txt

then you can edit this file and remove all lines before digraph snakemake_dag {

then you pipe that file to dot

cat my_dag.txt | dot -Tpdf > dag.pdf

hope this helps - A

a-h-b commented 2 years ago

if the pipeline ran successfully, you can of course also use dadasnake -r $CONFIG , which will create a .html report, which contains the tree.

thierryjanssens commented 2 years ago

Ok, thank you. This is very helpfull. I need the DAG for debugging and to try to find my way in the dadasnake workflow..