From e61c41f532ed7131edf2e7127ad07c146d1bb18f Mon Sep 17 00:00:00 2001 From: mazzalab Date: Tue, 10 Dec 2024 00:55:06 +0100 Subject: [PATCH 01/12] Add wipertools module (#7184) --- .../nf-core/wipertools/fastqgather/main.nf | 42 ++++++++++ .../nf-core/wipertools/fastqgather/meta.yml | 58 +++++++++++++ .../wipertools/fastqgather/tests/base.config | 5 ++ .../wipertools/fastqgather/tests/main.nf.test | 66 +++++++++++++++ .../fastqgather/tests/main.nf.test.snap | 42 ++++++++++ .../wipertools/fastqscatter/environment.yml | 7 ++ .../nf-core/wipertools/fastqscatter/main.nf | 51 +++++++++++ .../nf-core/wipertools/fastqscatter/meta.yml | 60 +++++++++++++ .../wipertools/fastqscatter/tests/base.config | 5 ++ .../fastqscatter/tests/main.nf.test | 63 ++++++++++++++ .../fastqscatter/tests/main.nf.test.snap | 50 +++++++++++ .../wipertools/fastqwiper/environment.yml | 7 ++ modules/nf-core/wipertools/fastqwiper/main.nf | 46 ++++++++++ .../nf-core/wipertools/fastqwiper/meta.yml | 63 ++++++++++++++ .../wipertools/fastqwiper/tests/base.config | 5 ++ .../wipertools/fastqwiper/tests/main.nf.test | 60 +++++++++++++ .../fastqwiper/tests/main.nf.test.snap | 84 +++++++++++++++++++ .../wipertools/reportgather/environment.yml | 7 ++ .../nf-core/wipertools/reportgather/main.nf | 42 ++++++++++ .../nf-core/wipertools/reportgather/meta.yml | 58 +++++++++++++ .../reportgather/tests/main.nf.test | 63 ++++++++++++++ .../reportgather/tests/main.nf.test.snap | 42 ++++++++++ 22 files changed, 926 insertions(+) create mode 100644 modules/nf-core/wipertools/fastqgather/main.nf create mode 100644 modules/nf-core/wipertools/fastqgather/meta.yml create mode 100644 modules/nf-core/wipertools/fastqgather/tests/base.config create mode 100644 modules/nf-core/wipertools/fastqgather/tests/main.nf.test create mode 100644 modules/nf-core/wipertools/fastqgather/tests/main.nf.test.snap create mode 100644 modules/nf-core/wipertools/fastqscatter/environment.yml create mode 100644 modules/nf-core/wipertools/fastqscatter/main.nf create mode 100644 modules/nf-core/wipertools/fastqscatter/meta.yml create mode 100644 modules/nf-core/wipertools/fastqscatter/tests/base.config create mode 100644 modules/nf-core/wipertools/fastqscatter/tests/main.nf.test create mode 100644 modules/nf-core/wipertools/fastqscatter/tests/main.nf.test.snap create mode 100644 modules/nf-core/wipertools/fastqwiper/environment.yml create mode 100644 modules/nf-core/wipertools/fastqwiper/main.nf create mode 100644 modules/nf-core/wipertools/fastqwiper/meta.yml create mode 100644 modules/nf-core/wipertools/fastqwiper/tests/base.config create mode 100644 modules/nf-core/wipertools/fastqwiper/tests/main.nf.test create mode 100644 modules/nf-core/wipertools/fastqwiper/tests/main.nf.test.snap create mode 100644 modules/nf-core/wipertools/reportgather/environment.yml create mode 100644 modules/nf-core/wipertools/reportgather/main.nf create mode 100644 modules/nf-core/wipertools/reportgather/meta.yml create mode 100644 modules/nf-core/wipertools/reportgather/tests/main.nf.test create mode 100644 modules/nf-core/wipertools/reportgather/tests/main.nf.test.snap diff --git a/modules/nf-core/wipertools/fastqgather/main.nf b/modules/nf-core/wipertools/fastqgather/main.nf new file mode 100644 index 00000000000..891d13ae960 --- /dev/null +++ b/modules/nf-core/wipertools/fastqgather/main.nf @@ -0,0 +1,42 @@ +process WIPERTOOLS_FASTQGATHER { + 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/wipertools:1.1.3--pyhdfd78af_0': + 'biocontainers/wipertools:1.1.3--pyhdfd78af_0' }" + + input: + tuple val(meta), path(fastq_in) + + output: + tuple val(meta), path("*_gather.fastq.gz") , emit: fastq_out + 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}" + """ + wipertools fastqgather -i $fastq_in -o ${prefix}_gather.fastq.gz ${args} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + wipertools fastqgather: \$(wipertools fastqgather --version) + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + echo -e "@ERR001268.2 080821_HWI-EAS301_0002_30ALBAAXX:1:1:1090:1998/1" > ${prefix}_gather.fastq | gzip -c > ${prefix}_gather.fastq.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + wipertools fastqgather: \$(wipertools fastqgather --version) + END_VERSIONS + """ +} diff --git a/modules/nf-core/wipertools/fastqgather/meta.yml b/modules/nf-core/wipertools/fastqgather/meta.yml new file mode 100644 index 00000000000..7708e69dc1c --- /dev/null +++ b/modules/nf-core/wipertools/fastqgather/meta.yml @@ -0,0 +1,58 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "wipertools_fastqgather" +description: A tool of the wipertools suite that merges FASTQ chunks produced by wipertools_fastqscatter +keywords: + - fastq + - merge + - union +tools: + - "fastqgather": + description: + "A tool of the wipertools suite that merges FASTQ chunks produced\ + \ by wipertools_fastqscatter." + homepage: "https://github.com/mazzalab/fastqwiper" + documentation: "https://github.com/mazzalab/fastqwiper" + tool_dev_url: "https://github.com/mazzalab/fastqwiper" + doi: "no DOI available" + licence: ["GPL v2-or-later"] + identifier: "" + +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fastq_folder_in: + type: file + description: Directory containing FASTQ chunks to be merged + pattern: "*.{fastq,fastq.gz}" + ontologies: + - edam: "http://edamontology.org/format_1930" + - edam: "http://edamontology.org/format_3989" +output: + - fastq_out: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.fastq.gz": + type: file + description: The resulting FASTQ file + pattern: "*.fastq.gz" + ontologies: + - edam: "http://edamontology.org/format_1930" + - edam: "http://edamontology.org/format_3989" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: "http://edamontology.org/format_2330" +authors: + - "@tm4zza" +maintainers: + - "@mazzalab" + - "@tm4zza" diff --git a/modules/nf-core/wipertools/fastqgather/tests/base.config b/modules/nf-core/wipertools/fastqgather/tests/base.config new file mode 100644 index 00000000000..1d919dd69b7 --- /dev/null +++ b/modules/nf-core/wipertools/fastqgather/tests/base.config @@ -0,0 +1,5 @@ +process { + withName: WIPERTOOLS_FASTQGATHER { + ext.args = '--prefix pp_' + } +} diff --git a/modules/nf-core/wipertools/fastqgather/tests/main.nf.test b/modules/nf-core/wipertools/fastqgather/tests/main.nf.test new file mode 100644 index 00000000000..92831d4190f --- /dev/null +++ b/modules/nf-core/wipertools/fastqgather/tests/main.nf.test @@ -0,0 +1,66 @@ +nextflow_process { + + name "Test Process WIPERTOOLS_FASTQGATHER" + script "../main.nf" + process "WIPERTOOLS_FASTQGATHER" + + tag "modules" + tag "modules_nfcore" + tag "wipertools" + tag "wipertools/fastqgather" + tag "untar" + + test("merge two gzipped fastq - fastq.gz") { + + config "./base.config" + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [id: 'fastq_chunks'], + [file('https://raw.githubusercontent.com/nf-core/test-datasets/fastqrepair/testdata/pp_1-of-2_ss.fastq.gz', checkIfExists: true), + file('https://raw.githubusercontent.com/nf-core/test-datasets/fastqrepair/testdata/pp_2-of-2_ss.fastq.gz', checkIfExists: true)] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.fastq_out, process.out.versions).match() } + ) + } + + } + + test("merge two gzipped fastq - fastq.gz - stub") { + + options "-stub" + config "./base.config" + + when { + process { + """ + input[0] = [ + [id: 'fastq_chunks'], + [file('https://raw.githubusercontent.com/nf-core/test-datasets/fastqrepair/testdata/pp_1-of-2_ss.fastq.gz', checkIfExists: true), + file('https://raw.githubusercontent.com/nf-core/test-datasets/fastqrepair/testdata/pp_2-of-2_ss.fastq.gz', checkIfExists: true)] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.fastq_out, process.out.versions).match() } + ) + } + } + +} diff --git a/modules/nf-core/wipertools/fastqgather/tests/main.nf.test.snap b/modules/nf-core/wipertools/fastqgather/tests/main.nf.test.snap new file mode 100644 index 00000000000..53956d06450 --- /dev/null +++ b/modules/nf-core/wipertools/fastqgather/tests/main.nf.test.snap @@ -0,0 +1,42 @@ +{ + "merge two gzipped fastq - fastq.gz - stub": { + "content": [ + [ + [ + { + "id": "fastq_chunks" + }, + "fastq_chunks_gather.fastq.gz:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + [ + "versions.yml:md5,291a2e6d58146bfcf57b4d9ef850cbd9" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-12-09T23:41:07.264741" + }, + "merge two gzipped fastq - fastq.gz": { + "content": [ + [ + [ + { + "id": "fastq_chunks" + }, + "fastq_chunks_gather.fastq.gz:md5,5ba7f1c78e2f6c979b8b88494a08977a" + ] + ], + [ + "versions.yml:md5,291a2e6d58146bfcf57b4d9ef850cbd9" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-12-09T23:40:55.88226" + } +} \ No newline at end of file diff --git a/modules/nf-core/wipertools/fastqscatter/environment.yml b/modules/nf-core/wipertools/fastqscatter/environment.yml new file mode 100644 index 00000000000..a93ca47ef57 --- /dev/null +++ b/modules/nf-core/wipertools/fastqscatter/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::wipertools=1.1.1" diff --git a/modules/nf-core/wipertools/fastqscatter/main.nf b/modules/nf-core/wipertools/fastqscatter/main.nf new file mode 100644 index 00000000000..f690ecb2fb5 --- /dev/null +++ b/modules/nf-core/wipertools/fastqscatter/main.nf @@ -0,0 +1,51 @@ +process WIPERTOOLS_FASTQSCATTER { + 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/wipertools:1.1.3--pyhdfd78af_0': + 'biocontainers/wipertools:1.1.3--pyhdfd78af_0' }" + + input: + tuple val(meta), path(fastq) + val(num_splits) + + output: + tuple val(meta), path("${out_folder}/*") , emit: chunks + 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 args_list = args.tokenize() + out_folder = (args_list.contains('--out_folder') ? args_list[args_list.indexOf('--out_folder')+1] : (args_list.contains('-o') ? args_list[args_list.indexOf('-o')+1] : 'chunks')) + + """ + wipertools fastqscatter -f ${fastq} -n ${num_splits} -p ${prefix} ${args} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + wipertools fastqscatter: \$(wipertools fastqscatter --version) + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def args_list = args.tokenize() + out_folder = (args_list.contains('--out_folder') ? args_list[args_list.indexOf('--out_folder')+1] : (args_list.contains('-o') ? args_list[args_list.indexOf('-o')+1] : 'chunks')) + """ + mkdir ${out_folder} + echo -e "@ERR001268.1 080821_HWI-EAS301_0002_30ALBAAXX:1:1:1090:1998/1" > ${out_folder}/prefix_1-of-2_suffix.fastq + echo -e "@ERR001268.2 080821_HWI-EAS301_0002_30ALBAAXX:1:1:1090:1998/2" > ${out_folder}/prefix_2-of-2_suffix.fastq + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + wipertools fastqscatter: \$(wipertools fastqscatter --version) + END_VERSIONS + """ +} diff --git a/modules/nf-core/wipertools/fastqscatter/meta.yml b/modules/nf-core/wipertools/fastqscatter/meta.yml new file mode 100644 index 00000000000..6a2ca0b4a5b --- /dev/null +++ b/modules/nf-core/wipertools/fastqscatter/meta.yml @@ -0,0 +1,60 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "wipertools_fastqscatter" +description: A tool of the wipertools suite that splits FASTQ files into chunks +keywords: + - fastq + - split + - partitioning +tools: + - "fastqscatter": + description: "A tool of the wipertools suite that splits FASTQ files into chunks." + homepage: "https://github.com/mazzalab/fastqwiper" + documentation: "https://github.com/mazzalab/fastqwiper" + tool_dev_url: "https://github.com/mazzalab/fastqwiper" + doi: "no DOI available" + licence: ["GPL v2-or-later"] + identifier: "" + +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fastq: + type: file + description: FASTQ file + pattern: "*.{fastq,fastq.gz}" + ontologies: + - edam: "http://edamontology.org/format_1930" + - - num_splits: + type: integer + description: Number of desired chunks + pattern: "[1-9][0-9]*" + +output: + - chunks: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "${out_folder}/*": + type: file + description: Chunk FASTQ files + pattern: "*.{fastq,fastq.gz}" + ontologies: + - edam: "http://edamontology.org/format_1930" + - edam: "http://edamontology.org/format_3989" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: "http://edamontology.org/format_3750" +authors: + - "@tm4zza" +maintainers: + - "@mazzalab" + - "@tm4zza" diff --git a/modules/nf-core/wipertools/fastqscatter/tests/base.config b/modules/nf-core/wipertools/fastqscatter/tests/base.config new file mode 100644 index 00000000000..f6229e0ceb1 --- /dev/null +++ b/modules/nf-core/wipertools/fastqscatter/tests/base.config @@ -0,0 +1,5 @@ +process { + withName: WIPERTOOLS_FASTQSCATTER { + ext.args = '-o chunks_custom -O unix' + } +} diff --git a/modules/nf-core/wipertools/fastqscatter/tests/main.nf.test b/modules/nf-core/wipertools/fastqscatter/tests/main.nf.test new file mode 100644 index 00000000000..017ec212245 --- /dev/null +++ b/modules/nf-core/wipertools/fastqscatter/tests/main.nf.test @@ -0,0 +1,63 @@ +nextflow_process { + + name "Test Process WIPERTOOLS_FASTQSCATTER" + script "../main.nf" + process "WIPERTOOLS_FASTQSCATTER" + + tag "modules" + tag "modules_nfcore" + tag "wipertools" + tag "wipertools/fastqscatter" + + test("3 reads, one truncated - fastq") { + + config "./base.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file('https://raw.githubusercontent.com/nf-core/test-datasets/fastqrepair/testdata/truncated_clean.fastq', checkIfExists: true), + ] + input[1] = 2 // splits num + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.chunks, process.out.versions).match() } + ) + } + + } + + test("3 reads, one truncated - fastq - stub") { + + options "-stub" + config "./base.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true ], + file('https://raw.githubusercontent.com/nf-core/test-datasets/fastqrepair/testdata/truncated_clean.fastq', checkIfExists: true), + ] + input[1] = 2 // splits num + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.chunks, process.out.versions).match() } + ) + } + + } + +} diff --git a/modules/nf-core/wipertools/fastqscatter/tests/main.nf.test.snap b/modules/nf-core/wipertools/fastqscatter/tests/main.nf.test.snap new file mode 100644 index 00000000000..0d897c33a9e --- /dev/null +++ b/modules/nf-core/wipertools/fastqscatter/tests/main.nf.test.snap @@ -0,0 +1,50 @@ +{ + "3 reads, one truncated - fastq": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_000.fastq.gz:md5,6ceafda8be51f7cba017123728261162", + "test_001.fastq.gz:md5,572033e56b4e644e704e3c83652e06cc" + ] + ] + ], + [ + "versions.yml:md5,c8e701c1048cc9ab79752d1bf631ad4b" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-12-09T23:41:16.411715" + }, + "3 reads, one truncated - fastq - stub": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + [ + "prefix_1-of-2_suffix.fastq:md5,40e2f90cf50b26b1ce397766aa89a8c7", + "prefix_2-of-2_suffix.fastq:md5,ef3ef34999313c60f22a25e90bb154db" + ] + ] + ], + [ + "versions.yml:md5,c8e701c1048cc9ab79752d1bf631ad4b" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-12-09T23:41:24.523993" + } +} \ No newline at end of file diff --git a/modules/nf-core/wipertools/fastqwiper/environment.yml b/modules/nf-core/wipertools/fastqwiper/environment.yml new file mode 100644 index 00000000000..a93ca47ef57 --- /dev/null +++ b/modules/nf-core/wipertools/fastqwiper/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::wipertools=1.1.1" diff --git a/modules/nf-core/wipertools/fastqwiper/main.nf b/modules/nf-core/wipertools/fastqwiper/main.nf new file mode 100644 index 00000000000..85f940611d7 --- /dev/null +++ b/modules/nf-core/wipertools/fastqwiper/main.nf @@ -0,0 +1,46 @@ +process WIPERTOOLS_FASTQWIPER { + 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/wipertools:1.1.3--pyhdfd78af_0': + 'biocontainers/wipertools:1.1.3--pyhdfd78af_0' }" + + input: + tuple val(meta), path(fastq_in) + + output: + tuple val(meta), path("${meta.id}*_wiped.fastq.gz") , emit: fastq_out + path("*.report") , emit: report + 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 fastq_out = prefix.endsWith('.fastq.gz') ? prefix.replaceAll(/\.fastq.gz$/, '_wiped.fastq.gz') : (prefix.endsWith('.fastq') ? prefix.replaceAll(/\.fastq$/, '_wiped.fastq.gz') : prefix + "_wiped.fastq.gz") + def report_file = prefix + ".report" + """ + wipertools fastqwiper -i ${fastq_in} -o ${fastq_out} -r ${report_file} ${args} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + wipertools wiper: \$(wipertools fastqwiper --version) + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + echo -e "@ERR001268.2 CLEAN_READ_HEADER_ONLY_30ALBAAXX:1:1:1090:1998/1" > ${prefix}_wiped.fastq | gzip -c > ${prefix}_wiped.fastq.gz + touch ${prefix}.report + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + wipertools wiper: \$(wipertools fastqwiper --version) + END_VERSIONS + """ +} diff --git a/modules/nf-core/wipertools/fastqwiper/meta.yml b/modules/nf-core/wipertools/fastqwiper/meta.yml new file mode 100644 index 00000000000..11245c45973 --- /dev/null +++ b/modules/nf-core/wipertools/fastqwiper/meta.yml @@ -0,0 +1,63 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "wipertools_fastqwiper" +description: A tool of the wipertools suite that fixes or wipes out uncompliant reads from FASTQ files +keywords: + - fastq + - malformed + - fix +tools: + - "fastqwiper": + description: "A tool of the wipertools suite that that fixes or wipes out uncompliant reads from FASTQ files." + homepage: "https://github.com/mazzalab/fastqwiper" + documentation: "https://github.com/mazzalab/fastqwiper" + tool_dev_url: "https://github.com/mazzalab/fastqwiper" + doi: "no DOI available" + licence: ["GPL v2-or-later"] + identifier: "" + +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fastq_in: + type: file + description: FASTQ file to be cleaned + pattern: "*.{fastq,fastq.gz}" + ontologies: + - edam: "http://edamontology.org/format_1930" + - edam: "http://edamontology.org/format_3989" +output: + - fastq_out: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "${meta.id}*_wiped.fastq.gz": + type: file + description: Cleaned FASTQ file + pattern: "*.{fastq,fastq.gz}" + ontologies: + - edam: "http://edamontology.org/format_1930" + - edam: "http://edamontology.org/format_3989" + - report: + - "*.report": + type: file + description: Summary of the cleaning task + pattern: "*.{txt}" + ontologies: + - edam: "http://edamontology.org/format_2330" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: "http://edamontology.org/format_3750" +authors: + - "@tm4zza" +maintainers: + - "@mazzalab" + - "@tm4zza" diff --git a/modules/nf-core/wipertools/fastqwiper/tests/base.config b/modules/nf-core/wipertools/fastqwiper/tests/base.config new file mode 100644 index 00000000000..8da4159a39a --- /dev/null +++ b/modules/nf-core/wipertools/fastqwiper/tests/base.config @@ -0,0 +1,5 @@ +process { + withName: WIPERTOOLS_FASTQWIPER { + ext.args = '-a ACGT' + } +} diff --git a/modules/nf-core/wipertools/fastqwiper/tests/main.nf.test b/modules/nf-core/wipertools/fastqwiper/tests/main.nf.test new file mode 100644 index 00000000000..f629c0afec5 --- /dev/null +++ b/modules/nf-core/wipertools/fastqwiper/tests/main.nf.test @@ -0,0 +1,60 @@ +nextflow_process { + + name "Test Process WIPERTOOLS_FASTQWIPER" + script "../main.nf" + process "WIPERTOOLS_FASTQWIPER" + + tag "modules" + tag "modules_nfcore" + tag "wipertools" + tag "wipertools/fastqwiper" + + test("30 paired-end reads - fastq") { + + config "./base.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true ], + file('https://raw.githubusercontent.com/nf-core/test-datasets/fastqrepair/testdata/truncated_clean.fastq', checkIfExists: true), + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("30 paired-end reads - fastq - stub") { + + options "-stub" + config "./base.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true ], + file('https://raw.githubusercontent.com/nf-core/test-datasets/fastqrepair/testdata/truncated_clean.fastq', checkIfExists: true), + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + +} diff --git a/modules/nf-core/wipertools/fastqwiper/tests/main.nf.test.snap b/modules/nf-core/wipertools/fastqwiper/tests/main.nf.test.snap new file mode 100644 index 00000000000..e7feb95e488 --- /dev/null +++ b/modules/nf-core/wipertools/fastqwiper/tests/main.nf.test.snap @@ -0,0 +1,84 @@ +{ + "30 paired-end reads - fastq - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test_wiped.fastq.gz:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "test.report:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + "2": [ + "versions.yml:md5,1f9b92c604ab68e45c7926be59cf18d9" + ], + "fastq_out": [ + [ + { + "id": "test", + "single_end": true + }, + "test_wiped.fastq.gz:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "report": [ + "test.report:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + "versions": [ + "versions.yml:md5,1f9b92c604ab68e45c7926be59cf18d9" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-12-09T23:41:46.028429" + }, + "30 paired-end reads - fastq": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test_wiped.fastq.gz:md5,d07cb1aacfd7a67aa0c85633eaef1c90" + ] + ], + "1": [ + "test.report:md5,3d2cfb8d7b72afe9b88663cf9dbf8129" + ], + "2": [ + "versions.yml:md5,1f9b92c604ab68e45c7926be59cf18d9" + ], + "fastq_out": [ + [ + { + "id": "test", + "single_end": true + }, + "test_wiped.fastq.gz:md5,d07cb1aacfd7a67aa0c85633eaef1c90" + ] + ], + "report": [ + "test.report:md5,3d2cfb8d7b72afe9b88663cf9dbf8129" + ], + "versions": [ + "versions.yml:md5,1f9b92c604ab68e45c7926be59cf18d9" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-12-09T23:41:36.186246" + } +} \ No newline at end of file diff --git a/modules/nf-core/wipertools/reportgather/environment.yml b/modules/nf-core/wipertools/reportgather/environment.yml new file mode 100644 index 00000000000..a93ca47ef57 --- /dev/null +++ b/modules/nf-core/wipertools/reportgather/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::wipertools=1.1.1" diff --git a/modules/nf-core/wipertools/reportgather/main.nf b/modules/nf-core/wipertools/reportgather/main.nf new file mode 100644 index 00000000000..740147cfeac --- /dev/null +++ b/modules/nf-core/wipertools/reportgather/main.nf @@ -0,0 +1,42 @@ +process WIPERTOOLS_REPORTGATHER { + 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/wipertools:1.1.3--pyhdfd78af_0': + 'biocontainers/wipertools:1.1.3--pyhdfd78af_0' }" + + input: + tuple val(meta), path(reports) + + output: + tuple val(meta), path("*_gathered.report") , emit: report_out + 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}" + """ + wipertools reportgather -r $reports -f ${prefix}_gathered.report ${args} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + wipertools reportgather: \$(wipertools reportgather --version) + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + echo -e "GATHERED REPORT FROM MANY REPORTS" > ${prefix}_gathered.report + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + wipertools reportgather: \$(wipertools reportgather --version) + END_VERSIONS + """ +} diff --git a/modules/nf-core/wipertools/reportgather/meta.yml b/modules/nf-core/wipertools/reportgather/meta.yml new file mode 100644 index 00000000000..7708e69dc1c --- /dev/null +++ b/modules/nf-core/wipertools/reportgather/meta.yml @@ -0,0 +1,58 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "wipertools_fastqgather" +description: A tool of the wipertools suite that merges FASTQ chunks produced by wipertools_fastqscatter +keywords: + - fastq + - merge + - union +tools: + - "fastqgather": + description: + "A tool of the wipertools suite that merges FASTQ chunks produced\ + \ by wipertools_fastqscatter." + homepage: "https://github.com/mazzalab/fastqwiper" + documentation: "https://github.com/mazzalab/fastqwiper" + tool_dev_url: "https://github.com/mazzalab/fastqwiper" + doi: "no DOI available" + licence: ["GPL v2-or-later"] + identifier: "" + +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fastq_folder_in: + type: file + description: Directory containing FASTQ chunks to be merged + pattern: "*.{fastq,fastq.gz}" + ontologies: + - edam: "http://edamontology.org/format_1930" + - edam: "http://edamontology.org/format_3989" +output: + - fastq_out: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.fastq.gz": + type: file + description: The resulting FASTQ file + pattern: "*.fastq.gz" + ontologies: + - edam: "http://edamontology.org/format_1930" + - edam: "http://edamontology.org/format_3989" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: "http://edamontology.org/format_2330" +authors: + - "@tm4zza" +maintainers: + - "@mazzalab" + - "@tm4zza" diff --git a/modules/nf-core/wipertools/reportgather/tests/main.nf.test b/modules/nf-core/wipertools/reportgather/tests/main.nf.test new file mode 100644 index 00000000000..b0b104eaefe --- /dev/null +++ b/modules/nf-core/wipertools/reportgather/tests/main.nf.test @@ -0,0 +1,63 @@ +nextflow_process { + + name "Test Process WIPERTOOLS_REPORTGATHER" + script "../main.nf" + process "WIPERTOOLS_REPORTGATHER" + + tag "modules" + tag "modules_nfcore" + tag "wipertools" + tag "wipertools/reportgather" + tag "untar" + + test("merge two tar-gzipped reports - .tar.gz") { + + when { + params { + outdir = "$outputDir" + } + process { + """ + input[0] = [ + [id: 'report_chunks'], + [file('https://raw.githubusercontent.com/nf-core/test-datasets/fastqrepair/testdata/report_chunk1.report', checkIfExists: true), + file('https://raw.githubusercontent.com/nf-core/test-datasets/fastqrepair/testdata/report_chunk2.report', checkIfExists: true)] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.report_out, process.out.versions).match() } + ) + } + + } + + test("merge two tar-gzipped reports - .tar.gz - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [id: 'report_chunks'], + [file('https://raw.githubusercontent.com/nf-core/test-datasets/fastqrepair/testdata/report_chunk1.report', checkIfExists: true), + file('https://raw.githubusercontent.com/nf-core/test-datasets/fastqrepair/testdata/report_chunk2.report', checkIfExists: true)] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.report_out, process.out.versions).match() } + ) + } + } + +} diff --git a/modules/nf-core/wipertools/reportgather/tests/main.nf.test.snap b/modules/nf-core/wipertools/reportgather/tests/main.nf.test.snap new file mode 100644 index 00000000000..c44e34f99a2 --- /dev/null +++ b/modules/nf-core/wipertools/reportgather/tests/main.nf.test.snap @@ -0,0 +1,42 @@ +{ + "merge two tar-gzipped reports - .tar.gz - stub": { + "content": [ + [ + [ + { + "id": "report_chunks" + }, + "report_chunks_gathered.report:md5,4dda98ea02f3579364e6ab2053bf8a96" + ] + ], + [ + "versions.yml:md5,8f315851a1d3b7a1bb186ab41e7675df" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-12-09T23:42:07.686856" + }, + "merge two tar-gzipped reports - .tar.gz": { + "content": [ + [ + [ + { + "id": "report_chunks" + }, + "report_chunks_gathered.report:md5,f64b18d0593c937dfac76b2a415bb58c" + ] + ], + [ + "versions.yml:md5,8f315851a1d3b7a1bb186ab41e7675df" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-12-09T23:41:55.525228" + } +} \ No newline at end of file From f326b439c322b7af7352bbbbd7fbade99d6ec849 Mon Sep 17 00:00:00 2001 From: Tommaso Mazza <69600392+tm4zza@users.noreply.github.com> Date: Tue, 10 Dec 2024 01:18:53 +0100 Subject: [PATCH 02/12] Update environment.yml --- modules/nf-core/wipertools/fastqscatter/environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/wipertools/fastqscatter/environment.yml b/modules/nf-core/wipertools/fastqscatter/environment.yml index a93ca47ef57..0b897be4941 100644 --- a/modules/nf-core/wipertools/fastqscatter/environment.yml +++ b/modules/nf-core/wipertools/fastqscatter/environment.yml @@ -4,4 +4,4 @@ channels: - conda-forge - bioconda dependencies: - - "bioconda::wipertools=1.1.1" + - "bioconda::wipertools=1.1.3" From 29b3e6c118bb06d37528cdd65b50a285e839ad1e Mon Sep 17 00:00:00 2001 From: Tommaso Mazza <69600392+tm4zza@users.noreply.github.com> Date: Tue, 10 Dec 2024 01:20:01 +0100 Subject: [PATCH 03/12] Update fastqgather's environment.yml --- modules/nf-core/wipertools/fastqgather/environment.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 modules/nf-core/wipertools/fastqgather/environment.yml diff --git a/modules/nf-core/wipertools/fastqgather/environment.yml b/modules/nf-core/wipertools/fastqgather/environment.yml new file mode 100644 index 00000000000..0b897be4941 --- /dev/null +++ b/modules/nf-core/wipertools/fastqgather/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::wipertools=1.1.3" From 4cebce89e3038d3fd69aec78e2c441c67705483a Mon Sep 17 00:00:00 2001 From: Tommaso Mazza <69600392+tm4zza@users.noreply.github.com> Date: Tue, 10 Dec 2024 01:20:19 +0100 Subject: [PATCH 04/12] Update environment.yml --- modules/nf-core/wipertools/fastqwiper/environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/wipertools/fastqwiper/environment.yml b/modules/nf-core/wipertools/fastqwiper/environment.yml index a93ca47ef57..0b897be4941 100644 --- a/modules/nf-core/wipertools/fastqwiper/environment.yml +++ b/modules/nf-core/wipertools/fastqwiper/environment.yml @@ -4,4 +4,4 @@ channels: - conda-forge - bioconda dependencies: - - "bioconda::wipertools=1.1.1" + - "bioconda::wipertools=1.1.3" From 8feda404f04a5175002d1e6eeae2d4b2bc9fff39 Mon Sep 17 00:00:00 2001 From: Tommaso Mazza <69600392+tm4zza@users.noreply.github.com> Date: Tue, 10 Dec 2024 01:20:38 +0100 Subject: [PATCH 05/12] Update environment.yml --- modules/nf-core/wipertools/reportgather/environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/wipertools/reportgather/environment.yml b/modules/nf-core/wipertools/reportgather/environment.yml index a93ca47ef57..0b897be4941 100644 --- a/modules/nf-core/wipertools/reportgather/environment.yml +++ b/modules/nf-core/wipertools/reportgather/environment.yml @@ -4,4 +4,4 @@ channels: - conda-forge - bioconda dependencies: - - "bioconda::wipertools=1.1.1" + - "bioconda::wipertools=1.1.3" From 245a3e2409eca361835101126bbf5b19434efd58 Mon Sep 17 00:00:00 2001 From: mazzalab Date: Tue, 10 Dec 2024 08:05:46 +0100 Subject: [PATCH 06/12] fixed linting fastqgather and reportgather --- .../nf-core/wipertools/fastqgather/meta.yml | 6 ++-- .../nf-core/wipertools/fastqwiper/meta.yml | 2 +- .../nf-core/wipertools/reportgather/meta.yml | 32 ++++++++----------- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/modules/nf-core/wipertools/fastqgather/meta.yml b/modules/nf-core/wipertools/fastqgather/meta.yml index 7708e69dc1c..4461d631db3 100644 --- a/modules/nf-core/wipertools/fastqgather/meta.yml +++ b/modules/nf-core/wipertools/fastqgather/meta.yml @@ -23,9 +23,9 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - fastq_folder_in: + - fastq_in: type: file - description: Directory containing FASTQ chunks to be merged + description: List of FASTQ chunk files to be merged pattern: "*.{fastq,fastq.gz}" ontologies: - edam: "http://edamontology.org/format_1930" @@ -37,7 +37,7 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.fastq.gz": + - "*_gather.fastq.gz": type: file description: The resulting FASTQ file pattern: "*.fastq.gz" diff --git a/modules/nf-core/wipertools/fastqwiper/meta.yml b/modules/nf-core/wipertools/fastqwiper/meta.yml index 11245c45973..2bd03b7e6f6 100644 --- a/modules/nf-core/wipertools/fastqwiper/meta.yml +++ b/modules/nf-core/wipertools/fastqwiper/meta.yml @@ -46,7 +46,7 @@ output: - "*.report": type: file description: Summary of the cleaning task - pattern: "*.{txt}" + pattern: "*.report" ontologies: - edam: "http://edamontology.org/format_2330" - versions: diff --git a/modules/nf-core/wipertools/reportgather/meta.yml b/modules/nf-core/wipertools/reportgather/meta.yml index 7708e69dc1c..f713dc86c65 100644 --- a/modules/nf-core/wipertools/reportgather/meta.yml +++ b/modules/nf-core/wipertools/reportgather/meta.yml @@ -1,15 +1,13 @@ # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json -name: "wipertools_fastqgather" -description: A tool of the wipertools suite that merges FASTQ chunks produced by wipertools_fastqscatter +name: "wipertools_reportgather" +description: A tool of the wipertools suite that merges wiping reports generated by wipertools_fastqwiper keywords: - - fastq + - report - merge - union tools: - - "fastqgather": - description: - "A tool of the wipertools suite that merges FASTQ chunks produced\ - \ by wipertools_fastqscatter." + - "reportgather": + description: "A tool of the wipertools suite that merges wiping reports generated by wipertools_fastqwiper." homepage: "https://github.com/mazzalab/fastqwiper" documentation: "https://github.com/mazzalab/fastqwiper" tool_dev_url: "https://github.com/mazzalab/fastqwiper" @@ -23,27 +21,25 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - fastq_folder_in: + - reports: type: file - description: Directory containing FASTQ chunks to be merged - pattern: "*.{fastq,fastq.gz}" + description: List of wiping reports to be merged + pattern: "*.report" ontologies: - - edam: "http://edamontology.org/format_1930" - - edam: "http://edamontology.org/format_3989" + - edam: "http://edamontology.org/format_2330" output: - - fastq_out: + - report_out: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.fastq.gz": + - "*_gathered.report": type: file - description: The resulting FASTQ file - pattern: "*.fastq.gz" + description: The resulting report file + pattern: "*.report" ontologies: - - edam: "http://edamontology.org/format_1930" - - edam: "http://edamontology.org/format_3989" + - edam: "http://edamontology.org/format_2330" - versions: - versions.yml: type: file From fece3b18cd4b551a16ee6d2cfe98f411cef40be4 Mon Sep 17 00:00:00 2001 From: irongraft Date: Tue, 10 Dec 2024 17:29:16 +0100 Subject: [PATCH 07/12] Reply to @famosab review --- .../nf-core/wipertools/fastqgather/main.nf | 8 +- .../nf-core/wipertools/fastqgather/meta.yml | 5 +- .../wipertools/fastqgather/tests/main.nf.test | 13 +-- .../fastqgather/tests/main.nf.test.snap | 42 ---------- .../tests/{base.config => nextflow.config} | 2 +- .../nf-core/wipertools/fastqscatter/main.nf | 12 ++- .../nf-core/wipertools/fastqscatter/meta.yml | 3 +- .../fastqscatter/tests/main.nf.test | 18 ++-- .../fastqscatter/tests/main.nf.test.snap | 50 ----------- .../tests/{base.config => nextflow.config} | 2 +- modules/nf-core/wipertools/fastqwiper/main.nf | 15 ++-- .../nf-core/wipertools/fastqwiper/meta.yml | 5 +- .../wipertools/fastqwiper/tests/main.nf.test | 14 +++- .../fastqwiper/tests/main.nf.test.snap | 84 ------------------- .../tests/{base.config => nextflow.config} | 2 +- .../nf-core/wipertools/reportgather/main.nf | 8 +- .../nf-core/wipertools/reportgather/meta.yml | 5 +- .../reportgather/tests/main.nf.test | 4 +- .../reportgather/tests/main.nf.test.snap | 42 ---------- 19 files changed, 76 insertions(+), 258 deletions(-) delete mode 100644 modules/nf-core/wipertools/fastqgather/tests/main.nf.test.snap rename modules/nf-core/wipertools/fastqgather/tests/{base.config => nextflow.config} (60%) delete mode 100644 modules/nf-core/wipertools/fastqscatter/tests/main.nf.test.snap rename modules/nf-core/wipertools/fastqscatter/tests/{base.config => nextflow.config} (55%) delete mode 100644 modules/nf-core/wipertools/fastqwiper/tests/main.nf.test.snap rename modules/nf-core/wipertools/fastqwiper/tests/{base.config => nextflow.config} (59%) delete mode 100644 modules/nf-core/wipertools/reportgather/tests/main.nf.test.snap diff --git a/modules/nf-core/wipertools/fastqgather/main.nf b/modules/nf-core/wipertools/fastqgather/main.nf index 891d13ae960..6b58aae1a21 100644 --- a/modules/nf-core/wipertools/fastqgather/main.nf +++ b/modules/nf-core/wipertools/fastqgather/main.nf @@ -21,7 +21,11 @@ process WIPERTOOLS_FASTQGATHER { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" """ - wipertools fastqgather -i $fastq_in -o ${prefix}_gather.fastq.gz ${args} + wipertools \\ + fastqgather \\ + -i $fastq_in \\ + -o ${prefix}_gather.fastq.gz \\ + ${args} cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -32,7 +36,7 @@ process WIPERTOOLS_FASTQGATHER { stub: def prefix = task.ext.prefix ?: "${meta.id}" """ - echo -e "@ERR001268.2 080821_HWI-EAS301_0002_30ALBAAXX:1:1:1090:1998/1" > ${prefix}_gather.fastq | gzip -c > ${prefix}_gather.fastq.gz + echo "" | gzip > ${prefix}_gather.fastq.gz cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/wipertools/fastqgather/meta.yml b/modules/nf-core/wipertools/fastqgather/meta.yml index 4461d631db3..a038b464949 100644 --- a/modules/nf-core/wipertools/fastqgather/meta.yml +++ b/modules/nf-core/wipertools/fastqgather/meta.yml @@ -16,13 +16,14 @@ tools: doi: "no DOI available" licence: ["GPL v2-or-later"] identifier: "" + args_id: "$args" input: - - meta: type: map description: | Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] + e.g. [ id:'test' ] - fastq_in: type: file description: List of FASTQ chunk files to be merged @@ -36,7 +37,7 @@ output: type: map description: | Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] + e.g. [ id:'test' ] - "*_gather.fastq.gz": type: file description: The resulting FASTQ file diff --git a/modules/nf-core/wipertools/fastqgather/tests/main.nf.test b/modules/nf-core/wipertools/fastqgather/tests/main.nf.test index 92831d4190f..fa9deb11054 100644 --- a/modules/nf-core/wipertools/fastqgather/tests/main.nf.test +++ b/modules/nf-core/wipertools/fastqgather/tests/main.nf.test @@ -12,11 +12,11 @@ nextflow_process { test("merge two gzipped fastq - fastq.gz") { - config "./base.config" + config "./nextflow.config" when { params { - outdir = "$outputDir" + module_args = '--prefix pp_' } process { """ @@ -32,7 +32,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.fastq_out, process.out.versions).match() } + { assert snapshot(process.out).match() } ) } @@ -41,9 +41,12 @@ nextflow_process { test("merge two gzipped fastq - fastq.gz - stub") { options "-stub" - config "./base.config" + config "./nextflow.config" when { + params { + module_args = '--prefix pp_' + } process { """ input[0] = [ @@ -58,7 +61,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.fastq_out, process.out.versions).match() } + { assert snapshot(process.out).match() } ) } } diff --git a/modules/nf-core/wipertools/fastqgather/tests/main.nf.test.snap b/modules/nf-core/wipertools/fastqgather/tests/main.nf.test.snap deleted file mode 100644 index 53956d06450..00000000000 --- a/modules/nf-core/wipertools/fastqgather/tests/main.nf.test.snap +++ /dev/null @@ -1,42 +0,0 @@ -{ - "merge two gzipped fastq - fastq.gz - stub": { - "content": [ - [ - [ - { - "id": "fastq_chunks" - }, - "fastq_chunks_gather.fastq.gz:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - [ - "versions.yml:md5,291a2e6d58146bfcf57b4d9ef850cbd9" - ] - ], - "meta": { - "nf-test": "0.9.2", - "nextflow": "24.10.1" - }, - "timestamp": "2024-12-09T23:41:07.264741" - }, - "merge two gzipped fastq - fastq.gz": { - "content": [ - [ - [ - { - "id": "fastq_chunks" - }, - "fastq_chunks_gather.fastq.gz:md5,5ba7f1c78e2f6c979b8b88494a08977a" - ] - ], - [ - "versions.yml:md5,291a2e6d58146bfcf57b4d9ef850cbd9" - ] - ], - "meta": { - "nf-test": "0.9.2", - "nextflow": "24.10.1" - }, - "timestamp": "2024-12-09T23:40:55.88226" - } -} \ No newline at end of file diff --git a/modules/nf-core/wipertools/fastqgather/tests/base.config b/modules/nf-core/wipertools/fastqgather/tests/nextflow.config similarity index 60% rename from modules/nf-core/wipertools/fastqgather/tests/base.config rename to modules/nf-core/wipertools/fastqgather/tests/nextflow.config index 1d919dd69b7..ce94189f370 100644 --- a/modules/nf-core/wipertools/fastqgather/tests/base.config +++ b/modules/nf-core/wipertools/fastqgather/tests/nextflow.config @@ -1,5 +1,5 @@ process { withName: WIPERTOOLS_FASTQGATHER { - ext.args = '--prefix pp_' + ext.args = params.module_args } } diff --git a/modules/nf-core/wipertools/fastqscatter/main.nf b/modules/nf-core/wipertools/fastqscatter/main.nf index f690ecb2fb5..a1e4b862a1b 100644 --- a/modules/nf-core/wipertools/fastqscatter/main.nf +++ b/modules/nf-core/wipertools/fastqscatter/main.nf @@ -23,9 +23,13 @@ process WIPERTOOLS_FASTQSCATTER { def prefix = task.ext.prefix ?: "${meta.id}" def args_list = args.tokenize() out_folder = (args_list.contains('--out_folder') ? args_list[args_list.indexOf('--out_folder')+1] : (args_list.contains('-o') ? args_list[args_list.indexOf('-o')+1] : 'chunks')) - """ - wipertools fastqscatter -f ${fastq} -n ${num_splits} -p ${prefix} ${args} + wipertools \\ + fastqscatter \\ + -f ${fastq} \\ + -n ${num_splits} \\ + -p ${prefix} \\ + ${args} cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -40,8 +44,8 @@ process WIPERTOOLS_FASTQSCATTER { out_folder = (args_list.contains('--out_folder') ? args_list[args_list.indexOf('--out_folder')+1] : (args_list.contains('-o') ? args_list[args_list.indexOf('-o')+1] : 'chunks')) """ mkdir ${out_folder} - echo -e "@ERR001268.1 080821_HWI-EAS301_0002_30ALBAAXX:1:1:1090:1998/1" > ${out_folder}/prefix_1-of-2_suffix.fastq - echo -e "@ERR001268.2 080821_HWI-EAS301_0002_30ALBAAXX:1:1:1090:1998/2" > ${out_folder}/prefix_2-of-2_suffix.fastq + echo -e "@ERR001268.1 080821_HWI-EAS301_0002_30ALBAAXX:1:1:1090:1998/1" > ${out_folder}/${prefix}_1-of-2_suffix.fastq + echo -e "@ERR001268.2 080821_HWI-EAS301_0002_30ALBAAXX:1:1:1090:1998/2" > ${out_folder}/${prefix}_2-of-2_suffix.fastq cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/wipertools/fastqscatter/meta.yml b/modules/nf-core/wipertools/fastqscatter/meta.yml index 6a2ca0b4a5b..ee7ffaff307 100644 --- a/modules/nf-core/wipertools/fastqscatter/meta.yml +++ b/modules/nf-core/wipertools/fastqscatter/meta.yml @@ -14,6 +14,7 @@ tools: doi: "no DOI available" licence: ["GPL v2-or-later"] identifier: "" + args_id: "$args" input: - - meta: @@ -38,7 +39,7 @@ output: type: map description: | Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] + e.g. [ id:'test' ] - "${out_folder}/*": type: file description: Chunk FASTQ files diff --git a/modules/nf-core/wipertools/fastqscatter/tests/main.nf.test b/modules/nf-core/wipertools/fastqscatter/tests/main.nf.test index 017ec212245..5dc8b034664 100644 --- a/modules/nf-core/wipertools/fastqscatter/tests/main.nf.test +++ b/modules/nf-core/wipertools/fastqscatter/tests/main.nf.test @@ -11,13 +11,16 @@ nextflow_process { test("3 reads, one truncated - fastq") { - config "./base.config" + config "./nextflow.config" when { + params { + module_args = '-o chunks_custom -O unix' + } process { """ input[0] = [ - [ id:'test', single_end:false ], // meta map + [ id:'test' ], // meta map file('https://raw.githubusercontent.com/nf-core/test-datasets/fastqrepair/testdata/truncated_clean.fastq', checkIfExists: true), ] input[1] = 2 // splits num @@ -28,7 +31,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.chunks, process.out.versions).match() } + { assert snapshot(process.out).match() } ) } @@ -37,13 +40,16 @@ nextflow_process { test("3 reads, one truncated - fastq - stub") { options "-stub" - config "./base.config" + config "./nextflow.config" when { + params { + module_args = '-o chunks_custom -O unix' + } process { """ input[0] = [ - [ id:'test', single_end:true ], + [ id:'test' ], file('https://raw.githubusercontent.com/nf-core/test-datasets/fastqrepair/testdata/truncated_clean.fastq', checkIfExists: true), ] input[1] = 2 // splits num @@ -54,7 +60,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.chunks, process.out.versions).match() } + { assert snapshot(process.out).match() } ) } diff --git a/modules/nf-core/wipertools/fastqscatter/tests/main.nf.test.snap b/modules/nf-core/wipertools/fastqscatter/tests/main.nf.test.snap deleted file mode 100644 index 0d897c33a9e..00000000000 --- a/modules/nf-core/wipertools/fastqscatter/tests/main.nf.test.snap +++ /dev/null @@ -1,50 +0,0 @@ -{ - "3 reads, one truncated - fastq": { - "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, - [ - "test_000.fastq.gz:md5,6ceafda8be51f7cba017123728261162", - "test_001.fastq.gz:md5,572033e56b4e644e704e3c83652e06cc" - ] - ] - ], - [ - "versions.yml:md5,c8e701c1048cc9ab79752d1bf631ad4b" - ] - ], - "meta": { - "nf-test": "0.9.2", - "nextflow": "24.10.1" - }, - "timestamp": "2024-12-09T23:41:16.411715" - }, - "3 reads, one truncated - fastq - stub": { - "content": [ - [ - [ - { - "id": "test", - "single_end": true - }, - [ - "prefix_1-of-2_suffix.fastq:md5,40e2f90cf50b26b1ce397766aa89a8c7", - "prefix_2-of-2_suffix.fastq:md5,ef3ef34999313c60f22a25e90bb154db" - ] - ] - ], - [ - "versions.yml:md5,c8e701c1048cc9ab79752d1bf631ad4b" - ] - ], - "meta": { - "nf-test": "0.9.2", - "nextflow": "24.10.1" - }, - "timestamp": "2024-12-09T23:41:24.523993" - } -} \ No newline at end of file diff --git a/modules/nf-core/wipertools/fastqscatter/tests/base.config b/modules/nf-core/wipertools/fastqscatter/tests/nextflow.config similarity index 55% rename from modules/nf-core/wipertools/fastqscatter/tests/base.config rename to modules/nf-core/wipertools/fastqscatter/tests/nextflow.config index f6229e0ceb1..c4b8951da86 100644 --- a/modules/nf-core/wipertools/fastqscatter/tests/base.config +++ b/modules/nf-core/wipertools/fastqscatter/tests/nextflow.config @@ -1,5 +1,5 @@ process { withName: WIPERTOOLS_FASTQSCATTER { - ext.args = '-o chunks_custom -O unix' + ext.args = params.module_args } } diff --git a/modules/nf-core/wipertools/fastqwiper/main.nf b/modules/nf-core/wipertools/fastqwiper/main.nf index 85f940611d7..2527623c0f2 100644 --- a/modules/nf-core/wipertools/fastqwiper/main.nf +++ b/modules/nf-core/wipertools/fastqwiper/main.nf @@ -11,9 +11,9 @@ process WIPERTOOLS_FASTQWIPER { tuple val(meta), path(fastq_in) output: - tuple val(meta), path("${meta.id}*_wiped.fastq.gz") , emit: fastq_out - path("*.report") , emit: report - path "versions.yml" , emit: versions + tuple val(meta), path("*_wiped.fastq.gz") , emit: fastq_out + path("*.report") , emit: report + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -24,7 +24,12 @@ process WIPERTOOLS_FASTQWIPER { def fastq_out = prefix.endsWith('.fastq.gz') ? prefix.replaceAll(/\.fastq.gz$/, '_wiped.fastq.gz') : (prefix.endsWith('.fastq') ? prefix.replaceAll(/\.fastq$/, '_wiped.fastq.gz') : prefix + "_wiped.fastq.gz") def report_file = prefix + ".report" """ - wipertools fastqwiper -i ${fastq_in} -o ${fastq_out} -r ${report_file} ${args} + wipertools \\ + fastqwiper \\ + -i ${fastq_in} \\ + -o ${fastq_out} \\ + -r ${report_file} \\ + ${args} cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -35,7 +40,7 @@ process WIPERTOOLS_FASTQWIPER { stub: def prefix = task.ext.prefix ?: "${meta.id}" """ - echo -e "@ERR001268.2 CLEAN_READ_HEADER_ONLY_30ALBAAXX:1:1:1090:1998/1" > ${prefix}_wiped.fastq | gzip -c > ${prefix}_wiped.fastq.gz + echo "" | gzip > ${prefix}_wiped.fastq.gz touch ${prefix}.report cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/wipertools/fastqwiper/meta.yml b/modules/nf-core/wipertools/fastqwiper/meta.yml index 2bd03b7e6f6..33316814cbd 100644 --- a/modules/nf-core/wipertools/fastqwiper/meta.yml +++ b/modules/nf-core/wipertools/fastqwiper/meta.yml @@ -14,13 +14,14 @@ tools: doi: "no DOI available" licence: ["GPL v2-or-later"] identifier: "" + args_id: "$args" input: - - meta: type: map description: | Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] + e.g. [ id:'test' ] - fastq_in: type: file description: FASTQ file to be cleaned @@ -34,7 +35,7 @@ output: type: map description: | Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] + e.g. [ id:'test' ] - "${meta.id}*_wiped.fastq.gz": type: file description: Cleaned FASTQ file diff --git a/modules/nf-core/wipertools/fastqwiper/tests/main.nf.test b/modules/nf-core/wipertools/fastqwiper/tests/main.nf.test index f629c0afec5..7f6703854a8 100644 --- a/modules/nf-core/wipertools/fastqwiper/tests/main.nf.test +++ b/modules/nf-core/wipertools/fastqwiper/tests/main.nf.test @@ -11,13 +11,16 @@ nextflow_process { test("30 paired-end reads - fastq") { - config "./base.config" + config "./nextflow.config" when { + params { + module_args = '-a ACGT' + } process { """ input[0] = [ - [ id:'test', single_end:true ], + [ id:'test' ], file('https://raw.githubusercontent.com/nf-core/test-datasets/fastqrepair/testdata/truncated_clean.fastq', checkIfExists: true), ] """ @@ -36,13 +39,16 @@ nextflow_process { test("30 paired-end reads - fastq - stub") { options "-stub" - config "./base.config" + config "./nextflow.config" when { + params { + module_args = '-a ACGT' + } process { """ input[0] = [ - [ id:'test', single_end:true ], + [ id:'test' ], file('https://raw.githubusercontent.com/nf-core/test-datasets/fastqrepair/testdata/truncated_clean.fastq', checkIfExists: true), ] """ diff --git a/modules/nf-core/wipertools/fastqwiper/tests/main.nf.test.snap b/modules/nf-core/wipertools/fastqwiper/tests/main.nf.test.snap deleted file mode 100644 index e7feb95e488..00000000000 --- a/modules/nf-core/wipertools/fastqwiper/tests/main.nf.test.snap +++ /dev/null @@ -1,84 +0,0 @@ -{ - "30 paired-end reads - fastq - stub": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": true - }, - "test_wiped.fastq.gz:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "1": [ - "test.report:md5,d41d8cd98f00b204e9800998ecf8427e" - ], - "2": [ - "versions.yml:md5,1f9b92c604ab68e45c7926be59cf18d9" - ], - "fastq_out": [ - [ - { - "id": "test", - "single_end": true - }, - "test_wiped.fastq.gz:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "report": [ - "test.report:md5,d41d8cd98f00b204e9800998ecf8427e" - ], - "versions": [ - "versions.yml:md5,1f9b92c604ab68e45c7926be59cf18d9" - ] - } - ], - "meta": { - "nf-test": "0.9.2", - "nextflow": "24.10.1" - }, - "timestamp": "2024-12-09T23:41:46.028429" - }, - "30 paired-end reads - fastq": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": true - }, - "test_wiped.fastq.gz:md5,d07cb1aacfd7a67aa0c85633eaef1c90" - ] - ], - "1": [ - "test.report:md5,3d2cfb8d7b72afe9b88663cf9dbf8129" - ], - "2": [ - "versions.yml:md5,1f9b92c604ab68e45c7926be59cf18d9" - ], - "fastq_out": [ - [ - { - "id": "test", - "single_end": true - }, - "test_wiped.fastq.gz:md5,d07cb1aacfd7a67aa0c85633eaef1c90" - ] - ], - "report": [ - "test.report:md5,3d2cfb8d7b72afe9b88663cf9dbf8129" - ], - "versions": [ - "versions.yml:md5,1f9b92c604ab68e45c7926be59cf18d9" - ] - } - ], - "meta": { - "nf-test": "0.9.2", - "nextflow": "24.10.1" - }, - "timestamp": "2024-12-09T23:41:36.186246" - } -} \ No newline at end of file diff --git a/modules/nf-core/wipertools/fastqwiper/tests/base.config b/modules/nf-core/wipertools/fastqwiper/tests/nextflow.config similarity index 59% rename from modules/nf-core/wipertools/fastqwiper/tests/base.config rename to modules/nf-core/wipertools/fastqwiper/tests/nextflow.config index 8da4159a39a..916a0d06e28 100644 --- a/modules/nf-core/wipertools/fastqwiper/tests/base.config +++ b/modules/nf-core/wipertools/fastqwiper/tests/nextflow.config @@ -1,5 +1,5 @@ process { withName: WIPERTOOLS_FASTQWIPER { - ext.args = '-a ACGT' + ext.args = params.module_args } } diff --git a/modules/nf-core/wipertools/reportgather/main.nf b/modules/nf-core/wipertools/reportgather/main.nf index 740147cfeac..6a534b38739 100644 --- a/modules/nf-core/wipertools/reportgather/main.nf +++ b/modules/nf-core/wipertools/reportgather/main.nf @@ -21,7 +21,11 @@ process WIPERTOOLS_REPORTGATHER { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" """ - wipertools reportgather -r $reports -f ${prefix}_gathered.report ${args} + wipertools \\ + reportgather \\ + -r $reports \\ + -f ${prefix}_gathered.report \\ + ${args} cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -32,7 +36,7 @@ process WIPERTOOLS_REPORTGATHER { stub: def prefix = task.ext.prefix ?: "${meta.id}" """ - echo -e "GATHERED REPORT FROM MANY REPORTS" > ${prefix}_gathered.report + touch ${prefix}_gathered.report cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/wipertools/reportgather/meta.yml b/modules/nf-core/wipertools/reportgather/meta.yml index f713dc86c65..6bcabe9e1e4 100644 --- a/modules/nf-core/wipertools/reportgather/meta.yml +++ b/modules/nf-core/wipertools/reportgather/meta.yml @@ -14,13 +14,14 @@ tools: doi: "no DOI available" licence: ["GPL v2-or-later"] identifier: "" + args_id: "$args" input: - - meta: type: map description: | Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] + e.g. [ id:'test' ] - reports: type: file description: List of wiping reports to be merged @@ -33,7 +34,7 @@ output: type: map description: | Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] + e.g. [ id:'test' ] - "*_gathered.report": type: file description: The resulting report file diff --git a/modules/nf-core/wipertools/reportgather/tests/main.nf.test b/modules/nf-core/wipertools/reportgather/tests/main.nf.test index b0b104eaefe..c95e38a376e 100644 --- a/modules/nf-core/wipertools/reportgather/tests/main.nf.test +++ b/modules/nf-core/wipertools/reportgather/tests/main.nf.test @@ -30,7 +30,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.report_out, process.out.versions).match() } + { assert snapshot(process.out).match() } ) } @@ -55,7 +55,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.report_out, process.out.versions).match() } + { assert snapshot(process.out).match() } ) } } diff --git a/modules/nf-core/wipertools/reportgather/tests/main.nf.test.snap b/modules/nf-core/wipertools/reportgather/tests/main.nf.test.snap deleted file mode 100644 index c44e34f99a2..00000000000 --- a/modules/nf-core/wipertools/reportgather/tests/main.nf.test.snap +++ /dev/null @@ -1,42 +0,0 @@ -{ - "merge two tar-gzipped reports - .tar.gz - stub": { - "content": [ - [ - [ - { - "id": "report_chunks" - }, - "report_chunks_gathered.report:md5,4dda98ea02f3579364e6ab2053bf8a96" - ] - ], - [ - "versions.yml:md5,8f315851a1d3b7a1bb186ab41e7675df" - ] - ], - "meta": { - "nf-test": "0.9.2", - "nextflow": "24.10.1" - }, - "timestamp": "2024-12-09T23:42:07.686856" - }, - "merge two tar-gzipped reports - .tar.gz": { - "content": [ - [ - [ - { - "id": "report_chunks" - }, - "report_chunks_gathered.report:md5,f64b18d0593c937dfac76b2a415bb58c" - ] - ], - [ - "versions.yml:md5,8f315851a1d3b7a1bb186ab41e7675df" - ] - ], - "meta": { - "nf-test": "0.9.2", - "nextflow": "24.10.1" - }, - "timestamp": "2024-12-09T23:41:55.525228" - } -} \ No newline at end of file From f91c2332b678f6dd102ca6a4344bca653e407dca Mon Sep 17 00:00:00 2001 From: mazzalab Date: Tue, 10 Dec 2024 20:45:56 +0100 Subject: [PATCH 08/12] updated meta.yml if fastqscatter --- modules/nf-core/wipertools/fastqscatter/meta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/wipertools/fastqscatter/meta.yml b/modules/nf-core/wipertools/fastqscatter/meta.yml index ee7ffaff307..445323317e5 100644 --- a/modules/nf-core/wipertools/fastqscatter/meta.yml +++ b/modules/nf-core/wipertools/fastqscatter/meta.yml @@ -21,7 +21,7 @@ input: type: map description: | Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] + e.g. [ id:'test' ] - fastq: type: file description: FASTQ file From 9768bed4edabf73bbf16493a6db22a0a388cc3fb Mon Sep 17 00:00:00 2001 From: mazzalab Date: Tue, 10 Dec 2024 21:08:44 +0100 Subject: [PATCH 09/12] Fix fastqwiper linting and add snapshots --- .../fastqgather/tests/main.nf.test.snap | 68 ++++++++++++++++ .../fastqscatter/tests/main.nf.test.snap | 80 +++++++++++++++++++ .../nf-core/wipertools/fastqwiper/meta.yml | 2 +- .../fastqwiper/tests/main.nf.test.snap | 80 +++++++++++++++++++ .../reportgather/tests/main.nf.test.snap | 68 ++++++++++++++++ 5 files changed, 297 insertions(+), 1 deletion(-) create mode 100644 modules/nf-core/wipertools/fastqgather/tests/main.nf.test.snap create mode 100644 modules/nf-core/wipertools/fastqscatter/tests/main.nf.test.snap create mode 100644 modules/nf-core/wipertools/fastqwiper/tests/main.nf.test.snap create mode 100644 modules/nf-core/wipertools/reportgather/tests/main.nf.test.snap diff --git a/modules/nf-core/wipertools/fastqgather/tests/main.nf.test.snap b/modules/nf-core/wipertools/fastqgather/tests/main.nf.test.snap new file mode 100644 index 00000000000..1eee2837718 --- /dev/null +++ b/modules/nf-core/wipertools/fastqgather/tests/main.nf.test.snap @@ -0,0 +1,68 @@ +{ + "merge two gzipped fastq - fastq.gz - stub": { + "content": [ + { + "0": [ + [ + { + "id": "fastq_chunks" + }, + "fastq_chunks_gather.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + "versions.yml:md5,291a2e6d58146bfcf57b4d9ef850cbd9" + ], + "fastq_out": [ + [ + { + "id": "fastq_chunks" + }, + "fastq_chunks_gather.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,291a2e6d58146bfcf57b4d9ef850cbd9" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-12-10T19:58:18.932027" + }, + "merge two gzipped fastq - fastq.gz": { + "content": [ + { + "0": [ + [ + { + "id": "fastq_chunks" + }, + "fastq_chunks_gather.fastq.gz:md5,5ba7f1c78e2f6c979b8b88494a08977a" + ] + ], + "1": [ + "versions.yml:md5,291a2e6d58146bfcf57b4d9ef850cbd9" + ], + "fastq_out": [ + [ + { + "id": "fastq_chunks" + }, + "fastq_chunks_gather.fastq.gz:md5,5ba7f1c78e2f6c979b8b88494a08977a" + ] + ], + "versions": [ + "versions.yml:md5,291a2e6d58146bfcf57b4d9ef850cbd9" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-12-10T19:58:08.384361" + } +} \ No newline at end of file diff --git a/modules/nf-core/wipertools/fastqscatter/tests/main.nf.test.snap b/modules/nf-core/wipertools/fastqscatter/tests/main.nf.test.snap new file mode 100644 index 00000000000..b57e41771d3 --- /dev/null +++ b/modules/nf-core/wipertools/fastqscatter/tests/main.nf.test.snap @@ -0,0 +1,80 @@ +{ + "3 reads, one truncated - fastq": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + "test_000.fastq.gz:md5,6ceafda8be51f7cba017123728261162", + "test_001.fastq.gz:md5,572033e56b4e644e704e3c83652e06cc" + ] + ] + ], + "1": [ + "versions.yml:md5,c8e701c1048cc9ab79752d1bf631ad4b" + ], + "chunks": [ + [ + { + "id": "test" + }, + [ + "test_000.fastq.gz:md5,6ceafda8be51f7cba017123728261162", + "test_001.fastq.gz:md5,572033e56b4e644e704e3c83652e06cc" + ] + ] + ], + "versions": [ + "versions.yml:md5,c8e701c1048cc9ab79752d1bf631ad4b" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-12-10T19:58:30.47855" + }, + "3 reads, one truncated - fastq - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + "test_1-of-2_suffix.fastq:md5,40e2f90cf50b26b1ce397766aa89a8c7", + "test_2-of-2_suffix.fastq:md5,ef3ef34999313c60f22a25e90bb154db" + ] + ] + ], + "1": [ + "versions.yml:md5,c8e701c1048cc9ab79752d1bf631ad4b" + ], + "chunks": [ + [ + { + "id": "test" + }, + [ + "test_1-of-2_suffix.fastq:md5,40e2f90cf50b26b1ce397766aa89a8c7", + "test_2-of-2_suffix.fastq:md5,ef3ef34999313c60f22a25e90bb154db" + ] + ] + ], + "versions": [ + "versions.yml:md5,c8e701c1048cc9ab79752d1bf631ad4b" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-12-10T19:58:41.665555" + } +} \ No newline at end of file diff --git a/modules/nf-core/wipertools/fastqwiper/meta.yml b/modules/nf-core/wipertools/fastqwiper/meta.yml index 33316814cbd..20d1a7985c2 100644 --- a/modules/nf-core/wipertools/fastqwiper/meta.yml +++ b/modules/nf-core/wipertools/fastqwiper/meta.yml @@ -36,7 +36,7 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test' ] - - "${meta.id}*_wiped.fastq.gz": + - "*_wiped.fastq.gz": type: file description: Cleaned FASTQ file pattern: "*.{fastq,fastq.gz}" diff --git a/modules/nf-core/wipertools/fastqwiper/tests/main.nf.test.snap b/modules/nf-core/wipertools/fastqwiper/tests/main.nf.test.snap new file mode 100644 index 00000000000..70669471325 --- /dev/null +++ b/modules/nf-core/wipertools/fastqwiper/tests/main.nf.test.snap @@ -0,0 +1,80 @@ +{ + "30 paired-end reads - fastq - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_wiped.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + "test.report:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + "2": [ + "versions.yml:md5,1f9b92c604ab68e45c7926be59cf18d9" + ], + "fastq_out": [ + [ + { + "id": "test" + }, + "test_wiped.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "report": [ + "test.report:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + "versions": [ + "versions.yml:md5,1f9b92c604ab68e45c7926be59cf18d9" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-12-10T19:59:06.012186" + }, + "30 paired-end reads - fastq": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_wiped.fastq.gz:md5,d07cb1aacfd7a67aa0c85633eaef1c90" + ] + ], + "1": [ + "test.report:md5,3d2cfb8d7b72afe9b88663cf9dbf8129" + ], + "2": [ + "versions.yml:md5,1f9b92c604ab68e45c7926be59cf18d9" + ], + "fastq_out": [ + [ + { + "id": "test" + }, + "test_wiped.fastq.gz:md5,d07cb1aacfd7a67aa0c85633eaef1c90" + ] + ], + "report": [ + "test.report:md5,3d2cfb8d7b72afe9b88663cf9dbf8129" + ], + "versions": [ + "versions.yml:md5,1f9b92c604ab68e45c7926be59cf18d9" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-12-10T19:58:54.225392" + } +} \ No newline at end of file diff --git a/modules/nf-core/wipertools/reportgather/tests/main.nf.test.snap b/modules/nf-core/wipertools/reportgather/tests/main.nf.test.snap new file mode 100644 index 00000000000..ada5c517454 --- /dev/null +++ b/modules/nf-core/wipertools/reportgather/tests/main.nf.test.snap @@ -0,0 +1,68 @@ +{ + "merge two tar-gzipped reports - .tar.gz - stub": { + "content": [ + { + "0": [ + [ + { + "id": "report_chunks" + }, + "report_chunks_gathered.report:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,8f315851a1d3b7a1bb186ab41e7675df" + ], + "report_out": [ + [ + { + "id": "report_chunks" + }, + "report_chunks_gathered.report:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,8f315851a1d3b7a1bb186ab41e7675df" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-12-10T19:59:31.262349" + }, + "merge two tar-gzipped reports - .tar.gz": { + "content": [ + { + "0": [ + [ + { + "id": "report_chunks" + }, + "report_chunks_gathered.report:md5,f64b18d0593c937dfac76b2a415bb58c" + ] + ], + "1": [ + "versions.yml:md5,8f315851a1d3b7a1bb186ab41e7675df" + ], + "report_out": [ + [ + { + "id": "report_chunks" + }, + "report_chunks_gathered.report:md5,f64b18d0593c937dfac76b2a415bb58c" + ] + ], + "versions": [ + "versions.yml:md5,8f315851a1d3b7a1bb186ab41e7675df" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-12-10T19:59:18.765654" + } +} \ No newline at end of file From 48895f76cde32b36778ab15befdf9235eff96179 Mon Sep 17 00:00:00 2001 From: mazzalab Date: Wed, 11 Dec 2024 21:36:16 +0100 Subject: [PATCH 10/12] Fixed paths in WIPERTOOLS_FASTQGATHER's tests --- .../wipertools/fastqgather/tests/main.nf.test | 43 ++++++++++++++----- .../fastqgather/tests/main.nf.test.snap | 8 ++-- 2 files changed, 36 insertions(+), 15 deletions(-) diff --git a/modules/nf-core/wipertools/fastqgather/tests/main.nf.test b/modules/nf-core/wipertools/fastqgather/tests/main.nf.test index fa9deb11054..7822fcbdc09 100644 --- a/modules/nf-core/wipertools/fastqgather/tests/main.nf.test +++ b/modules/nf-core/wipertools/fastqgather/tests/main.nf.test @@ -8,23 +8,33 @@ nextflow_process { tag "modules_nfcore" tag "wipertools" tag "wipertools/fastqgather" - tag "untar" test("merge two gzipped fastq - fastq.gz") { config "./nextflow.config" + setup { + run("WIPERTOOLS_FASTQSCATTER") { + script "../../fastqscatter/main.nf" + process { + """ + input[0] = [ + [ id:'pp_' ], // meta map + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_1.fastq.gz", checkIfExists: true) + ] + input[1] = 2 // number of splits + """ + } + } + } + when { params { module_args = '--prefix pp_' } process { """ - input[0] = [ - [id: 'fastq_chunks'], - [file('https://raw.githubusercontent.com/nf-core/test-datasets/fastqrepair/testdata/pp_1-of-2_ss.fastq.gz', checkIfExists: true), - file('https://raw.githubusercontent.com/nf-core/test-datasets/fastqrepair/testdata/pp_2-of-2_ss.fastq.gz', checkIfExists: true)] - ] + input[0] = WIPERTOOLS_FASTQSCATTER.out.chunks.map { tuple( [id: 'fastq_chunks'], it[1] ) } """ } } @@ -43,17 +53,28 @@ nextflow_process { options "-stub" config "./nextflow.config" + setup { + run("WIPERTOOLS_FASTQSCATTER") { + script "../../fastqscatter/main.nf" + process { + """ + input[0] = [ + [ id:'pp_' ], // meta map + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_1.fastq.gz", checkIfExists: true) + ] + input[1] = 2 // number of splits + """ + } + } + } + when { params { module_args = '--prefix pp_' } process { """ - input[0] = [ - [id: 'fastq_chunks'], - [file('https://raw.githubusercontent.com/nf-core/test-datasets/fastqrepair/testdata/pp_1-of-2_ss.fastq.gz', checkIfExists: true), - file('https://raw.githubusercontent.com/nf-core/test-datasets/fastqrepair/testdata/pp_2-of-2_ss.fastq.gz', checkIfExists: true)] - ] + input[0] = WIPERTOOLS_FASTQSCATTER.out.chunks.map { tuple( [id: 'fastq_chunks'], it[1] ) } """ } } diff --git a/modules/nf-core/wipertools/fastqgather/tests/main.nf.test.snap b/modules/nf-core/wipertools/fastqgather/tests/main.nf.test.snap index 1eee2837718..df36c93df69 100644 --- a/modules/nf-core/wipertools/fastqgather/tests/main.nf.test.snap +++ b/modules/nf-core/wipertools/fastqgather/tests/main.nf.test.snap @@ -30,7 +30,7 @@ "nf-test": "0.9.2", "nextflow": "24.10.1" }, - "timestamp": "2024-12-10T19:58:18.932027" + "timestamp": "2024-12-11T20:28:51.132317" }, "merge two gzipped fastq - fastq.gz": { "content": [ @@ -40,7 +40,7 @@ { "id": "fastq_chunks" }, - "fastq_chunks_gather.fastq.gz:md5,5ba7f1c78e2f6c979b8b88494a08977a" + "fastq_chunks_gather.fastq.gz:md5,eedbbe1317d4d464da30d56cff7d677e" ] ], "1": [ @@ -51,7 +51,7 @@ { "id": "fastq_chunks" }, - "fastq_chunks_gather.fastq.gz:md5,5ba7f1c78e2f6c979b8b88494a08977a" + "fastq_chunks_gather.fastq.gz:md5,eedbbe1317d4d464da30d56cff7d677e" ] ], "versions": [ @@ -63,6 +63,6 @@ "nf-test": "0.9.2", "nextflow": "24.10.1" }, - "timestamp": "2024-12-10T19:58:08.384361" + "timestamp": "2024-12-11T20:28:40.144022" } } \ No newline at end of file From 5b2f7f0889e5ccfac5a9a8f95d85704f58e4824b Mon Sep 17 00:00:00 2001 From: MazzaLab Date: Wed, 11 Dec 2024 22:10:49 +0100 Subject: [PATCH 11/12] Update main.nf.test --- modules/nf-core/wipertools/fastqgather/tests/main.nf.test | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/nf-core/wipertools/fastqgather/tests/main.nf.test b/modules/nf-core/wipertools/fastqgather/tests/main.nf.test index 7822fcbdc09..303ecada360 100644 --- a/modules/nf-core/wipertools/fastqgather/tests/main.nf.test +++ b/modules/nf-core/wipertools/fastqgather/tests/main.nf.test @@ -8,6 +8,7 @@ nextflow_process { tag "modules_nfcore" tag "wipertools" tag "wipertools/fastqgather" + tag "wipertools/fastqscatter" test("merge two gzipped fastq - fastq.gz") { From 9c22c75b0a8d5305440c443c56ce51895124f145 Mon Sep 17 00:00:00 2001 From: irongraft Date: Fri, 13 Dec 2024 16:55:02 +0100 Subject: [PATCH 12/12] Fixed tests --- .../wipertools/fastqgather/tests/main.nf.test | 48 ++++++------------- .../fastqgather/tests/main.nf.test.snap | 8 ++-- .../nf-core/wipertools/fastqscatter/main.nf | 4 +- .../fastqscatter/tests/main.nf.test | 4 +- .../fastqscatter/tests/main.nf.test.snap | 24 +++++----- 5 files changed, 35 insertions(+), 53 deletions(-) diff --git a/modules/nf-core/wipertools/fastqgather/tests/main.nf.test b/modules/nf-core/wipertools/fastqgather/tests/main.nf.test index 303ecada360..8691aa1c304 100644 --- a/modules/nf-core/wipertools/fastqgather/tests/main.nf.test +++ b/modules/nf-core/wipertools/fastqgather/tests/main.nf.test @@ -10,24 +10,23 @@ nextflow_process { tag "wipertools/fastqgather" tag "wipertools/fastqscatter" - test("merge two gzipped fastq - fastq.gz") { - - config "./nextflow.config" - - setup { - run("WIPERTOOLS_FASTQSCATTER") { - script "../../fastqscatter/main.nf" - process { - """ - input[0] = [ - [ id:'pp_' ], // meta map - file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_1.fastq.gz", checkIfExists: true) - ] - input[1] = 2 // number of splits - """ - } + setup { + run("WIPERTOOLS_FASTQSCATTER") { + script "../../fastqscatter/main.nf" + process { + """ + input[0] = [ + [ id:'pp_' ], // meta map + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_1.fastq.gz", checkIfExists: true) + ] + input[1] = 2 // number of splits + """ } } + } + + test("merge two gzipped fastq - fastq.gz") { + config "./nextflow.config" when { params { @@ -39,7 +38,6 @@ nextflow_process { """ } } - then { assertAll( { assert process.success }, @@ -50,25 +48,9 @@ nextflow_process { } test("merge two gzipped fastq - fastq.gz - stub") { - options "-stub" config "./nextflow.config" - setup { - run("WIPERTOOLS_FASTQSCATTER") { - script "../../fastqscatter/main.nf" - process { - """ - input[0] = [ - [ id:'pp_' ], // meta map - file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_1.fastq.gz", checkIfExists: true) - ] - input[1] = 2 // number of splits - """ - } - } - } - when { params { module_args = '--prefix pp_' diff --git a/modules/nf-core/wipertools/fastqgather/tests/main.nf.test.snap b/modules/nf-core/wipertools/fastqgather/tests/main.nf.test.snap index df36c93df69..ecbf6054e41 100644 --- a/modules/nf-core/wipertools/fastqgather/tests/main.nf.test.snap +++ b/modules/nf-core/wipertools/fastqgather/tests/main.nf.test.snap @@ -28,9 +28,9 @@ ], "meta": { "nf-test": "0.9.2", - "nextflow": "24.10.1" + "nextflow": "24.10.2" }, - "timestamp": "2024-12-11T20:28:51.132317" + "timestamp": "2024-12-13T16:44:43.712118" }, "merge two gzipped fastq - fastq.gz": { "content": [ @@ -61,8 +61,8 @@ ], "meta": { "nf-test": "0.9.2", - "nextflow": "24.10.1" + "nextflow": "24.10.2" }, - "timestamp": "2024-12-11T20:28:40.144022" + "timestamp": "2024-12-13T16:44:27.472677" } } \ No newline at end of file diff --git a/modules/nf-core/wipertools/fastqscatter/main.nf b/modules/nf-core/wipertools/fastqscatter/main.nf index a1e4b862a1b..2f751d4627e 100644 --- a/modules/nf-core/wipertools/fastqscatter/main.nf +++ b/modules/nf-core/wipertools/fastqscatter/main.nf @@ -44,8 +44,8 @@ process WIPERTOOLS_FASTQSCATTER { out_folder = (args_list.contains('--out_folder') ? args_list[args_list.indexOf('--out_folder')+1] : (args_list.contains('-o') ? args_list[args_list.indexOf('-o')+1] : 'chunks')) """ mkdir ${out_folder} - echo -e "@ERR001268.1 080821_HWI-EAS301_0002_30ALBAAXX:1:1:1090:1998/1" > ${out_folder}/${prefix}_1-of-2_suffix.fastq - echo -e "@ERR001268.2 080821_HWI-EAS301_0002_30ALBAAXX:1:1:1090:1998/2" > ${out_folder}/${prefix}_2-of-2_suffix.fastq + echo "" > ${out_folder}/${prefix}_1-of-2_suffix.fastq + echo "" > ${out_folder}/${prefix}_2-of-2_suffix.fastq cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/wipertools/fastqscatter/tests/main.nf.test b/modules/nf-core/wipertools/fastqscatter/tests/main.nf.test index 5dc8b034664..47b3dc6d794 100644 --- a/modules/nf-core/wipertools/fastqscatter/tests/main.nf.test +++ b/modules/nf-core/wipertools/fastqscatter/tests/main.nf.test @@ -21,7 +21,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file('https://raw.githubusercontent.com/nf-core/test-datasets/fastqrepair/testdata/truncated_clean.fastq', checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_1.fastq.gz", checkIfExists: true) ] input[1] = 2 // splits num """ @@ -50,7 +50,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], - file('https://raw.githubusercontent.com/nf-core/test-datasets/fastqrepair/testdata/truncated_clean.fastq', checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_1.fastq.gz", checkIfExists: true) ] input[1] = 2 // splits num """ diff --git a/modules/nf-core/wipertools/fastqscatter/tests/main.nf.test.snap b/modules/nf-core/wipertools/fastqscatter/tests/main.nf.test.snap index b57e41771d3..cb2c4be3dc7 100644 --- a/modules/nf-core/wipertools/fastqscatter/tests/main.nf.test.snap +++ b/modules/nf-core/wipertools/fastqscatter/tests/main.nf.test.snap @@ -8,8 +8,8 @@ "id": "test" }, [ - "test_000.fastq.gz:md5,6ceafda8be51f7cba017123728261162", - "test_001.fastq.gz:md5,572033e56b4e644e704e3c83652e06cc" + "test_000.fastq.gz:md5,ecc4b1841cd94704bba742ea4dcd48b0", + "test_001.fastq.gz:md5,b3de467f2b6ab0d14e1f6ce14932a411" ] ] ], @@ -22,8 +22,8 @@ "id": "test" }, [ - "test_000.fastq.gz:md5,6ceafda8be51f7cba017123728261162", - "test_001.fastq.gz:md5,572033e56b4e644e704e3c83652e06cc" + "test_000.fastq.gz:md5,ecc4b1841cd94704bba742ea4dcd48b0", + "test_001.fastq.gz:md5,b3de467f2b6ab0d14e1f6ce14932a411" ] ] ], @@ -34,9 +34,9 @@ ], "meta": { "nf-test": "0.9.2", - "nextflow": "24.10.1" + "nextflow": "24.10.2" }, - "timestamp": "2024-12-10T19:58:30.47855" + "timestamp": "2024-12-13T16:49:54.985273" }, "3 reads, one truncated - fastq - stub": { "content": [ @@ -47,8 +47,8 @@ "id": "test" }, [ - "test_1-of-2_suffix.fastq:md5,40e2f90cf50b26b1ce397766aa89a8c7", - "test_2-of-2_suffix.fastq:md5,ef3ef34999313c60f22a25e90bb154db" + "test_1-of-2_suffix.fastq:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2-of-2_suffix.fastq:md5,68b329da9893e34099c7d8ad5cb9c940" ] ] ], @@ -61,8 +61,8 @@ "id": "test" }, [ - "test_1-of-2_suffix.fastq:md5,40e2f90cf50b26b1ce397766aa89a8c7", - "test_2-of-2_suffix.fastq:md5,ef3ef34999313c60f22a25e90bb154db" + "test_1-of-2_suffix.fastq:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2-of-2_suffix.fastq:md5,68b329da9893e34099c7d8ad5cb9c940" ] ] ], @@ -73,8 +73,8 @@ ], "meta": { "nf-test": "0.9.2", - "nextflow": "24.10.1" + "nextflow": "24.10.2" }, - "timestamp": "2024-12-10T19:58:41.665555" + "timestamp": "2024-12-13T16:50:09.59863" } } \ No newline at end of file