From 0c96c3def7f3eba0c3c24009b371de72e3b6d1d9 Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Fri, 2 Feb 2024 13:19:10 +1100 Subject: [PATCH 1/7] Bump version number --- metaphor/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metaphor/__init__.py b/metaphor/__init__.py index 59b2527..de8b94c 100644 --- a/metaphor/__init__.py +++ b/metaphor/__init__.py @@ -2,7 +2,7 @@ __email__ = "17276653+vinisalazar@users.noreply.github.com" __license__ = "MIT" __copyright__ = "The University of Melbourne 2023" -__version__ = "1.7.10" +__version__ = "1.7.11" __doc__ = """ Metaphor top-level module. This is the entrypoint for the `cli`, `config`, and `workflow` packages. From eee8b01f8781f3f61631f41d4c42dfd7733c5247 Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Fri, 2 Feb 2024 13:19:41 +1100 Subject: [PATCH 2/7] Bump Pandas version --- metaphor/workflow/envs/python-utils.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metaphor/workflow/envs/python-utils.yaml b/metaphor/workflow/envs/python-utils.yaml index 33da6af..2fce9bd 100644 --- a/metaphor/workflow/envs/python-utils.yaml +++ b/metaphor/workflow/envs/python-utils.yaml @@ -4,7 +4,7 @@ channels: - bioconda dependencies: - biopython - - pandas>=2 + - pandas>=2.1 - python>=3.9 - seaborn - seqstats # This has to be here because assembly_report.py runs it from Python From 07578fd55e3fb95e0684bb18198046a830d6a4e2 Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Tue, 5 Mar 2024 09:53:40 +1100 Subject: [PATCH 3/7] Bump wrapper version --- metaphor/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metaphor/__init__.py b/metaphor/__init__.py index de8b94c..3f58b9f 100644 --- a/metaphor/__init__.py +++ b/metaphor/__init__.py @@ -13,7 +13,7 @@ # Snakemake wrapper version # This should match the latest released tag on: https://github.com/snakemake/snakemake-wrappers -wrapper_version = "v3.3.3" +wrapper_version = "v3.4.1" wrapper_prefix = "https://github.com/snakemake/snakemake-wrappers/raw/" github_url = "https://github.com/vinisalazar/metaphor" From f62fea5abe9ca32ba4221e6162852b512fb19561 Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Tue, 5 Mar 2024 09:55:46 +1100 Subject: [PATCH 4/7] Add resources directive to fastqc rules --- metaphor/workflow/rules/qc.smk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/metaphor/workflow/rules/qc.smk b/metaphor/workflow/rules/qc.smk index 55f988d..6230d5f 100644 --- a/metaphor/workflow/rules/qc.smk +++ b/metaphor/workflow/rules/qc.smk @@ -108,6 +108,8 @@ rule fastqc_raw: # qc on raw, unmerged reads html="output/qc/fastqc/{sample}-{unit}-{read}-raw.html", params: "--quiet", + resources: + mem_mb=10000 if get_max_mb(0.5) > 10000 else get_max_mb(0.5), wildcard_constraints: sample="|".join(sample_IDs), unit="|".join(unit_names), @@ -127,6 +129,8 @@ rule fastqc_trimmed: # qc on trimmed reads output: zip="output/qc/fastqc/{sample}-{unit}-{read}-trimmed_fastqc.zip", html="output/qc/fastqc/{sample}-{unit}-{read}-trimmed.html", + resources: + mem_mb=10000 if get_max_mb(0.5) > 10000 else get_max_mb(0.5), params: "--quiet", wildcard_constraints: @@ -151,6 +155,8 @@ rule fastqc_merged: # qc on trimmed, merged reads output: zip="output/qc/fastqc/{sample}-{read}-merged_fastqc.zip", html="output/qc/fastqc/{sample}-{read}-merged.html", + resources: + mem_mb=10000 if get_max_mb(0.5) > 10000 else get_max_mb(0.5), params: "--quiet", wildcard_constraints: From 05ecaf222ce05e0ef0e0b785090bdf2232d8b371 Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Tue, 5 Mar 2024 12:42:50 +1100 Subject: [PATCH 5/7] Fix function 'get_prokka_output' --- metaphor/workflow/rules/common.smk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metaphor/workflow/rules/common.smk b/metaphor/workflow/rules/common.smk index a3a287e..2285c11 100644 --- a/metaphor/workflow/rules/common.smk +++ b/metaphor/workflow/rules/common.smk @@ -496,7 +496,7 @@ def get_prokka_output(): bins_dict = {} for group in binning_group_names: bins_dict[group] = glob( - f"output/binning/DAS_tool/{group}/DAS_tool_DASTool_bins/*" + f"output/binning/DAS_tool/{group}/{group}_DASTool_bins/*" ) for group, list_of_bins in bins_dict.items(): From fb692802f4f91bf1b1be76f343df12ec5de6e9ba Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Tue, 5 Mar 2024 12:52:08 +1100 Subject: [PATCH 6/7] Improve for rule 'prokka' --- metaphor/workflow/rules/annotation.smk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metaphor/workflow/rules/annotation.smk b/metaphor/workflow/rules/annotation.smk index 749daa0..4e412fc 100644 --- a/metaphor/workflow/rules/annotation.smk +++ b/metaphor/workflow/rules/annotation.smk @@ -78,7 +78,6 @@ rule prokka: outfile="output/annotation/prokka/{binning_group}/{bin}/{bin}.fna", params: outdir=lambda w, output: str(Path(output.outfile).parent), - kingdom_cmd=lambda w, input: f"grep '{w.bin}' {input.bin_evals}", args=config["prokka"]["args"], wildcard_constraints: binning_group="|".join(binning_group_names), @@ -94,7 +93,8 @@ rule prokka: shell: """ # Get kingdom from bin eval file - kingdom=$({params.kingdom_cmd} | cut -f 5) + bin_clean=$(echo {wildcards.bin} | sed 's/_sub$//g') # Remove '_sub' from corrected bins + kingdom=$(grep $bin_clean {input.bin_evals} | cut -f 5) kingdom=$(echo $kingdom | head -c 1 | tr '[a-z]' '[A-Z]'; echo $kingdom | tail -c +2) prokka --outdir {params.outdir} \ From 2fce82e81a8c30c40df59a95d8d87f9df68c1333 Mon Sep 17 00:00:00 2001 From: Vini Salazar <17276653+vinisalazar@users.noreply.github.com> Date: Tue, 5 Mar 2024 13:28:57 +1100 Subject: [PATCH 7/7] Further improve Prokka command --- metaphor/workflow/rules/annotation.smk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/metaphor/workflow/rules/annotation.smk b/metaphor/workflow/rules/annotation.smk index 4e412fc..ca53811 100644 --- a/metaphor/workflow/rules/annotation.smk +++ b/metaphor/workflow/rules/annotation.smk @@ -78,7 +78,7 @@ rule prokka: outfile="output/annotation/prokka/{binning_group}/{bin}/{bin}.fna", params: outdir=lambda w, output: str(Path(output.outfile).parent), - args=config["prokka"]["args"], + args=config["prokka"]["args"] + " --centre X --compliant", wildcard_constraints: binning_group="|".join(binning_group_names), threads: get_threads_per_task_size("small") @@ -95,6 +95,7 @@ rule prokka: # Get kingdom from bin eval file bin_clean=$(echo {wildcards.bin} | sed 's/_sub$//g') # Remove '_sub' from corrected bins kingdom=$(grep $bin_clean {input.bin_evals} | cut -f 5) + kingdom=$(echo $kingdom | cut -f 1 -d ' ') kingdom=$(echo $kingdom | head -c 1 | tr '[a-z]' '[A-Z]'; echo $kingdom | tail -c +2) prokka --outdir {params.outdir} \