From c54b4f992023dfb7f28edc9cea7930a15a99044e Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Tue, 12 Apr 2022 15:16:05 +0200 Subject: [PATCH] copy_config: copy actual snakemake.config --- scripts/copy_config.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/copy_config.py b/scripts/copy_config.py index ee1ca3f5..6eaf6e66 100644 --- a/scripts/copy_config.py +++ b/scripts/copy_config.py @@ -1,5 +1,6 @@ from shutil import copy +import yaml files = { "config.yaml": "config.yaml", @@ -14,5 +15,16 @@ if __name__ == '__main__': from helper import mock_snakemake snakemake = mock_snakemake('copy_config') + basepath = snakemake.config['summary_dir'] + '/' + snakemake.config['run'] + '/configs/' + for f, name in files.items(): - copy(f,snakemake.config['summary_dir'] + '/' + snakemake.config['run'] + '/configs/' + name) + copy(f, basepath + name) + + with open(basepath + 'config.snakemake.yaml', 'w') as yaml_file: + yaml.dump( + snakemake.config, + yaml_file, + default_flow_style=False, + allow_unicode=True, + sort_keys=False + ) \ No newline at end of file