Skip to content

Commit 99fe1cc

Browse files
kornkvSPPearcevagkaratzas
authored
Add new module: seqfu/check (#9283)
* Add new module: seqfu/check * Update modules/nf-core/seqfu/check/main.nf Co-authored-by: Simon Pearce <[email protected]> * Update modules/nf-core/seqfu/check/main.nf Co-authored-by: Simon Pearce <[email protected]> * Update modules/nf-core/seqfu/check/main.nf Co-authored-by: Simon Pearce <[email protected]> * Update modules/nf-core/seqfu/check/main.nf Co-authored-by: Simon Pearce <[email protected]> * Update modules/nf-core/seqfu/check/main.nf Co-authored-by: Simon Pearce <[email protected]> * Update modules/nf-core/seqfu/check/main.nf Co-authored-by: Simon Pearce <[email protected]> * Update modules/nf-core/seqfu/check/main.nf Co-authored-by: Simon Pearce <[email protected]> * Update modules/nf-core/seqfu/check/tests/main.nf.test Co-authored-by: Evangelos Karatzas <[email protected]> * Update modules/nf-core/seqfu/check/tests/main.nf.test Co-authored-by: Evangelos Karatzas <[email protected]> * Update modules/nf-core/seqfu/check/main.nf Co-authored-by: Evangelos Karatzas <[email protected]> * Fix review comments in seqfu/check (main.nf, meta.yml, tests) * Update modules/nf-core/seqfu/check/tests/main.nf.test Co-authored-by: Evangelos Karatzas <[email protected]> * Update modules/nf-core/seqfu/check/tests/main.nf.test Co-authored-by: Evangelos Karatzas <[email protected]> * New test.snap after review --------- Co-authored-by: Simon Pearce <[email protected]> Co-authored-by: Evangelos Karatzas <[email protected]>
1 parent 208c242 commit 99fe1cc

File tree

5 files changed

+382
-0
lines changed

5 files changed

+382
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
3+
channels:
4+
- conda-forge
5+
- bioconda
6+
dependencies:
7+
- bioconda::seqfu=1.22.3
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
process SEQFU_CHECK {
2+
tag "$meta.id"
3+
label 'process_low'
4+
5+
conda "${moduleDir}/environment.yml"
6+
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
7+
'https://depot.galaxyproject.org/singularity/seqfu:1.22.3--hc29b5fc_1':
8+
'biocontainers/seqfu:1.22.3--hc29b5fc_1' }"
9+
10+
input:
11+
tuple val(meta), path(reads)
12+
13+
output:
14+
tuple val(meta), path("${prefix}.tsv"), emit: check
15+
path "versions.yml" , emit: versions
16+
17+
when:
18+
task.ext.when == null || task.ext.when
19+
20+
script:
21+
def args = task.ext.args ?: ''
22+
prefix = task.ext.prefix ?: "${meta.id}"
23+
24+
def dirFlag = (reads instanceof List ? reads.every { it.isDirectory() } : reads.isDirectory()) ? "--dir" : ""
25+
26+
"""
27+
seqfu \\
28+
check \\
29+
${args} \\
30+
${dirFlag} ${reads} > ${prefix}.tsv
31+
32+
cat <<-END_VERSIONS > versions.yml
33+
"${task.process}":
34+
seqfu: \$(seqfu --version)
35+
END_VERSIONS
36+
"""
37+
38+
stub:
39+
def args = task.ext.args ?: ''
40+
prefix = task.ext.prefix ?: "${meta.id}"
41+
"""
42+
echo $args
43+
44+
touch ${prefix}.tsv
45+
46+
cat <<-END_VERSIONS > versions.yml
47+
"${task.process}":
48+
seqfu: \$(seqfu --version)
49+
END_VERSIONS
50+
"""
51+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: "seqfu_check"
2+
description: Evaluates the integrity of DNA FASTQ files
3+
keywords:
4+
- check
5+
- seqfu
6+
- fastq
7+
tools:
8+
- "seqfu":
9+
description: "A general-purpose program to manipulate and parse information from FASTQ files"
10+
homepage: https://telatin.github.io/seqfu2/
11+
documentation: https://telatin.github.io/seqfu2/tools/check.html#usage
12+
tool_dev_url: https://github.com/telatin/seqfu2
13+
doi: "10.3390/bioengineering8050059"
14+
licence: ["MIT"]
15+
identifier: biotools:seqfu
16+
17+
input:
18+
- - meta:
19+
type: map
20+
description: Groovy Map containing sample information. e.g. `[
21+
id:'sample1' ]`
22+
- reads:
23+
type: file
24+
description: Either fastq file(s) or directory containing fastq files to be checked
25+
pattern: "*.{fq,fastq}[.gz]"
26+
ontologies:
27+
- edam: http://edamontology.org/format_1931 # FASTQ-illumina format
28+
29+
output:
30+
check:
31+
- - meta:
32+
type: map
33+
description: Groovy Map containing sample information. e.g. `[
34+
id:'sample1' ]`
35+
- "${prefix}.tsv":
36+
type: file
37+
description: >
38+
Tab-separated output file with basic sequence statistics.
39+
pattern: "*.tsv"
40+
ontologies:
41+
- edam: http://edamontology.org/format_3475 # TSV
42+
versions:
43+
- versions.yml:
44+
type: file
45+
description: File containing software versions
46+
pattern: versions.yml
47+
ontologies:
48+
- edam: http://edamontology.org/format_3750 # YAML
49+
authors:
50+
- "@kornkv"
51+
- "@mrozon-zip"
52+
maintainers:
53+
- "@kornkv"
54+
- "@mrozon-zip"
55+
- "@vagkaratzas"
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
nextflow_process {
2+
3+
name "Test Process SEQFU_CHECK"
4+
script "../main.nf"
5+
process "SEQFU_CHECK"
6+
7+
tag "modules"
8+
tag "modules_nfcore"
9+
tag "seqfu"
10+
tag "seqfu/check"
11+
12+
test("sarscov2 - fastq - single-end") {
13+
14+
when {
15+
process {
16+
"""
17+
input[0] = [[ id:'test', single_end:true ], // meta map
18+
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)
19+
]
20+
"""
21+
}
22+
}
23+
24+
then {
25+
assertAll(
26+
{ assert process.success },
27+
{ assert snapshot(process.out).match() }
28+
)
29+
}
30+
31+
}
32+
33+
test("sarscov2 - fastq - paired-end") {
34+
35+
when {
36+
process {
37+
"""
38+
input[0] = [
39+
[ id:'test_paired', single_end:false ], // meta map
40+
[
41+
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
42+
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)
43+
]
44+
]
45+
"""
46+
}
47+
}
48+
49+
then {
50+
assertAll(
51+
{ assert process.success },
52+
{ assert snapshot(process.out).match() }
53+
)
54+
}
55+
56+
}
57+
58+
test("sarscov2 - fastq - directory") {
59+
when {
60+
process {
61+
"""
62+
// stage input fastq files in a folder
63+
tmpdir = file("tmpdir", type: 'dir')
64+
tmpdir.mkdir()
65+
fastq_file_1 = file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)
66+
fastq_file_2 = file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)
67+
fastq_file_1.copyTo(tmpdir)
68+
fastq_file_2.copyTo(tmpdir)
69+
70+
// define inputs of the process here. Example:
71+
input[0] = [
72+
[ id:'test' ],
73+
[
74+
file(tmpdir, type:'dir', checkIfExists: true)
75+
]
76+
]
77+
"""
78+
}
79+
}
80+
then {
81+
assertAll(
82+
{ assert process.success },
83+
{ assert snapshot(
84+
process.out,
85+
path(process.out.versions.get(0)).yaml
86+
).match() }
87+
)
88+
}
89+
}
90+
91+
test("sarscov2 - fastq - single_end - stub") {
92+
93+
options "-stub"
94+
95+
when {
96+
process {
97+
"""
98+
input[0] = [[ id:'test', single_end:true ], // meta map
99+
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)
100+
]
101+
"""
102+
}
103+
}
104+
105+
then {
106+
assertAll(
107+
{ assert process.success },
108+
{ assert snapshot(
109+
process.out,
110+
process.out.versions.collect{ path(it).yaml }.unique()
111+
).match() }
112+
)
113+
}
114+
115+
}
116+
117+
}
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
{
2+
"sarscov2 - fastq - single_end - stub": {
3+
"content": [
4+
{
5+
"0": [
6+
[
7+
{
8+
"id": "test",
9+
"single_end": true
10+
},
11+
"test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
12+
]
13+
],
14+
"1": [
15+
"versions.yml:md5,68acb41f0d0333843fd5d1b0c7256fd1"
16+
],
17+
"check": [
18+
[
19+
{
20+
"id": "test",
21+
"single_end": true
22+
},
23+
"test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
24+
]
25+
],
26+
"versions": [
27+
"versions.yml:md5,68acb41f0d0333843fd5d1b0c7256fd1"
28+
]
29+
},
30+
[
31+
{
32+
"SEQFU_CHECK": {
33+
"seqfu": "1.22.3"
34+
}
35+
}
36+
]
37+
],
38+
"meta": {
39+
"nf-test": "0.9.3",
40+
"nextflow": "25.10.0"
41+
},
42+
"timestamp": "2025-10-29T12:44:11.259028502"
43+
},
44+
"sarscov2 - fastq - directory": {
45+
"content": [
46+
{
47+
"0": [
48+
[
49+
{
50+
"id": "test"
51+
},
52+
"test.tsv:md5,cd149b0f08b698981591be4a25729d7e"
53+
]
54+
],
55+
"1": [
56+
"versions.yml:md5,68acb41f0d0333843fd5d1b0c7256fd1"
57+
],
58+
"check": [
59+
[
60+
{
61+
"id": "test"
62+
},
63+
"test.tsv:md5,cd149b0f08b698981591be4a25729d7e"
64+
]
65+
],
66+
"versions": [
67+
"versions.yml:md5,68acb41f0d0333843fd5d1b0c7256fd1"
68+
]
69+
},
70+
{
71+
"SEQFU_CHECK": {
72+
"seqfu": "1.22.3"
73+
}
74+
}
75+
],
76+
"meta": {
77+
"nf-test": "0.9.3",
78+
"nextflow": "25.10.0"
79+
},
80+
"timestamp": "2025-10-29T12:43:55.867776056"
81+
},
82+
"sarscov2 - fastq - paired-end": {
83+
"content": [
84+
{
85+
"0": [
86+
[
87+
{
88+
"id": "test_paired",
89+
"single_end": false
90+
},
91+
"test_paired.tsv:md5,c3e6eae028f23041bd09cac9c371f318"
92+
]
93+
],
94+
"1": [
95+
"versions.yml:md5,68acb41f0d0333843fd5d1b0c7256fd1"
96+
],
97+
"check": [
98+
[
99+
{
100+
"id": "test_paired",
101+
"single_end": false
102+
},
103+
"test_paired.tsv:md5,c3e6eae028f23041bd09cac9c371f318"
104+
]
105+
],
106+
"versions": [
107+
"versions.yml:md5,68acb41f0d0333843fd5d1b0c7256fd1"
108+
]
109+
}
110+
],
111+
"meta": {
112+
"nf-test": "0.9.3",
113+
"nextflow": "25.10.0"
114+
},
115+
"timestamp": "2025-10-29T12:43:35.832380663"
116+
},
117+
"sarscov2 - fastq - single-end": {
118+
"content": [
119+
{
120+
"0": [
121+
[
122+
{
123+
"id": "test",
124+
"single_end": true
125+
},
126+
"test.tsv:md5,4c6409169772005cfb06be9e41f2c1e2"
127+
]
128+
],
129+
"1": [
130+
"versions.yml:md5,68acb41f0d0333843fd5d1b0c7256fd1"
131+
],
132+
"check": [
133+
[
134+
{
135+
"id": "test",
136+
"single_end": true
137+
},
138+
"test.tsv:md5,4c6409169772005cfb06be9e41f2c1e2"
139+
]
140+
],
141+
"versions": [
142+
"versions.yml:md5,68acb41f0d0333843fd5d1b0c7256fd1"
143+
]
144+
}
145+
],
146+
"meta": {
147+
"nf-test": "0.9.3",
148+
"nextflow": "25.10.0"
149+
},
150+
"timestamp": "2025-10-29T12:43:16.970955378"
151+
}
152+
}

0 commit comments

Comments
 (0)