From 4946d78d25d9bd90130959b5373547d84bf75024 Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Thu, 19 Dec 2024 13:09:50 +0100 Subject: [PATCH] Update centrifuge to fix CONDA bug --- CHANGELOG.md | 8 ++ modules.json | 4 +- .../centrifuge/centrifuge/environment.yml | 3 +- modules/nf-core/centrifuge/centrifuge/main.nf | 42 ++++--- .../nf-core/centrifuge/centrifuge/meta.yml | 119 +++++++++++------- .../centrifuge/kreport/environment.yml | 3 +- modules/nf-core/centrifuge/kreport/main.nf | 17 +-- modules/nf-core/centrifuge/kreport/meta.yml | 55 ++++---- 8 files changed, 148 insertions(+), 103 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c93c5bf8..e5958bfd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,10 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### `Added` +- [#558](https://github.com/nf-core/taxprofiler/pull/558) Updated to nf-core pipeline template v3.1.0 (added by @LilyAnderssonLee) + ### `Fixed` +- [#561](https://github.com/nf-core/taxprofiler/pull/561) Updated Centrifuge to fix internal error when running with conda (❤️ to @AnotherSimon for reporting, fix by @jfy133) + ### `Dependencies` +| Tool | Previous version | New version | +| ---------- | ---------------- | ----------- | +| centrifuge | 1.0.4.1 | 1.0.4.1 | + ### `Deprecated` ## v1.2.1 - Bouncy Basenji Patch [2024-11-28] diff --git a/modules.json b/modules.json index 1db09a2d..68ca8816 100644 --- a/modules.json +++ b/modules.json @@ -42,12 +42,12 @@ }, "centrifuge/centrifuge": { "branch": "master", - "git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48", + "git_sha": "8581a564b0acbe28e222570ce395278f91705dc5", "installed_by": ["modules"] }, "centrifuge/kreport": { "branch": "master", - "git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48", + "git_sha": "8581a564b0acbe28e222570ce395278f91705dc5", "installed_by": ["modules"] }, "diamond/blastx": { diff --git a/modules/nf-core/centrifuge/centrifuge/environment.yml b/modules/nf-core/centrifuge/centrifuge/environment.yml index 42592891..b49177e9 100644 --- a/modules/nf-core/centrifuge/centrifuge/environment.yml +++ b/modules/nf-core/centrifuge/centrifuge/environment.yml @@ -1,5 +1,6 @@ channels: - conda-forge - bioconda + dependencies: - - bioconda::centrifuge=1.0.4.1 + - bioconda::centrifuge=1.0.4.2 diff --git a/modules/nf-core/centrifuge/centrifuge/main.nf b/modules/nf-core/centrifuge/centrifuge/main.nf index d9a5653d..f287dc25 100644 --- a/modules/nf-core/centrifuge/centrifuge/main.nf +++ b/modules/nf-core/centrifuge/centrifuge/main.nf @@ -1,11 +1,11 @@ process CENTRIFUGE_CENTRIFUGE { - tag "$meta.id" + tag "${meta.id}" label 'process_high' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/centrifuge:1.0.4.1--hdcf5f25_1' : - 'biocontainers/centrifuge:1.0.4.1--hdcf5f25_1' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/centrifuge:1.0.4.2--hdcf5f25_0' + : 'biocontainers/centrifuge:1.0.4.2--hdcf5f25_0'}" input: tuple val(meta), path(reads) @@ -14,12 +14,12 @@ process CENTRIFUGE_CENTRIFUGE { val save_aligned output: - tuple val(meta), path('*report.txt') , emit: report - tuple val(meta), path('*results.txt') , emit: results - tuple val(meta), path('*.{sam,tab}') , optional: true, emit: sam - tuple val(meta), path('*.mapped.fastq{,.1,.2}.gz') , optional: true, emit: fastq_mapped - tuple val(meta), path('*.unmapped.fastq{,.1,.2}.gz') , optional: true, emit: fastq_unmapped - path "versions.yml" , emit: versions + tuple val(meta), path('*report.txt'), emit: report + tuple val(meta), path('*results.txt'), emit: results + tuple val(meta), path('*.{sam,tab}'), optional: true, emit: sam + tuple val(meta), path('*.mapped.fastq{,.1,.2}.gz'), optional: true, emit: fastq_mapped + tuple val(meta), path('*.unmapped.fastq{,.1,.2}.gz'), optional: true, emit: fastq_unmapped + path "versions.yml", emit: versions when: task.ext.when == null || task.ext.when @@ -27,13 +27,14 @@ process CENTRIFUGE_CENTRIFUGE { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def paired = meta.single_end ? "-U ${reads}" : "-1 ${reads[0]} -2 ${reads[1]}" + def paired = meta.single_end ? "-U ${reads}" : "-1 ${reads[0]} -2 ${reads[1]}" def unaligned = '' def aligned = '' if (meta.single_end) { unaligned = save_unaligned ? "--un-gz ${prefix}.unmapped.fastq.gz" : '' aligned = save_aligned ? "--al-gz ${prefix}.mapped.fastq.gz" : '' - } else { + } + else { unaligned = save_unaligned ? "--un-conc-gz ${prefix}.unmapped.fastq.gz" : '' aligned = save_aligned ? "--al-conc-gz ${prefix}.mapped.fastq.gz" : '' } @@ -49,13 +50,13 @@ process CENTRIFUGE_CENTRIFUGE { centrifuge \\ -x \$db_name \\ --temp-directory ./temp \\ - -p $task.cpus \\ - $paired \\ + -p ${task.cpus} \\ + ${paired} \\ --report-file ${prefix}.report.txt \\ -S ${prefix}.results.txt \\ - $unaligned \\ - $aligned \\ - $args + ${unaligned} \\ + ${aligned} \\ + ${args} cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -64,15 +65,16 @@ process CENTRIFUGE_CENTRIFUGE { """ stub: - def args = task.ext.args ?: '' + def _args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def paired = meta.single_end ? "-U ${reads}" : "-1 ${reads[0]} -2 ${reads[1]}" + def _paired = meta.single_end ? "-U ${reads}" : "-1 ${reads[0]} -2 ${reads[1]}" def unaligned = '' def aligned = '' if (meta.single_end) { unaligned = save_unaligned ? "--un-gz ${prefix}.unmapped.fastq.gz" : '' aligned = save_aligned ? "--al-gz ${prefix}.mapped.fastq.gz" : '' - } else { + } + else { unaligned = save_unaligned ? "--un-conc-gz ${prefix}.unmapped.fastq.gz" : '' aligned = save_aligned ? "--al-conc-gz ${prefix}.mapped.fastq.gz" : '' } diff --git a/modules/nf-core/centrifuge/centrifuge/meta.yml b/modules/nf-core/centrifuge/centrifuge/meta.yml index a06104e1..17329e93 100644 --- a/modules/nf-core/centrifuge/centrifuge/meta.yml +++ b/modules/nf-core/centrifuge/centrifuge/meta.yml @@ -12,59 +12,86 @@ tools: documentation: https://ccb.jhu.edu/software/centrifuge/manual.shtml doi: 10.1101/gr.210641.116 licence: ["GPL v3"] + identifier: biotools:centrifuge input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - reads: - type: file - description: | - List of input FastQ files of size 1 and 2 for single-end and paired-end data, - respectively. - - db: - type: directory - description: Path to directory containing centrifuge database files - - save_unaligned: - type: boolean - description: If true unmapped fastq files are saved - - save_aligned: - type: boolean - description: If true mapped fastq files are saved + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: | + List of input FastQ files of size 1 and 2 for single-end and paired-end data, + respectively. + - - db: + type: directory + description: Path to directory containing centrifuge database files + - - save_unaligned: + type: boolean + description: If true unmapped fastq files are saved + - - save_aligned: + type: boolean + description: If true mapped fastq files are saved output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - report: - type: file - description: | - File containing a classification summary - pattern: "*.{report.txt}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*report.txt": + type: file + description: | + File containing a classification summary + pattern: "*.{report.txt}" - results: - type: file - description: | - File containing classification results - pattern: "*.{results.txt}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*results.txt": + type: file + description: | + File containing classification results + pattern: "*.{results.txt}" - sam: - type: file - description: | - Optional output file containing read alignments (SAM format )or a table of per-read hit information (TAB)s - pattern: "*.{sam,tab}" - - fastq_unmapped: - type: file - description: Unmapped fastq files - pattern: "*.unmapped.fastq.gz" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.{sam,tab}": + type: file + description: | + Optional output file containing read alignments (SAM format )or a table of per-read hit information (TAB)s + pattern: "*.{sam,tab}" - fastq_mapped: - type: file - description: Mapped fastq files - pattern: "*.mapped.fastq.gz" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.mapped.fastq{,.1,.2}.gz": + type: file + description: Mapped fastq files + pattern: "*.mapped.fastq.gz" + - fastq_unmapped: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.unmapped.fastq{,.1,.2}.gz": + type: file + description: Unmapped fastq files + pattern: "*.unmapped.fastq.gz" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@sofstam" - "@jfy133" diff --git a/modules/nf-core/centrifuge/kreport/environment.yml b/modules/nf-core/centrifuge/kreport/environment.yml index 42592891..b49177e9 100644 --- a/modules/nf-core/centrifuge/kreport/environment.yml +++ b/modules/nf-core/centrifuge/kreport/environment.yml @@ -1,5 +1,6 @@ channels: - conda-forge - bioconda + dependencies: - - bioconda::centrifuge=1.0.4.1 + - bioconda::centrifuge=1.0.4.2 diff --git a/modules/nf-core/centrifuge/kreport/main.nf b/modules/nf-core/centrifuge/kreport/main.nf index 25eb7167..b7e83604 100644 --- a/modules/nf-core/centrifuge/kreport/main.nf +++ b/modules/nf-core/centrifuge/kreport/main.nf @@ -1,11 +1,11 @@ process CENTRIFUGE_KREPORT { - tag "$meta.id" + tag "${meta.id}" label 'process_single' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/centrifuge:1.0.4.1--hdcf5f25_1' : - 'biocontainers/centrifuge:1.0.4.1--hdcf5f25_1' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/centrifuge:1.0.4.2--hdcf5f25_0' + : 'biocontainers/centrifuge:1.0.4.2--hdcf5f25_0'}" input: tuple val(meta), path(report) @@ -13,7 +13,7 @@ process CENTRIFUGE_KREPORT { output: tuple val(meta), path('*.txt'), emit: kreport - path "versions.yml" , emit: versions + path "versions.yml", emit: versions when: task.ext.when == null || task.ext.when @@ -23,7 +23,10 @@ process CENTRIFUGE_KREPORT { def prefix = task.ext.prefix ?: "${meta.id}" """ db_name=`find -L ${db} -name "*.1.cf" -not -name "._*" | sed 's/\\.1.cf\$//'` - centrifuge-kreport -x \$db_name ${report} > ${prefix}.txt + centrifuge-kreport \\ + ${args} \\ + -x \$db_name \\ + ${report} > ${prefix}.txt cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -32,7 +35,7 @@ process CENTRIFUGE_KREPORT { """ stub: - def args = task.ext.args ?: '' + def _args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" """ touch ${prefix}.txt diff --git a/modules/nf-core/centrifuge/kreport/meta.yml b/modules/nf-core/centrifuge/kreport/meta.yml index 5641152b..e195eebf 100644 --- a/modules/nf-core/centrifuge/kreport/meta.yml +++ b/modules/nf-core/centrifuge/kreport/meta.yml @@ -14,35 +14,38 @@ tools: documentation: https://ccb.jhu.edu/software/centrifuge/manual.shtml doi: 10.1101/gr.210641.116 licence: ["GPL v3"] + identifier: biotools:centrifuge input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - report: - type: file - description: File containing the centrifuge classification report - pattern: "*.{txt}" - - db: - type: directory - description: Path to directory containing centrifuge database files + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - report: + type: file + description: File containing the centrifuge classification report + pattern: "*.{txt}" + - - db: + type: directory + description: Path to directory containing centrifuge database files output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - kreport: - type: file - description: | - File containing kraken-style report from centrifuge - out files. - pattern: "*.{txt}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.txt": + type: file + description: | + File containing kraken-style report from centrifuge + out files. + pattern: "*.{txt}" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@sofstam" - "@jfy133"