Skip to content

Commit

Permalink
Add FASTQE module (nf-core#6914)
Browse files Browse the repository at this point in the history
* Add FASTQE module

* fix linting

* Fix FASTQE

* FASTQE: static version in test

* Update modules/nf-core/fastqe/meta.yml

Co-authored-by: Edmund Miller <[email protected]>

---------

Co-authored-by: Edmund Miller <[email protected]>
  • Loading branch information
adamrtalbot and edmundmiller authored Oct 31, 2024
1 parent bcf36bc commit cab0b8f
Show file tree
Hide file tree
Showing 5 changed files with 347 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/nf-core/fastqe/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
- "bioconda::fastqe=0.3.3"
48 changes: 48 additions & 0 deletions modules/nf-core/fastqe/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
process FASTQE {
tag "$meta.id"
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/fastqe:0.3.3--pyhdfd78af_0':
'biocontainers/fastqe:0.3.3--pyhdfd78af_0' }"

input:
tuple val(meta), path(fastq)

output:
tuple val(meta), path("*.tsv"), emit: tsv
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = '0.3.3'
"""
fastqe \\
$args \\
$fastq \\
--output ${prefix}.tsv
cat <<-END_VERSIONS > versions.yml
"${task.process}":
fastqe: $VERSION
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = '0.3.3'
"""
touch ${prefix}.tsv
cat <<-END_VERSIONS > versions.yml
"${task.process}":
fastqe: $VERSION
END_VERSIONS
"""
}
50 changes: 50 additions & 0 deletions modules/nf-core/fastqe/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "fastqe"
description: fastqe is a bioinformatics command line tool that uses emojis to represent and analyze genomic data.
keywords:
- quality control
- fastq
- emoji
- visualization
tools:
- fastqe:
description: "A tool for visualizing FASTQ file quality using emoji"
homepage: "https://github.com/fastqe/fastqe"
documentation: "https://github.com/fastqe/fastqe#readme"
tool_dev_url: "https://github.com/fastqe/fastqe"
doi: "10.21105/joss.02400"
licence: ["MIT"]
identifier: "biotools:fastqe"

input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- fastq:
type: file
description: |
List of input FastQ files of size 1 and 2 for single-end and paired-end data,
respectively.
output:
- tsv:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- "*.tsv":
type: file
description: Text file containing emoji
pattern: "*.tsv"
- versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"

authors:
- "@adamrtalbot"
maintainers:
- "@adamrtalbot"
100 changes: 100 additions & 0 deletions modules/nf-core/fastqe/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
// nf-core modules test fastqe
nextflow_process {

name "Test Process FASTQE"
script "../main.nf"
process "FASTQE"

tag "modules"
tag "modules_nfcore"
tag "fastqe"

test("sarscov2 single-end [fastq]") {

when {
process {
"""
input[0] = Channel.of([
[ id: 'test', single_end:true ],
[ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ]
])
"""
}
}

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

test("sarscov2 paired-end [fastq]") {

when {
process {
"""
input[0] = Channel.of([
[id: 'test', single_end: false], // meta map
[ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) ]
])
"""
}
}

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

test("sarscov2 single-end [fastq] - stub") {

options "-stub"
when {
process {
"""
input[0] = Channel.of([
[ id: 'test', single_end:true ],
[ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ]
])
"""
}
}

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

test("sarscov2 paired-end [fastq] - stub") {

options "-stub"
when {
process {
"""
input[0] = Channel.of([
[id: 'test', single_end: false], // meta map
[ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) ]
])
"""
}
}

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

}
142 changes: 142 additions & 0 deletions modules/nf-core/fastqe/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
{
"sarscov2 single-end [fastq] - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": true
},
"test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,dbbf45cfa1fab97d81e8de840958233b"
],
"tsv": [
[
{
"id": "test",
"single_end": true
},
"test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,dbbf45cfa1fab97d81e8de840958233b"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.0"
},
"timestamp": "2024-10-31T10:18:03.83777"
},
"sarscov2 paired-end [fastq]": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.tsv:md5,aceceddba6e4b5a968d54a6db46238da"
]
],
"1": [
"versions.yml:md5,dbbf45cfa1fab97d81e8de840958233b"
],
"tsv": [
[
{
"id": "test",
"single_end": false
},
"test.tsv:md5,aceceddba6e4b5a968d54a6db46238da"
]
],
"versions": [
"versions.yml:md5,dbbf45cfa1fab97d81e8de840958233b"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.0"
},
"timestamp": "2024-10-31T10:16:30.591658"
},
"sarscov2 paired-end [fastq] - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,dbbf45cfa1fab97d81e8de840958233b"
],
"tsv": [
[
{
"id": "test",
"single_end": false
},
"test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,dbbf45cfa1fab97d81e8de840958233b"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.0"
},
"timestamp": "2024-10-31T10:18:09.501789"
},
"sarscov2 single-end [fastq]": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": true
},
"test.tsv:md5,16d66ef19b5f2694aaeae9c3727c3a61"
]
],
"1": [
"versions.yml:md5,dbbf45cfa1fab97d81e8de840958233b"
],
"tsv": [
[
{
"id": "test",
"single_end": true
},
"test.tsv:md5,16d66ef19b5f2694aaeae9c3727c3a61"
]
],
"versions": [
"versions.yml:md5,dbbf45cfa1fab97d81e8de840958233b"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.0"
},
"timestamp": "2024-10-31T10:16:23.822551"
}
}

0 comments on commit cab0b8f

Please sign in to comment.