From 0f30afbd6c49fa712a958df6c53bcddee49b5edd Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Thu, 27 Jul 2023 13:52:24 +0200 Subject: [PATCH] Fix centrifuge: reduce number of input channels (#3674) * Bump taxpasta version (biocontainer not yet available) * Remove unnecessary (and sometimes problematic) input channel * Improve output glob for optional alignments * Remove now unnecessary variable from command * linting * Add missing args --- modules/nf-core/centrifuge/centrifuge/main.nf | 5 +---- modules/nf-core/centrifuge/centrifuge/meta.yml | 9 +++++++-- tests/modules/nf-core/centrifuge/centrifuge/main.nf | 6 ++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/nf-core/centrifuge/centrifuge/main.nf b/modules/nf-core/centrifuge/centrifuge/main.nf index b43b0ee194f..6e45ba4e3f3 100644 --- a/modules/nf-core/centrifuge/centrifuge/main.nf +++ b/modules/nf-core/centrifuge/centrifuge/main.nf @@ -12,12 +12,11 @@ process CENTRIFUGE_CENTRIFUGE { path db val save_unaligned val save_aligned - val sam_format output: tuple val(meta), path('*report.txt') , emit: report tuple val(meta), path('*results.txt') , emit: results - tuple val(meta), path('*.sam') , optional: true, emit: sam + 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 @@ -38,7 +37,6 @@ process CENTRIFUGE_CENTRIFUGE { unaligned = save_unaligned ? "--un-conc-gz ${prefix}.unmapped.fastq.gz" : '' aligned = save_aligned ? "--al-conc-gz ${prefix}.mapped.fastq.gz" : '' } - def sam_output = sam_format ? "--out-fmt 'sam'" : '' """ ## we add "-no-name ._" to ensure silly Mac OSX metafiles files aren't included db_name=`find -L ${db} -name "*.1.cf" -not -name "._*" | sed 's/\\.1.cf\$//'` @@ -50,7 +48,6 @@ process CENTRIFUGE_CENTRIFUGE { -S ${prefix}.results.txt \\ $unaligned \\ $aligned \\ - $sam_output \\ $args cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/centrifuge/centrifuge/meta.yml b/modules/nf-core/centrifuge/centrifuge/meta.yml index a252c00c2ce..b51e2522206 100644 --- a/modules/nf-core/centrifuge/centrifuge/meta.yml +++ b/modules/nf-core/centrifuge/centrifuge/meta.yml @@ -27,10 +27,10 @@ input: type: directory description: Path to directory containing centrifuge database files - save_unaligned: - type: value + type: boolean description: If true unmapped fastq files are saved - save_aligned: - type: value + type: boolean description: If true mapped fastq files are saved output: - meta: @@ -48,6 +48,11 @@ output: 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 diff --git a/tests/modules/nf-core/centrifuge/centrifuge/main.nf b/tests/modules/nf-core/centrifuge/centrifuge/main.nf index ab91d9f001e..5d4eec15e22 100644 --- a/tests/modules/nf-core/centrifuge/centrifuge/main.nf +++ b/tests/modules/nf-core/centrifuge/centrifuge/main.nf @@ -12,10 +12,9 @@ workflow test_centrifuge_centrifuge_single_end { db = [ [], file('https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/minigut_cf.tar.gz', checkIfExists: true) ] save_unaligned = true save_aligned = false - sam_format = false UNTAR ( db ) - CENTRIFUGE_CENTRIFUGE ( input, UNTAR.out.untar.map{ it[1] }, save_unaligned, save_aligned, sam_format ) + CENTRIFUGE_CENTRIFUGE ( input, UNTAR.out.untar.map{ it[1] }, save_unaligned, save_aligned ) } @@ -27,10 +26,9 @@ workflow test_centrifuge_centrifuge_paired_end { db = [ [], file('https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/minigut_cf.tar.gz', checkIfExists: true) ] save_unaligned = true save_aligned = false - sam_format = false UNTAR ( db ) - CENTRIFUGE_CENTRIFUGE ( input, UNTAR.out.untar.map{ it[1] }, save_unaligned, save_aligned, sam_format ) + CENTRIFUGE_CENTRIFUGE ( input, UNTAR.out.untar.map{ it[1] }, save_unaligned, save_aligned ) }