From 9d9e4eda432f18d1b8175fb6116ec12b8eb213d7 Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Fri, 13 Sep 2024 16:08:39 +0200 Subject: [PATCH 1/2] Fix module failure when no bins --- modules.json | 2 +- modules/nf-core/gtdbtk/classifywf/main.nf | 55 +++++++++++------------ 2 files changed, 27 insertions(+), 30 deletions(-) diff --git a/modules.json b/modules.json index b17f7dc3..64207e26 100644 --- a/modules.json +++ b/modules.json @@ -124,7 +124,7 @@ }, "gtdbtk/classifywf": { "branch": "master", - "git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48", + "git_sha": "c44b5e99aea273adf455d8c40babeb3885083ff9", "installed_by": ["modules"] }, "gunc/downloaddb": { diff --git a/modules/nf-core/gtdbtk/classifywf/main.nf b/modules/nf-core/gtdbtk/classifywf/main.nf index 9fc7a32d..9aa13ee4 100644 --- a/modules/nf-core/gtdbtk/classifywf/main.nf +++ b/modules/nf-core/gtdbtk/classifywf/main.nf @@ -1,29 +1,25 @@ process GTDBTK_CLASSIFYWF { tag "${prefix}" label 'process_medium' - - // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gtdbtk:2.4.0--pyhdfd78af_1' : - 'biocontainers/gtdbtk:2.4.0--pyhdfd78af_1' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/gtdbtk:2.4.0--pyhdfd78af_1' : 'biocontainers/gtdbtk:2.4.0--pyhdfd78af_1'}" input: - tuple val(meta), path("bins/*") + tuple val(meta) , path("bins/*") tuple val(db_name), path("database/*") - path(mash_db) + path mash_db output: - tuple val(meta), path("gtdbtk.${prefix}.*.summary.tsv") , emit: summary - tuple val(meta), path("gtdbtk.${prefix}.*.classify.tree.gz") , emit: tree, optional: true - tuple val(meta), path("gtdbtk.${prefix}.*.markers_summary.tsv") , emit: markers, optional: true - tuple val(meta), path("gtdbtk.${prefix}.*.msa.fasta.gz") , emit: msa, optional: true - tuple val(meta), path("gtdbtk.${prefix}.*.user_msa.fasta.gz") , emit: user_msa, optional: true - tuple val(meta), path("gtdbtk.${prefix}.*.filtered.tsv") , emit: filtered, optional: true - tuple val(meta), path("gtdbtk.${prefix}.failed_genomes.tsv") , emit: failed, optional: true - tuple val(meta), path("gtdbtk.${prefix}.log") , emit: log - tuple val(meta), path("gtdbtk.${prefix}.warnings.log") , emit: warnings - path("versions.yml") , emit: versions + tuple val(meta), path("gtdbtk.${prefix}.*.summary.tsv") , emit: summary + tuple val(meta), path("gtdbtk.${prefix}.*.classify.tree.gz") , emit: tree , optional: true + tuple val(meta), path("gtdbtk.${prefix}.*.markers_summary.tsv"), emit: markers , optional: true + tuple val(meta), path("gtdbtk.${prefix}.*.msa.fasta.gz") , emit: msa , optional: true + tuple val(meta), path("gtdbtk.${prefix}.*.user_msa.fasta.gz") , emit: user_msa, optional: true + tuple val(meta), path("gtdbtk.${prefix}.*.filtered.tsv") , emit: filtered, optional: true + tuple val(meta), path("gtdbtk.${prefix}.failed_genomes.tsv") , emit: failed , optional: true + tuple val(meta), path("gtdbtk.${prefix}.log") , emit: log + tuple val(meta), path("gtdbtk.${prefix}.warnings.log") , emit: warnings + path ("versions.yml"), emit: versions when: task.ext.when == null || task.ext.when @@ -31,7 +27,7 @@ process GTDBTK_CLASSIFYWF { script: def args = task.ext.args ?: '' def pplacer_scratch = params.gtdbtk_pplacer_scratch ? "--scratch_dir pplacer_tmp" : "" - def mash_mode = mash_db ? "--mash_db ${mash_db}" : "--skip_ani_screen" + def mash_mode = mash_db ? "--mash_db ${mash_db}" : "--skip_ani_screen" prefix = task.ext.prefix ?: "${meta.id}" """ @@ -41,27 +37,27 @@ process GTDBTK_CLASSIFYWF { fi gtdbtk classify_wf \\ - $args \\ + ${args} \\ --genome_dir bins \\ --prefix "gtdbtk.${prefix}" \\ --out_dir "\${PWD}" \\ - --cpus $task.cpus \\ - $mash_mode \\ - $pplacer_scratch \\ - --min_perc_aa $params.gtdbtk_min_perc_aa \\ - --min_af $params.gtdbtk_min_af + --cpus ${task.cpus} \\ + ${mash_mode} \\ + ${pplacer_scratch} \\ + --min_perc_aa ${params.gtdbtk_min_perc_aa} \\ + --min_af ${params.gtdbtk_min_af} ## If mash db given, classify/ and identify/ directories won't be created - if [[ -d classify/ ]]; then + if [[ -d classify/ && \$(ls -A classify/) ]]; then mv classify/* . fi - if [[ -d identify/ ]]; then + if [[ -d identify/ && \$(ls -A identify/) ]]; then mv identify/* . fi ## If nothing aligns, no output, so only run - if [[ -d align/ ]]; then + if [[ -d align/ && \$(ls -A align/) ]]; then mv align/* . fi @@ -78,7 +74,8 @@ process GTDBTK_CLASSIFYWF { """ stub: - def VERSION = '2.3.2' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def VERSION = '2.3.2' + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. prefix = task.ext.prefix ?: "${meta.id}" """ touch gtdbtk.${prefix}.stub.summary.tsv @@ -93,7 +90,7 @@ process GTDBTK_CLASSIFYWF { cat <<-END_VERSIONS > versions.yml "${task.process}": - gtdbtk: \$(echo "$VERSION") + gtdbtk: \$(echo "${VERSION}") END_VERSIONS """ } From a60f2e7a9b86dfc31b9bbfcf9154649c19ea6c52 Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Mon, 16 Sep 2024 13:07:36 +0200 Subject: [PATCH 2/2] Address comments via ofifical module update --- modules.json | 2 +- modules/nf-core/gtdbtk/classifywf/main.nf | 4 +--- modules/nf-core/gtdbtk/classifywf/tests/main.nf.test.snap | 8 ++++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/modules.json b/modules.json index 64207e26..be1b1dd3 100644 --- a/modules.json +++ b/modules.json @@ -124,7 +124,7 @@ }, "gtdbtk/classifywf": { "branch": "master", - "git_sha": "c44b5e99aea273adf455d8c40babeb3885083ff9", + "git_sha": "3fb6803fd1cf5a63998216f4254d6d4e487fab21", "installed_by": ["modules"] }, "gunc/downloaddb": { diff --git a/modules/nf-core/gtdbtk/classifywf/main.nf b/modules/nf-core/gtdbtk/classifywf/main.nf index 9aa13ee4..f0944fdc 100644 --- a/modules/nf-core/gtdbtk/classifywf/main.nf +++ b/modules/nf-core/gtdbtk/classifywf/main.nf @@ -74,8 +74,6 @@ process GTDBTK_CLASSIFYWF { """ stub: - def VERSION = '2.3.2' - // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. prefix = task.ext.prefix ?: "${meta.id}" """ touch gtdbtk.${prefix}.stub.summary.tsv @@ -90,7 +88,7 @@ process GTDBTK_CLASSIFYWF { cat <<-END_VERSIONS > versions.yml "${task.process}": - gtdbtk: \$(echo "${VERSION}") + gtdbtk: \$(echo \$(gtdbtk --version -v 2>&1) | sed "s/gtdbtk: version //; s/ Copyright.*//") END_VERSIONS """ } diff --git a/modules/nf-core/gtdbtk/classifywf/tests/main.nf.test.snap b/modules/nf-core/gtdbtk/classifywf/tests/main.nf.test.snap index e821084c..eb0ee89a 100644 --- a/modules/nf-core/gtdbtk/classifywf/tests/main.nf.test.snap +++ b/modules/nf-core/gtdbtk/classifywf/tests/main.nf.test.snap @@ -93,7 +93,7 @@ ] ], "9": [ - "versions.yml:md5,a8ab755bce9f17684f235d49ab99f6d2" + "versions.yml:md5,2c94de2b8633b99e11881ab0193835d7" ], "failed": [ [ @@ -176,7 +176,7 @@ ] ], "versions": [ - "versions.yml:md5,a8ab755bce9f17684f235d49ab99f6d2" + "versions.yml:md5,2c94de2b8633b99e11881ab0193835d7" ], "warnings": [ [ @@ -192,8 +192,8 @@ ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.4" }, - "timestamp": "2024-03-26T09:39:21.632259941" + "timestamp": "2024-09-16T11:46:32.337929018" } } \ No newline at end of file