Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are snakemake metadata files? When can I erase those?

Tags:

snakemake

I notice that my backup rsync script spends quite some time copying stuff with random name from .snakemake/metadata folders.

What are those files used for?

Can I safely erase them after a snakemake run has completed, or are they necessary for snakemake to correctly perform the next run?

More generally, is there some documentation about the files that snakemake creates in the .snakemake folder?

like image 962
bli Avatar asked Aug 10 '17 08:08

bli


People also ask

What is a Snakefile?

Snakefiles are Python code. Completing the Pipeline. Resources and parallelism. Make your workflow portable and reduce duplication. Scaling a pipeline across a cluster.


1 Answers

From this comment by Johannes Koster, creator of Snakemake:

[The .snakemake/ directory] is used to track (a) the value of the version keyword for each file, (b) the rule implementation for each file, in order to notify the user if something has changed when snakemake is invoked with --summary.

From a related comment on the Google Group:

In general, it is safe to delete the entire .snakemake directory if there is no running Snakemake instance and you are sure that all existing output files are complete. It only contains data provenance information (e.g., to track code input file or parameter changes [to determine if the workflow should be re-run]). You might want to keep .snakemake/conda, since it contains the conda environments used in your workflow.

Edit: To automatically remove the .snakemake/ directory upon successful execution of the pipeline, the onssuccess hook can be used:

import shutil
onsuccess:
    shutil.rmtree(".snakemake")
like image 140
tomkinsc Avatar answered Sep 30 '22 16:09

tomkinsc