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

Add FASTQE module #6914

Merged
merged 5 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
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: "*.txt"
maxulysse marked this conversation as resolved.
Show resolved Hide resolved
- 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"
}
}
Loading