diff --git a/modules/nf-core/fastqe/environment.yml b/modules/nf-core/fastqe/environment.yml new file mode 100644 index 00000000000..0b98f6fc33b --- /dev/null +++ b/modules/nf-core/fastqe/environment.yml @@ -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" diff --git a/modules/nf-core/fastqe/main.nf b/modules/nf-core/fastqe/main.nf new file mode 100644 index 00000000000..05f40ccf40b --- /dev/null +++ b/modules/nf-core/fastqe/main.nf @@ -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 + """ +} diff --git a/modules/nf-core/fastqe/meta.yml b/modules/nf-core/fastqe/meta.yml new file mode 100644 index 00000000000..e34c109e93f --- /dev/null +++ b/modules/nf-core/fastqe/meta.yml @@ -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" diff --git a/modules/nf-core/fastqe/tests/main.nf.test b/modules/nf-core/fastqe/tests/main.nf.test new file mode 100644 index 00000000000..1fee9ed23bd --- /dev/null +++ b/modules/nf-core/fastqe/tests/main.nf.test @@ -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() } + ) + } + } + +} diff --git a/modules/nf-core/fastqe/tests/main.nf.test.snap b/modules/nf-core/fastqe/tests/main.nf.test.snap new file mode 100644 index 00000000000..195bafb0c49 --- /dev/null +++ b/modules/nf-core/fastqe/tests/main.nf.test.snap @@ -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" + } +} \ No newline at end of file