From dc30c8bb5e0a711cb4956ae0695c6531cd33be05 Mon Sep 17 00:00:00 2001 From: Gianmauro Cuccuru Date: Sat, 13 Apr 2024 12:33:14 +0200 Subject: [PATCH] add delivery --- config/config.yaml | 3 ++- workflow/Snakefile | 5 +++++ workflow/rules/common.smk | 4 ++++ workflow/rules/delivery.smk | 13 +++++++++++++ 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 workflow/rules/delivery.smk diff --git a/config/config.yaml b/config/config.yaml index 96d3d3f..31f58c6 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -2,6 +2,7 @@ run: harmonization: True annotation: True summarize: True + delivery: True tiledb: False ldscore: False metal: False @@ -11,7 +12,7 @@ run: # paths sumstats_path: config/seqid_from_literature.tsv -#dest_path: "/path/to/final/destination" +dest_path: "/exchange/healthds/destination" workspace_path: "results" sumstat: diff --git a/workflow/Snakefile b/workflow/Snakefile index 554158c..b40b9f4 100644 --- a/workflow/Snakefile +++ b/workflow/Snakefile @@ -16,6 +16,11 @@ include: "rules/annotation.smk" include: "rules/summarize.smk" +if config.get("run").get("delivery"): + + include: "rules/delivery.smk" + + if config.get("run").get("metal"): include: "rules/metal.smk" diff --git a/workflow/rules/common.smk b/workflow/rules/common.smk index 1476bb4..14c853b 100644 --- a/workflow/rules/common.smk +++ b/workflow/rules/common.smk @@ -53,6 +53,10 @@ def get_final_output(): final_output.append(ws_path("min_pvalue_table.tsv")), final_output.append(ws_path("inflation_factors_table.tsv")) + if config.get("run").get("delivery"): + final_output.append(dst_path("min_pvalue_table.tsv")), + final_output.append(dst_path("inflation_factors_table.tsv")) + if config.get("run").get("annotation"): final_output.extend( expand( diff --git a/workflow/rules/delivery.smk b/workflow/rules/delivery.smk new file mode 100644 index 0000000..68939da --- /dev/null +++ b/workflow/rules/delivery.smk @@ -0,0 +1,13 @@ +rule move_to_destination: + input: + table_minp=ws_path("min_pvalue_table.tsv"), + table_if=ws_path("inflation_factors_table.tsv"), + output: + table_minp=dst_path("min_pvalue_table.tsv"), + table_if=dst_path("inflation_factors_table.tsv"), + resources: + runtime=lambda wc, attempt: attempt * 120, + shell: + """ + rsync -rlptoDvz {input.table_minp} {output.table_minp} && \ + rsync -rlptoDvz {input.table_if} {output.table_if}"""