Skip to content

Commit fbcb1dd

Browse files
authored
Update to topics bowtie/* (#11185)
* Update to topics * Update test * Add comment
1 parent 4e03bf6 commit fbcb1dd

8 files changed

Lines changed: 250 additions & 212 deletions

File tree

modules/nf-core/bowtie/align/main.nf

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ process BOWTIE_ALIGN {
1616
tuple val(meta), path('*.bam') , emit: bam
1717
tuple val(meta), path('*.out') , emit: log
1818
tuple val(meta), path('*fastq.gz') , emit: fastq, optional : true
19-
path "versions.yml" , emit: versions
19+
tuple val("${task.process}"), val('bowtie'), eval("bowtie --version 2>&1 | sed -n 's/.*bowtie-align-s version //p'"), emit: versions_bowtie, topic: versions
20+
tuple val("${task.process}"), val('samtools'), eval("samtools version | sed '1!d;s/.* //'"), emit: versions_samtools, topic: versions
21+
tuple val("${task.process}"), val('gzip'), eval("gzip --version 2>&1 | sed '1!d;s/gzip //'"), emit: versions_gzip, topic: versions
2022

2123
when:
2224
task.ext.when == null || task.ext.when
@@ -48,31 +50,18 @@ process BOWTIE_ALIGN {
4850
gzip ${prefix}.unmapped_1.fastq
4951
gzip ${prefix}.unmapped_2.fastq
5052
fi
51-
52-
cat <<-END_VERSIONS > versions.yml
53-
"${task.process}":
54-
bowtie: \$(echo \$(bowtie --version 2>&1) | sed 's/^.*bowtie-align-s version //; s/ .*\$//')
55-
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
56-
END_VERSIONS
5753
"""
5854

5955
stub:
6056
def prefix = task.ext.prefix ?: "${meta.id}"
6157
def unaligned = save_unaligned ?
62-
meta.single_end ? "echo '' | gzip > ${prefix}.unmapped.fastq.gz" :
63-
"echo '' | gzip > ${prefix}.unmapped_1.fastq.gz; echo '' | gzip > ${prefix}.unmapped_2.fastq.gz"
64-
: ''
58+
meta.single_end ? "echo '' | gzip > ${prefix}.unmapped.fastq.gz" :
59+
"echo '' | gzip > ${prefix}.unmapped_1.fastq.gz; echo '' | gzip > ${prefix}.unmapped_2.fastq.gz" :
60+
''
6561
"""
6662
touch ${prefix}.bam
6763
touch ${prefix}.out
6864
$unaligned
69-
70-
cat <<-END_VERSIONS > versions.yml
71-
"${task.process}":
72-
bowtie: \$(echo \$(bowtie --version 2>&1) | sed 's/^.*bowtie-align-s version //; s/ .*\$//')
73-
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
74-
END_VERSIONS
7565
"""
7666

77-
7867
}

modules/nf-core/bowtie/align/meta.yml

Lines changed: 63 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ tools:
1515
homepage: http://bowtie-bio.sourceforge.net/index.shtml
1616
documentation: http://bowtie-bio.sourceforge.net/manual.shtml
1717
arxiv: arXiv:1303.3997
18-
licence: ["Artistic-2.0"]
18+
licence:
19+
- "Artistic-2.0"
1920
identifier: biotools:bowtie
2021
input:
2122
- - meta:
@@ -41,7 +42,8 @@ input:
4142
ontologies: []
4243
- save_unaligned:
4344
type: boolean
44-
description: Whether to save fastq files containing the reads which did not align.
45+
description: Whether to save fastq files containing the reads which did not
46+
align.
4547
output:
4648
bam:
4749
- - meta:
@@ -70,14 +72,66 @@ output:
7072
description: Unaligned FastQ files
7173
pattern: "*.fastq.gz"
7274
ontologies:
73-
- edam: http://edamontology.org/format_3989 # GZIP format
75+
- edam: http://edamontology.org/format_3989 # GZIP
76+
versions_bowtie:
77+
- - ${task.process}:
78+
type: string
79+
description: The name of the process
80+
- bowtie:
81+
type: string
82+
description: The name of the tool
83+
- bowtie --version 2>&1 | sed -n 's/.*bowtie-align-s version //p':
84+
type: eval
85+
description: The expression to obtain the version of the tool
86+
versions_samtools:
87+
- - ${task.process}:
88+
type: string
89+
description: The name of the process
90+
- samtools:
91+
type: string
92+
description: The name of the tool
93+
- samtools version | sed '1!d;s/.* //':
94+
type: eval
95+
description: The expression to obtain the version of the tool
96+
versions_gzip:
97+
- - ${task.process}:
98+
type: string
99+
description: The name of the process
100+
- gzip:
101+
type: string
102+
description: The name of the tool
103+
- gzip --version 2>&1 | sed '1!d;s/gzip //':
104+
type: eval
105+
description: The expression to obtain the version of the tool
106+
topics:
74107
versions:
75-
- versions.yml:
76-
type: file
77-
description: File containing software versions
78-
pattern: "versions.yml"
79-
ontologies:
80-
- edam: http://edamontology.org/format_3750 # YAML
108+
- - ${task.process}:
109+
type: string
110+
description: The name of the process
111+
- bowtie:
112+
type: string
113+
description: The name of the tool
114+
- bowtie --version 2>&1 | sed -n 's/.*bowtie-align-s version //p':
115+
type: eval
116+
description: The expression to obtain the version of the tool
117+
- - ${task.process}:
118+
type: string
119+
description: The name of the process
120+
- samtools:
121+
type: string
122+
description: The name of the tool
123+
- samtools version | sed '1!d;s/.* //':
124+
type: eval
125+
description: The expression to obtain the version of the tool
126+
- - ${task.process}:
127+
type: string
128+
description: The name of the process
129+
- gzip:
130+
type: string
131+
description: The name of the tool
132+
- gzip --version 2>&1 | sed '1!d;s/gzip //':
133+
type: eval
134+
description: The expression to obtain the version of the tool
81135
authors:
82136
- "@kevinmenden"
83137
maintainers:

modules/nf-core/bowtie/align/tests/main.nf.test

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ nextflow_process {
1616
script "../../../bowtie/build/main.nf"
1717
process {
1818
"""
19-
input[0] = [[ id:'sarscov2' ],
20-
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ]
19+
input[0] = [
20+
[ id:'sarscov2' ],
21+
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
22+
]
2123
"""
2224
}
2325
}
@@ -28,9 +30,10 @@ nextflow_process {
2830
when {
2931
process {
3032
"""
31-
input[0] = [ [id:"test", single_end:true],
33+
input[0] = [
34+
[id:"test", single_end:true],
3235
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)
33-
]
36+
]
3437
input[1] = BOWTIE_BUILD.out.index
3538
input[2] = true
3639
"""
@@ -40,11 +43,12 @@ nextflow_process {
4043
then {
4144
assertAll(
4245
{ assert process.success },
43-
{ assert snapshot(process.out.versions,
44-
process.out.bam.collect { bam(it[1]).getReadsMD5() },
45-
process.out.fastq,
46-
process.out.log
47-
).match() }
46+
{ assert snapshot(
47+
process.out.bam.collect { bam(it[1]).getReadsMD5() },
48+
process.out.fastq,
49+
process.out.log,
50+
process.out.findAll { key, val -> key.startsWith('versions') }
51+
).match() }
4852
)
4953
}
5054

@@ -57,9 +61,10 @@ nextflow_process {
5761
when {
5862
process {
5963
"""
60-
input[0] = [ [id:"test", single_end:true],
64+
input[0] = [
65+
[id:"test", single_end:true],
6166
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)
62-
]
67+
]
6368
input[1] = BOWTIE_BUILD.out.index
6469
input[2] = true
6570
"""
@@ -69,7 +74,7 @@ nextflow_process {
6974
then {
7075
assertAll(
7176
{ assert process.success },
72-
{ assert snapshot(process.out).match() }
77+
{ assert snapshot(sanitizeOutput(process.out)).match() }
7378
)
7479
}
7580

@@ -80,10 +85,11 @@ nextflow_process {
8085
when {
8186
process {
8287
"""
83-
input[0] = [ [id:"test", single_end:false],
88+
input[0] = [
89+
[id:"test", single_end:false],
8490
[file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
8591
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)]
86-
]
92+
]
8793
input[1] = BOWTIE_BUILD.out.index
8894
input[2] = false
8995
"""
@@ -93,10 +99,11 @@ nextflow_process {
9399
then {
94100
assertAll(
95101
{ assert process.success },
96-
{ assert snapshot(process.out.versions,
97-
process.out.bam.collect { bam(it[1]).getReads(2) },
98-
process.out.log
99-
).match() }
102+
{ assert snapshot(
103+
process.out.bam.collect { bam(it[1]).getReads(2) }, // Unstable BAM output, so only check the first 2 reads
104+
process.out.log,
105+
process.out.findAll { key, val -> key.startsWith('versions') },
106+
).match() }
100107
)
101108
}
102109

@@ -108,9 +115,10 @@ nextflow_process {
108115
when {
109116
process {
110117
"""
111-
input[0] = [ [id:"test", single_end:false],
118+
input[0] = [
119+
[id:"test", single_end:false],
112120
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)
113-
]
121+
]
114122
input[1] = BOWTIE_BUILD.out.index
115123
input[2] = false
116124
"""
@@ -120,7 +128,7 @@ nextflow_process {
120128
then {
121129
assertAll(
122130
{ assert process.success },
123-
{ assert snapshot(process.out).match() }
131+
{ assert snapshot(sanitizeOutput(process.out)).match() }
124132
)
125133
}
126134

0 commit comments

Comments
 (0)