diff --git a/tools/metaphlan2/metaphlan2/Snakefile b/tools/metaphlan2/metaphlan2/Snakefile index 0bee33c4aa4abc3523f2779cb42c881189356ab2..4203f1303248d7359af40c2f4a0a43654de3df0a 100644 --- a/tools/metaphlan2/metaphlan2/Snakefile +++ b/tools/metaphlan2/metaphlan2/Snakefile @@ -16,6 +16,8 @@ rule metaphlan2: threads: __metaphlan2_threads run: + command = [] if params.modules: - shell("module load {params.modules}") - shell("{params.exec_command} --nproc {threads} --input_type {params.input_type} {params.options} {input} {output}") + command.append("module load {params.modules}") + command.append("{params.exec_command} --nproc {threads} --input_type {params.input_type} {params.options} {input} {output}") + shell(" && ".join(command)) diff --git a/tools/metaphlan2/metaphlan2_heatmap/Snakefile b/tools/metaphlan2/metaphlan2_heatmap/Snakefile index 147e0cd3b3f06b4ff6882c405703457da507d09b..46fb5c0a4475983050aeb38de1593e87461b16f9 100644 --- a/tools/metaphlan2/metaphlan2_heatmap/Snakefile +++ b/tools/metaphlan2/metaphlan2_heatmap/Snakefile @@ -12,6 +12,8 @@ rule heatmap: modules = __metaphlan2_heatmap_modules, options = __metaphlan2_heatmap_options run: + command = [] if params.modules: - shell("module load {params.modules}") - shell("{params.exec_command} {params.options} --in {input} --out {output}") + command.append("module load {params.modules}") + command.append("{params.exec_command} {params.options} --in {input} --out {output}") + shell(" && ".join(command)) diff --git a/tools/metaphlan2/metaphlan2_merge/Snakefile b/tools/metaphlan2/metaphlan2_merge/Snakefile index d9867689a7c3c8074d9293b72113af0b87864e2f..d7bba93285fb10a80c9be4b8fb182596d9536867 100644 --- a/tools/metaphlan2/metaphlan2_merge/Snakefile +++ b/tools/metaphlan2/metaphlan2_merge/Snakefile @@ -12,6 +12,8 @@ rule metaphlan2_merge: modules = __metaphlan2_merge_modules, options = __metaphlan2_merge_options run: + command = [] if params.modules: - shell("module load {params.modules}") - shell("{params.exec_command} {params.options} {input} > {output}") + command.append("module load {params.modules}") + command.append("{params.exec_command} {params.options} {input} > {output}") + shell(" && ".join(command))