Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix centrifuge: reduce number of input channels #3674

Merged
merged 8 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions modules/nf-core/centrifuge/centrifuge/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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\$//'`
Expand All @@ -50,7 +48,6 @@ process CENTRIFUGE_CENTRIFUGE {
-S ${prefix}.results.txt \\
$unaligned \\
$aligned \\
$sam_output \\
$args

cat <<-END_VERSIONS > versions.yml
Expand Down
9 changes: 7 additions & 2 deletions modules/nf-core/centrifuge/centrifuge/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
6 changes: 2 additions & 4 deletions tests/modules/nf-core/centrifuge/centrifuge/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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 )

}

Expand All @@ -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 )


}