-
Notifications
You must be signed in to change notification settings - Fork 1
Tips
Stephan Reichl edited this page Aug 7, 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 unsure why a certain rule will be executed use option
--reason
during the dry run, this will give the reason for the execution of each rule.snakemake -p -n --reason
- 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.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. - command to generate the directed acyclic graph (DAG) of all jobs with current configuration for visual inspection (most often too large to inspect).
snakemake --dag --forceall | dot -Tsvg > workflow/dags/all_DAG.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.