How to generate reports in Snakemake (that include runtime, cpu, memory) that mimic the nextflow reports

Viewed 52

I am used to working with nextflow which automatically generates reports for each process, so that I know how much time, cpu, and memory was used in each part of my workflow. Is there an equivalent of this in snakemake? If the authors of the snakemake pipeline don't manually report this, is there a way to extract this information automatically?

1 Answers

You might be able to use the benchmark directive to extract what you want without too much work:

The benchmark directive takes a string that points to the file where benchmarking results shall be stored. Similar to output files, the path can contain wildcards (it must be the same wildcards as in the output files). When a job derived from the rule is executed, Snakemake will measure the wall clock time and memory usage (in MiB) and store it in the file in tab-delimited format. It is possible to repeat a benchmark multiple times in order to get a sense for the variability of the measurements. This can be done by annotating the benchmark file, e.g., with repeat("benchmarks/{sample}.bwa.benchmark.txt", 3) Snakemake can be told to run the job three times. The repeated measurements occur as subsequent lines in the tab-delimited benchmark file.

https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#benchmark-rules

Related