diff --git a/modules.json b/modules.json index 7e57ea1..193d0e3 100644 --- a/modules.json +++ b/modules.json @@ -10,6 +10,11 @@ "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", "installed_by": ["modules"] }, + "fastqe": { + "branch": "master", + "git_sha": "cab0b8fdc4f785810f49423d8141a0773c21eb3b", + "installed_by": ["modules"] + }, "multiqc": { "branch": "master", "git_sha": "cf17ca47590cc578dfb47db1c2a44ef86f89976d", diff --git a/modules/nf-core/fastqe/environment.yml b/modules/nf-core/fastqe/environment.yml new file mode 100644 index 0000000..0b98f6f --- /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 0000000..05f40cc --- /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 0000000..e34c109 --- /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 0000000..1fee9ed --- /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 0000000..195bafb --- /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 diff --git a/workflows/seqinspector.nf b/workflows/seqinspector.nf index 7a2dfae..823f88f 100644 --- a/workflows/seqinspector.nf +++ b/workflows/seqinspector.nf @@ -6,6 +6,7 @@ include { SEQTK_SAMPLE } from '../modules/nf-core/seqtk/sample/main' include { FASTQC } from '../modules/nf-core/fastqc/main' +include { FASTQE } from '../modules/nf-core/fastqe/main' include { MULTIQC as MULTIQC_GLOBAL } from '../modules/nf-core/multiqc/main' include { MULTIQC as MULTIQC_PER_TAG } from '../modules/nf-core/multiqc/main' @@ -58,6 +59,15 @@ workflow SEQINSPECTOR { ch_multiqc_files = ch_multiqc_files.mix(FASTQC.out.zip) ch_versions = ch_versions.mix(FASTQC.out.versions.first()) + // FASTQE + FASTQE( + ch_sample_sized.map { + meta, subsampled -> [meta, subsampled] + } + ) + ch_multiqc_files = ch_multiqc_files.mix(FASTQE.out.tsv) + ch_versions = ch_versions.mix(FASTQE.out.versions.first()) + // // Collate and save software versions //