From e5a532235822e5fc54432dda128bd1890878605a Mon Sep 17 00:00:00 2001 From: Kenzo-Hugo Hillion <hillion.kenzo@gmail.com> Date: Mon, 23 Aug 2021 10:13:18 +0200 Subject: [PATCH] fix issues --- tools/cd-hit/Snakefile | 23 +++++++++++++---------- tools/cd-hit/example_usage/Snakefile | 2 +- tools/cd-hit/example_usage/config.yaml | 5 +++-- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/tools/cd-hit/Snakefile b/tools/cd-hit/Snakefile index b91b63d..e023f86 100644 --- a/tools/cd-hit/Snakefile +++ b/tools/cd-hit/Snakefile @@ -85,22 +85,25 @@ Options "CD-HIT: accelerated for clustering the next generation sequencing data", Limin Fu, Beifang Niu, Zhengwei Zhu, Sitao Wu & Weizhong Li. Bioinformatics, (2012) 28:3150-3152 """ -__cd-hit_exec_command = config.get('cd-hit', {}).get('exec_command', 'cd-hit') -__cd-hit_modules = config.get('cd-hit', {}).get('modules') -__cd-hit_options = config.get('cd-hit', {}).get('options', '') +__cd_hit_exec_command = config.get('cd_hit', {}).get('exec_command', 'cd_hit') +__cd_hit_modules = config.get('cd_hit', {}).get('modules') +__cd_hit_options = config.get('cd_hit', {}).get('options', '') +__cd_hit_threads = config.get('cd_hit', {}).get('threads', 1) -rule cd-hit: +rule cd_hit: input: - __cd-hit_input + __cd_hit_input output: - __cd-hit_output + __cd_hit_output params: - exec_command = __cd-hit_exec_command, - modules = __cd-hit_modules, - options = __cd-hit_options + exec_command = __cd_hit_exec_command, + modules = __cd_hit_modules, + options = __cd_hit_options + threads: + __cd_hit_threads run: command = [] if params.modules: command.append("module load {params.modules}") - command.append("{params.exec_command} {params.options} -i {input} -o {output}") + command.append("{params.exec_command} {params.options} -i {input} -T {threads} -o {output}") shell(" && ".join(command)) diff --git a/tools/cd-hit/example_usage/Snakefile b/tools/cd-hit/example_usage/Snakefile index 0b0cb89..ebd2bfb 100644 --- a/tools/cd-hit/example_usage/Snakefile +++ b/tools/cd-hit/example_usage/Snakefile @@ -1,7 +1,7 @@ configfile: "config.yaml" # ==== Snakefile path ==== -__cd-hit_rules = config.get("snakefiles", {}).get("cd-hit") +__cd-hit_rules = config.get("snakefiles", {}).get("cd_hit") __main_output_dir = config.get('output_dir', 'output') diff --git a/tools/cd-hit/example_usage/config.yaml b/tools/cd-hit/example_usage/config.yaml index db42ab7..2bc908f 100644 --- a/tools/cd-hit/example_usage/config.yaml +++ b/tools/cd-hit/example_usage/config.yaml @@ -1,5 +1,5 @@ snakefiles: - prodigal: /pasteur/zeus/projets/p02/metasig/gitlab/snakemake/tools/cd-hit/Snakefile + cd_hit: /pasteur/zeus/projets/p02/metasig/gitlab/snakemake/tools/cd-hit/Snakefile input_dir: /some/input/directory output_dir: /some/output/directory @@ -9,6 +9,7 @@ samples: - test_00001 - test_00002 -prodigal: +cd_hit: exec_command: cd-hit modules: blast+/2.10.0 cd-hit + threads: 16 -- GitLab