-
Notifications
You must be signed in to change notification settings - Fork 1
Tips
Stephan Reichl edited this page Sep 11, 2024
·
3 revisions
Here are some tips for better understanding and troubleshooting that I found useful.
- Always use the flag
-p
that makes Snakemake print the resulting shell commands that will be executed.snakemake -p
- Always perform first a dry run using the flag
-n
, to check if the configuration works and the workflow does what you intend it to do.snakemake -p -n
- If you use a module in multiple projects with different configuration files use the command line argument
--configfile
to overwrite values from the configfile statement. Important note from the docs: Note that any values parsed into the config dictionary with any of the above mechanisms are merged, i.e., all keys defined via a configfile statement, or the--configfile
and--config
command line arguments will end up in the final config dictionary, but if two methods define the same key, command line overwrites the configfile statement. Note: this is not true for module usage!snakemake --configfile path/to/config.yaml
- In case a module crashes, you manually canceled your jobs or when Snakemake gets stuck trying to "resume.. resubmit.." jobs, then remove the
.snakemake/incomplete
directory.rm -rf .snakemake/incomplete
- Command to generate the directed acyclic graph (DAG) of all jobs with current configuration for visual inspection (most often too large to inspect, see next point).
snakemake --dag --forceall | dot -Tsvg > workflow/dags/all_DAG.svg
- Command to generate the directed acyclic rule graph of all rules with current configuration for visual inspection.
snakemake --rulegraph --forceall | dot -Tsvg > workflow/dags/rulegraph.svg
- In case of errors during installations, make dure your conda channel priorities are set to "strict"
conda config --set channel_priority strict
- Finally, if you want to develop your own workflows/modules start with the excellent tutorial from the documentation.