copy_config: copy actual snakemake.config

This commit is contained in:
Fabian Neumann 2022-04-12 15:16:05 +02:00
parent d4a82a2a41
commit c54b4f9920

View File

@ -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
)