Skip to content
Open
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
26 changes: 7 additions & 19 deletions modules/nf-core/qcat/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ process QCAT {

input:
tuple val(meta), path(reads)
val barcode_kit
val barcode_kit

output:
tuple val(meta), path("fastq/*.fastq.gz"), emit: reads
path "versions.yml" , emit: versions
tuple val("${task.process}"), val('qcat'), eval("qcat --version | sed 's/.*qcat //;s/ .*//'"), emit: versions_qcat, topic: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -22,39 +22,27 @@ process QCAT {
"""
## Unzip fastq file
## qcat doesn't support zipped files yet
FILE=$reads
FILE=${reads}
if [[ \$FILE == *.gz ]]
then
zcat $reads > unzipped.fastq
zcat ${reads} > unzipped.fastq
FILE=unzipped.fastq
fi

qcat \\
-f \$FILE \\
-b ./fastq \\
--kit $barcode_kit
--kit ${barcode_kit}

## Zip fastq files
gzip fastq/*

cat <<-END_VERSIONS > versions.yml
"${task.process}":
qcat: \$(qcat --version | sed 's/^.*qcat //; s/ .*\$//')
END_VERSIONS
"""

stub:
"""
mkdir -p fastq

touch fastq/barcode00.fastq
touch fastq/none.fastq

gzip fastq/*

cat <<-END_VERSIONS > versions.yml
"${task.process}":
qcat: \$(qcat --version | sed 's/^.*qcat //; s/ .*\$//')
END_VERSIONS
echo "" | gzip > fastq/barcode00.fastq.gz
echo "" | gzip > fastq/none.fastq.gz
"""
}
31 changes: 24 additions & 7 deletions modules/nf-core/qcat/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ tools:
A demultiplexer for Nanopore samples
homepage: https://github.com/nanoporetech/qcat
documentation: https://github.com/nanoporetech/qcat#qcat
licence: ["MPL-2.0"]
licence:
- "MPL-2.0"
identifier: ""
input:
- - meta:
Expand Down Expand Up @@ -39,13 +40,29 @@ output:
pattern: "*.fastq.gz"
ontologies:
- edam: http://edamontology.org/format_3989 # GZIP format
versions_qcat:
- - ${task.process}:
type: string
description: The name of the process
- qcat:
type: string
description: The name of the tool
- qcat --version | sed 's/.*qcat //;s/ .*//':
type: eval
description: The expression to obtain the version of the tool

topics:
versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: http://edamontology.org/format_3750 # YAML
- - ${task.process}:
type: string
description: The name of the process
- qcat:
type: string
description: The name of the tool
- qcat --version | sed 's/.*qcat //;s/ .*//':
type: eval
description: The expression to obtain the version of the tool

authors:
- "@yuukiiwa"
- "@drpatelh"
Expand Down
16 changes: 4 additions & 12 deletions modules/nf-core/qcat/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ nextflow_process {
process {
"""
input[0] = [
[ id:'test' ], // meta map
[ id:'test' ],
[ file("https://github.com/nf-core/test-datasets/raw/nanoseq/fastq/nondemultiplexed/sample_nobc_dx.fastq.gz", checkIfExists: true) ]
]
input[1] = 'NBD103/NBD104'
Expand All @@ -27,38 +27,30 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.reads,
process.out.versions,
file(process.out.versions[0]).readLines()[1].trim() // trap to catch conda version mismatches
).match()
}
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}
}

test("test-qcat-stub") {
options '-stub'

when {
process {
"""
input[0] = [
[ id:'test' ], // meta map
[ id:'test' ],
[ file("https://github.com/nf-core/test-datasets/raw/nanoseq/fastq/nondemultiplexed/sample_nobc_dx.fastq.gz", checkIfExists: true) ]
]
input[1] = 'NBD103/NBD104'

"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}
}

}
71 changes: 33 additions & 38 deletions modules/nf-core/qcat/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,66 +1,61 @@
{
"test-qcat": {
"content": [
[
[
{
"id": "test"
},
{
"reads": [
[
{
"id": "test"
},
[
"barcode06.fastq.gz:md5,f02509a0edada5bde143a2155969eaaa",
"barcode12.fastq.gz:md5,e3dda1db83ad2895ff95b3612b9f4348",
"none.fastq.gz:md5,36ed3f5964a59532b75a7f0c5975ecc6"
]
]
],
"versions_qcat": [
[
"barcode06.fastq.gz:md5,f02509a0edada5bde143a2155969eaaa",
"barcode12.fastq.gz:md5,e3dda1db83ad2895ff95b3612b9f4348",
"none.fastq.gz:md5,36ed3f5964a59532b75a7f0c5975ecc6"
"QCAT",
"qcat",
"1.1.0"
]
]
],
[
"versions.yml:md5,78ca985d3d7741b521d87af6eb190f30"
],
"qcat: 1.1.0"
}
],
"timestamp": "2026-08-07T15:28:18.380966741",
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-29T12:36:04.213621"
"nf-test": "0.9.5",
"nextflow": "26.04.6"
}
},
"test-qcat-stub": {
"content": [
{
"0": [
"reads": [
[
{
"id": "test"
},
[
"barcode00.fastq.gz:md5,d41d8cd98f00b204e9800998ecf8427e",
"none.fastq.gz:md5,d41d8cd98f00b204e9800998ecf8427e"
"barcode00.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940",
"none.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
]
],
"1": [
"versions.yml:md5,78ca985d3d7741b521d87af6eb190f30"
],
"reads": [
"versions_qcat": [
[
{
"id": "test"
},
[
"barcode00.fastq.gz:md5,d41d8cd98f00b204e9800998ecf8427e",
"none.fastq.gz:md5,d41d8cd98f00b204e9800998ecf8427e"
]
"QCAT",
"qcat",
"1.1.0"
]
],
"versions": [
"versions.yml:md5,78ca985d3d7741b521d87af6eb190f30"
]
}
],
"timestamp": "2026-08-07T15:28:28.814302286",
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-29T12:34:55.736959"
"nf-test": "0.9.5",
"nextflow": "26.04.6"
}
}
}
Loading