diff --git a/modules/nf-core/fastk/fastk/environment.yml b/modules/nf-core/fastk/fastk/environment.yml index d8cc5f8e4f70..f0fb643f3d22 100644 --- a/modules/nf-core/fastk/fastk/environment.yml +++ b/modules/nf-core/fastk/fastk/environment.yml @@ -4,4 +4,4 @@ channels: - conda-forge - bioconda dependencies: - - bioconda::false_flag + - bioconda::fastk=1.1.0 diff --git a/modules/nf-core/fastk/fastk/main.nf b/modules/nf-core/fastk/fastk/main.nf index 8c401f4be4a0..edd79d790bff 100644 --- a/modules/nf-core/fastk/fastk/main.nf +++ b/modules/nf-core/fastk/fastk/main.nf @@ -3,7 +3,10 @@ process FASTK_FASTK { label 'process_medium' // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. - container 'ghcr.io/nbisweden/fastk_genescopefk_merquryfk:1.2' + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/9f/9f0bee9bfacd05665a9b1a11dd087dbf1be41ac3e640931c38c914a2390642cf/data' : + 'community.wave.seqera.io/library/fastk_merquryfk_r-cowplot_r-ggplot2_r-viridis:f9994edc2270683c' }" input: tuple val(meta), path(reads) @@ -18,13 +21,9 @@ process FASTK_FASTK { task.ext.when == null || task.ext.when script: - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - error "FASTK_FASTK module does not support Conda. Please use Docker / Singularity / Podman instead." - } - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - def FASTK_VERSION = 'f18a4e6d2207539f7b84461daebc54530a9559b0' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def FASTK_VERSION = '1.1' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ FastK \\ $args \\ @@ -33,8 +32,7 @@ process FASTK_FASTK { -N${prefix}_fk \\ $reads - find . -name '*.ktab*' \\ - | xargs chmod a+r + find . -name '*.ktab*' -exec chmod a+r {} \\; cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -43,16 +41,11 @@ process FASTK_FASTK { """ stub: - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - error "FASTK_FASTK module does not support Conda. Please use Docker / Singularity / Podman instead." - } - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - def FASTK_VERSION = 'f18a4e6d2207539f7b84461daebc54530a9559b0' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. - - def touch_ktab = args.contains('-t') ? "touch ${prefix}_fk.ktab .${prefix}_fk.ktab.1" : '' - def touch_prof = args.contains('-p') ? "touch ${prefix}_fk.prof .${prefix}_fk.pidx.1" : '' + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def FASTK_VERSION = '1.1' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def touch_ktab = args.contains('-t') ? "touch ${prefix}_fk.ktab .${prefix}_fk.ktab.1" : '' + def touch_prof = args.contains('-p') ? "touch ${prefix}_fk.prof .${prefix}_fk.pidx.1" : '' """ touch ${prefix}_fk.hist $touch_ktab diff --git a/modules/nf-core/fastk/fastk/tests/main.nf.test.snap b/modules/nf-core/fastk/fastk/tests/main.nf.test.snap index 1e3fc4dada35..9c4be01e1647 100644 --- a/modules/nf-core/fastk/fastk/tests/main.nf.test.snap +++ b/modules/nf-core/fastk/fastk/tests/main.nf.test.snap @@ -36,7 +36,7 @@ ] ], "3": [ - "versions.yml:md5,c216a1608924d1662d2086e1de1d5abd" + "versions.yml:md5,daf09d9a1bb60ca0f25555f973d5c0c6" ], "hist": [ [ @@ -72,15 +72,15 @@ ] ], "versions": [ - "versions.yml:md5,c216a1608924d1662d2086e1de1d5abd" + "versions.yml:md5,daf09d9a1bb60ca0f25555f973d5c0c6" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.2", + "nextflow": "24.10.5" }, - "timestamp": "2024-05-18T19:39:28.510263" + "timestamp": "2025-03-18T17:01:17.068843951" }, "test_fastk_fastk_single_end": { "content": [ @@ -121,7 +121,7 @@ ] ], "3": [ - "versions.yml:md5,c216a1608924d1662d2086e1de1d5abd" + "versions.yml:md5,daf09d9a1bb60ca0f25555f973d5c0c6" ], "hist": [ [ @@ -159,15 +159,15 @@ ] ], "versions": [ - "versions.yml:md5,c216a1608924d1662d2086e1de1d5abd" + "versions.yml:md5,daf09d9a1bb60ca0f25555f973d5c0c6" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.2", + "nextflow": "24.10.5" }, - "timestamp": "2024-05-18T19:31:31.128388" + "timestamp": "2025-03-18T17:00:45.285904182" }, "test_fastk_fastk_paired_end": { "content": [ @@ -210,7 +210,7 @@ ] ], "3": [ - "versions.yml:md5,c216a1608924d1662d2086e1de1d5abd" + "versions.yml:md5,daf09d9a1bb60ca0f25555f973d5c0c6" ], "hist": [ [ @@ -250,15 +250,15 @@ ] ], "versions": [ - "versions.yml:md5,c216a1608924d1662d2086e1de1d5abd" + "versions.yml:md5,daf09d9a1bb60ca0f25555f973d5c0c6" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.2", + "nextflow": "24.10.5" }, - "timestamp": "2024-05-18T19:31:35.565502" + "timestamp": "2025-03-18T17:00:56.994942898" }, "test_fastk_fastk_paired_end_stub": { "content": [ @@ -297,7 +297,7 @@ ] ], "3": [ - "versions.yml:md5,c216a1608924d1662d2086e1de1d5abd" + "versions.yml:md5,daf09d9a1bb60ca0f25555f973d5c0c6" ], "hist": [ [ @@ -333,14 +333,14 @@ ] ], "versions": [ - "versions.yml:md5,c216a1608924d1662d2086e1de1d5abd" + "versions.yml:md5,daf09d9a1bb60ca0f25555f973d5c0c6" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.2", + "nextflow": "24.10.5" }, - "timestamp": "2024-05-18T19:39:32.570957" + "timestamp": "2025-03-18T17:01:29.548661612" } } \ No newline at end of file diff --git a/modules/nf-core/fastk/histex/environment.yml b/modules/nf-core/fastk/histex/environment.yml new file mode 100644 index 000000000000..f0fb643f3d22 --- /dev/null +++ b/modules/nf-core/fastk/histex/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::fastk=1.1.0 diff --git a/modules/nf-core/fastk/histex/main.nf b/modules/nf-core/fastk/histex/main.nf index 27948eb9edaf..af6062974ead 100644 --- a/modules/nf-core/fastk/histex/main.nf +++ b/modules/nf-core/fastk/histex/main.nf @@ -3,7 +3,10 @@ process FASTK_HISTEX { label 'process_low' // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. - container 'ghcr.io/nbisweden/fastk_genescopefk_merquryfk:1.2' + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/9f/9f0bee9bfacd05665a9b1a11dd087dbf1be41ac3e640931c38c914a2390642cf/data' : + 'community.wave.seqera.io/library/fastk_merquryfk_r-cowplot_r-ggplot2_r-viridis:f9994edc2270683c' }" input: tuple val(meta), path(histogram) @@ -16,13 +19,9 @@ process FASTK_HISTEX { task.ext.when == null || task.ext.when script: - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - error "FASTK_HISTEX module does not support Conda. Please use Docker / Singularity / Podman instead." - } - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - def FASTK_VERSION = 'f18a4e6d2207539f7b84461daebc54530a9559b0' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def FASTK_VERSION = '1.1' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ Histex \\ $args \\ @@ -34,4 +33,16 @@ process FASTK_HISTEX { fastk: $FASTK_VERSION END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + def FASTK_VERSION = '1.1' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + """ + touch ${prefix}.hist + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + fastk: $FASTK_VERSION + END_VERSIONS + """ } diff --git a/modules/nf-core/fastk/histex/tests/main.nf.test b/modules/nf-core/fastk/histex/tests/main.nf.test new file mode 100644 index 000000000000..ac9b8119b1a8 --- /dev/null +++ b/modules/nf-core/fastk/histex/tests/main.nf.test @@ -0,0 +1,68 @@ +nextflow_process { + + name "Test Process FASTK_HISTEX" + script "../main.nf" + process "FASTK_HISTEX" + + tag "modules" + tag "modules_nfcore" + tag "fastk" + tag "fastk/fastk" + tag "fastk/histex" + + setup { + run("FASTK_FASTK") { + script "../../fastk/" + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ] + """ + } + } + } + + test("homo_sapiens - Illumina") { + + when { + process { + """ + input[0] = FASTK_FASTK.out.hist + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo_sapiens - Illumina - stub") { + + options '-stub' + + when { + + process { + """ + input[0] = FASTK_FASTK.out.hist + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} \ No newline at end of file diff --git a/modules/nf-core/fastk/histex/tests/main.nf.test.snap b/modules/nf-core/fastk/histex/tests/main.nf.test.snap new file mode 100644 index 000000000000..98e16ccf12d6 --- /dev/null +++ b/modules/nf-core/fastk/histex/tests/main.nf.test.snap @@ -0,0 +1,72 @@ +{ + "homo_sapiens - Illumina - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.hist:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,c341f76b03e55e3eaaadc0bad07674e0" + ], + "hist": [ + [ + { + "id": "test", + "single_end": false + }, + "test.hist:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,c341f76b03e55e3eaaadc0bad07674e0" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.5" + }, + "timestamp": "2025-03-18T17:03:13.01032408" + }, + "homo_sapiens - Illumina": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.hist:md5,afd7d60759c76f23d80b3b75b1ceed7f" + ] + ], + "1": [ + "versions.yml:md5,c341f76b03e55e3eaaadc0bad07674e0" + ], + "hist": [ + [ + { + "id": "test", + "single_end": false + }, + "test.hist:md5,afd7d60759c76f23d80b3b75b1ceed7f" + ] + ], + "versions": [ + "versions.yml:md5,c341f76b03e55e3eaaadc0bad07674e0" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.5" + }, + "timestamp": "2025-03-19T08:55:19.961441005" + } +} \ No newline at end of file diff --git a/modules/nf-core/fastk/merge/environment.yml b/modules/nf-core/fastk/merge/environment.yml new file mode 100644 index 000000000000..f0fb643f3d22 --- /dev/null +++ b/modules/nf-core/fastk/merge/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::fastk=1.1.0 diff --git a/modules/nf-core/fastk/merge/main.nf b/modules/nf-core/fastk/merge/main.nf index e696a0606eef..9cd0c0722f39 100644 --- a/modules/nf-core/fastk/merge/main.nf +++ b/modules/nf-core/fastk/merge/main.nf @@ -3,7 +3,10 @@ process FASTK_MERGE { label 'process_medium' // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. - container 'ghcr.io/nbisweden/fastk_genescopefk_merquryfk:1.2' + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/9f/9f0bee9bfacd05665a9b1a11dd087dbf1be41ac3e640931c38c914a2390642cf/data' : + 'community.wave.seqera.io/library/fastk_merquryfk_r-cowplot_r-ggplot2_r-viridis:f9994edc2270683c' }" input: tuple val(meta), path(hist), path(ktab), path(prof) @@ -18,13 +21,9 @@ process FASTK_MERGE { task.ext.when == null || task.ext.when script: - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - error "FASTK_MERGE module does not support Conda. Please use Docker / Singularity / Podman instead." - } - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - def FASTK_VERSION = 'f18a4e6d2207539f7b84461daebc54530a9559b0' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def FASTK_VERSION = '1.1' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ Fastmerge \\ $args \\ @@ -37,4 +36,21 @@ process FASTK_MERGE { fastk: $FASTK_VERSION END_VERSIONS """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def FASTK_VERSION = '1.1' + def touch_hist = args.contains('-h') ? "touch ${prefix}_fk.hist" : '' + def touch_ktab = args.contains('-t') ? "touch ${prefix}_fk.ktab .${prefix}_fk.ktab.1" : '' + """ + ${touch_hist} + ${touch_ktab} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + fastk: $FASTK_VERSION + END_VERSIONS + """ } diff --git a/modules/nf-core/fastk/merge/tests/main.nf.test b/modules/nf-core/fastk/merge/tests/main.nf.test new file mode 100644 index 000000000000..baa18ee233a5 --- /dev/null +++ b/modules/nf-core/fastk/merge/tests/main.nf.test @@ -0,0 +1,104 @@ +nextflow_process { + + name "Test Process FASTK_MERGE" + script "../main.nf" + process "FASTK_MERGE" + config './nextflow.config' + + tag "modules" + tag "modules_nfcore" + tag "fastk" + tag "fastk/fastk" + tag "fastk/merge" + + test("homo_sapiens - Illumina") { + + setup { + run("FASTK_FASTK") { + script "../../fastk" + process { + """ + input[0] = Channel.of( + [ + [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ], + [ + [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_2.fastq.gz', checkIfExists: true) + ] + ) + """ + } + } + } + + when { + process { + """ + input[0] = FASTK_FASTK.out.hist.groupTuple() + .join( FASTK_FASTK.out.ktab.groupTuple(), remainder: true ) + .join( FASTK_FASTK.out.prof.groupTuple(), remainder: true ) + .map { meta, hist, ktab, prof -> + [meta, hist, ktab ? ktab.flatten().sort() : [] , prof ? prof.flatten().sort() : [] ] + } + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo_sapiens - Illumina - stub") { + + options '-stub' + + setup { + run("FASTK_FASTK") { + script "../../fastk/" + process { + """ + input[0] = Channel.of( + [ + [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ], + [ + [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_2.fastq.gz', checkIfExists: true) + ] + ) + """ + } + } + } + + when { + + process { + """ + input[0] = FASTK_FASTK.out.hist.groupTuple() + .join( FASTK_FASTK.out.ktab.groupTuple(), remainder: true ) + .join( FASTK_FASTK.out.prof.groupTuple(), remainder: true ) + .map { meta, hist, ktab, prof -> + [meta, hist, ktab ? ktab.flatten().sort() : [] , prof ? prof.flatten().sort() : [] ] + } """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} \ No newline at end of file diff --git a/modules/nf-core/fastk/merge/tests/main.nf.test.snap b/modules/nf-core/fastk/merge/tests/main.nf.test.snap new file mode 100644 index 000000000000..bb6170abc517 --- /dev/null +++ b/modules/nf-core/fastk/merge/tests/main.nf.test.snap @@ -0,0 +1,116 @@ +{ + "homo_sapiens - Illumina - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_merged_fk.hist:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,3575ed2d4dc53c3341e28c5e2f8c9f89" + ], + "hist": [ + [ + { + "id": "test", + "single_end": false + }, + "test_merged_fk.hist:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "ktab": [ + + ], + "prof": [ + + ], + "versions": [ + "versions.yml:md5,3575ed2d4dc53c3341e28c5e2f8c9f89" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.5" + }, + "timestamp": "2025-03-20T17:48:58.187877348" + }, + "homo_sapiens - Illumina": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_merged.hist:md5,e35814b0148355e81d24411d395c3ddd" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + [ + ".test_merged.ktab.1:md5,3feddaf2d5cfe598176843b5e4676d9b", + ".test_merged.ktab.2:md5,f048f778133fa1d8253ef84f8fdce919", + "test_merged.ktab:md5,026590b00ba68b6d3f4dd6882e7dda43" + ] + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,3575ed2d4dc53c3341e28c5e2f8c9f89" + ], + "hist": [ + [ + { + "id": "test", + "single_end": false + }, + "test_merged.hist:md5,e35814b0148355e81d24411d395c3ddd" + ] + ], + "ktab": [ + [ + { + "id": "test", + "single_end": false + }, + [ + ".test_merged.ktab.1:md5,3feddaf2d5cfe598176843b5e4676d9b", + ".test_merged.ktab.2:md5,f048f778133fa1d8253ef84f8fdce919", + "test_merged.ktab:md5,026590b00ba68b6d3f4dd6882e7dda43" + ] + ] + ], + "prof": [ + + ], + "versions": [ + "versions.yml:md5,3575ed2d4dc53c3341e28c5e2f8c9f89" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.5" + }, + "timestamp": "2025-03-19T09:21:29.656566351" + } +} \ No newline at end of file diff --git a/modules/nf-core/fastk/merge/tests/nextflow.config b/modules/nf-core/fastk/merge/tests/nextflow.config new file mode 100644 index 000000000000..4bf1106705a2 --- /dev/null +++ b/modules/nf-core/fastk/merge/tests/nextflow.config @@ -0,0 +1,13 @@ +process { + + withName: 'FASTK_FASTK' { + ext.args = '-t1 -p' + ext.prefix = { "${meta.id}_${task.index}" } + } + + withName: 'FASTK_MERGE' { + ext.args = '-ht' + ext.prefix = "test_merged" + } + +} diff --git a/modules/nf-core/merquryfk/hapmaker/environment.yml b/modules/nf-core/merquryfk/hapmaker/environment.yml new file mode 100644 index 000000000000..897952cc9fb0 --- /dev/null +++ b/modules/nf-core/merquryfk/hapmaker/environment.yml @@ -0,0 +1,9 @@ +channels: + - conda-forge + - bioconda + +dependencies: + - bioconda::fastk=1.1.0 + - bioconda::merquryfk=1.1.1 + - conda-forge::r-ggplot2=3.4.0 + - conda-forge::r-viridis=0.6.5 diff --git a/modules/nf-core/merquryfk/hapmaker/main.nf b/modules/nf-core/merquryfk/hapmaker/main.nf new file mode 100644 index 000000000000..2736a115241c --- /dev/null +++ b/modules/nf-core/merquryfk/hapmaker/main.nf @@ -0,0 +1,71 @@ + +process MERQURYFK_HAPMAKER { + tag "$meta.id" + label 'process_low' + + // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/9f/9f0bee9bfacd05665a9b1a11dd087dbf1be41ac3e640931c38c914a2390642cf/data' : + 'community.wave.seqera.io/library/fastk_merquryfk_r-cowplot_r-ggplot2_r-viridis:f9994edc2270683c' }" + + input: + tuple val(meta) , path(matktab) + tuple val(meta2), path(patktab) + tuple val(meta3), path(childktab) + + output: + tuple val(meta) , path("*${input_mat}.hap.ktab*", hidden: true), emit: mat_hap_ktab + tuple val(meta2), path("*${input_pat}.hap.ktab*", hidden: true), emit: pat_hap_ktab + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + input_mat = matktab ? "${matktab.find{ it.toString().endsWith(".ktab") }.toString() - ~/\.ktab/}" : '' + input_pat = patktab ? "${patktab.find{ it.toString().endsWith(".ktab") }.toString() - ~/\.ktab/}" : '' + def input_child = childktab ? "${childktab.find{ it.toString().endsWith(".ktab") }.toString() - ~/\.ktab/}" : '' + + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def FASTK_VERSION = '1.1.0' + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def MERQURY_VERSION = '1.1.1' + """ + HAPmaker \\ + $args \\ + -T${task.cpus} \\ + ${input_mat} \\ + ${input_pat} \\ + ${input_child} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + FastK: $FASTK_VERSION + MerquryFK: $MERQURY_VERSION + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + input_mat = matktab ? "${matktab.find{ it.toString().endsWith(".ktab") }.toString() - ~/\.ktab/}" : '' + input_pat = patktab ? "${patktab.find{ it.toString().endsWith(".ktab") }.toString() - ~/\.ktab/}" : '' + + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def FASTK_VERSION = '1.1.0' + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def MERQURY_VERSION = '1.1.1' + """ + touch ${input_mat}.hap.ktab + touch .${input_mat}.hap.ktab.1 + touch ${input_pat}.hap.ktab + touch .${input_pat}.hap.ktab.1 + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + FastK: $FASTK_VERSION + MerquryFK: $MERQURY_VERSION + END_VERSIONS + """ +} \ No newline at end of file diff --git a/modules/nf-core/merquryfk/hapmaker/meta.yml b/modules/nf-core/merquryfk/hapmaker/meta.yml new file mode 100644 index 000000000000..85ed2af41816 --- /dev/null +++ b/modules/nf-core/merquryfk/hapmaker/meta.yml @@ -0,0 +1,80 @@ +name: "merquryfk_hapmaker" +description: | + Produces maternal and paternal FastK kmer tables from maternal, paternal and child + FastK tables +keywords: + - k-mer frequency + - trio binning + - reference-free + - assembly evaluation +tools: + - "merquryfk": + description: "FastK based version of Merqury" + homepage: "https://github.com/thegenemyers/MERQURY.FK" + tool_dev_url: "https://github.com/thegenemyers/MERQURY.FK" + license: ["https://github.com/thegenemyers/MERQURY.FK/blob/main/LICENSE"] + identifier: "" +input: + - - meta: + type: map + description: | + Groovy Map containing maternal sample information + e.g. [ id:'test', single_end:false ] + - matktab: + type: file + description: maternal ktab files from the program FastK + pattern: "*.ktab*" + - - meta2: + type: map + description: | + Groovy Map containing paternal sample information + e.g. [ id:'test', single_end:false ] + - patktab: + type: file + description: paternal ktab files from the program FastK + pattern: "*.ktab*" + - - meta3: + type: map + description: | + Groovy Map containing child sample information + e.g. [ id:'test', single_end:false ] + - childktab: + type: file + description: child ktab files from the program FastK + pattern: "*.ktab*" +output: + - mat_hap_ktab: + - meta: + type: map + description: | + Groovy Map containing maternal sample information + e.g. [ id:'test', single_end:false ] + - '*${input_mat}.hap.ktab*", hidden: true': + type: map + description: | + FastK kmer table containing the maternal kmers + present in the child + pattern: "*${input_mat}.hap.ktab*" + - pat_hap_ktab: + - meta2: + type: map + description: | + Groovy Map containing paternal sample information + e.g. [ id:'test', single_end:false ] + - '*${input_pat}.hap.ktab*", hidden: true': + type: map + description: | + FastK kmer table containing the paternal kmers + present in the child + pattern: "*${input_pat}.hap.ktab*" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@prototaxites" + - "@yumisims" +maintainers: + - "@prototaxites" + - "@yumisims" diff --git a/modules/nf-core/merquryfk/hapmaker/tests/main.nf.test b/modules/nf-core/merquryfk/hapmaker/tests/main.nf.test new file mode 100644 index 000000000000..f0408dc99e61 --- /dev/null +++ b/modules/nf-core/merquryfk/hapmaker/tests/main.nf.test @@ -0,0 +1,96 @@ +nextflow_process { + + name "Test Process MERQURYFK_HAPMAKER" + script "../main.nf" + process "MERQURYFK_HAPMAKER" + + tag "modules" + tag "modules_nfcore" + tag "merquryfk" + tag "merquryfk/hapmaker" + tag "fastk" + tag "fastk/fastk" + + setup { + run("FASTK_FASTK", alias: "FASTK_PAT") { + script "../../../fastk/fastk" + process { + """ + input[0] = [ + [ id:'mat', single_end:false ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ] + """ + } + } + + run("FASTK_FASTK", alias: "FASTK_MAT") { + script "../../../fastk/fastk" + process { + """ + input[0] = [ + [ id:'pat', single_end:false ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_2.fastq.gz', checkIfExists: true) + ] + """ + } + } + + run("FASTK_FASTK", alias: "FASTK_CHILD") { + script "../../../fastk/fastk" + process { + """ + input[0] = [ + [ id:'child', single_end:false ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ] + """ + } + } + } + + test("homo_sapiens - Illumina") { + config "./nextflow.config" + + when { + process { + """ + input[0] = FASTK_MAT.out.ktab + input[1] = FASTK_PAT.out.ktab + input[2] = FASTK_CHILD.out.ktab + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo_sapiens - Illumina - stub") { + config "./nextflow.config" + options '-stub' + + when { + process { + """ + input[0] = FASTK_MAT.out.ktab + input[1] = FASTK_PAT.out.ktab + input[2] = FASTK_CHILD.out.ktab + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } +} \ No newline at end of file diff --git a/modules/nf-core/merquryfk/hapmaker/tests/main.nf.test.snap b/modules/nf-core/merquryfk/hapmaker/tests/main.nf.test.snap new file mode 100644 index 000000000000..e7e25a34acb9 --- /dev/null +++ b/modules/nf-core/merquryfk/hapmaker/tests/main.nf.test.snap @@ -0,0 +1,136 @@ +{ + "homo_sapiens - Illumina - stub": { + "content": [ + { + "0": [ + [ + { + "id": "pat", + "single_end": false + }, + [ + ".pat_fk.hap.ktab.1:md5,d41d8cd98f00b204e9800998ecf8427e", + "pat_fk.hap.ktab:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "1": [ + [ + { + "id": "mat", + "single_end": false + }, + [ + ".mat_fk.hap.ktab.1:md5,d41d8cd98f00b204e9800998ecf8427e", + "mat_fk.hap.ktab:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "2": [ + "versions.yml:md5,c5273cf653220afcc805c31c12dd9ee9" + ], + "mat_hap_ktab": [ + [ + { + "id": "pat", + "single_end": false + }, + [ + ".pat_fk.hap.ktab.1:md5,d41d8cd98f00b204e9800998ecf8427e", + "pat_fk.hap.ktab:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "pat_hap_ktab": [ + [ + { + "id": "mat", + "single_end": false + }, + [ + ".mat_fk.hap.ktab.1:md5,d41d8cd98f00b204e9800998ecf8427e", + "mat_fk.hap.ktab:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "versions": [ + "versions.yml:md5,c5273cf653220afcc805c31c12dd9ee9" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.5" + }, + "timestamp": "2025-03-19T15:11:14.910152563" + }, + "homo_sapiens - Illumina": { + "content": [ + { + "0": [ + [ + { + "id": "pat", + "single_end": false + }, + [ + ".pat_fk.hap.ktab.1:md5,c0964e92ed3a16f221a1097898bd7d78", + ".pat_fk.hap.ktab.2:md5,c0964e92ed3a16f221a1097898bd7d78", + "pat_fk.hap.ktab:md5,b15ed2005a95952f6264fa8e12f0661e" + ] + ] + ], + "1": [ + [ + { + "id": "mat", + "single_end": false + }, + [ + ".mat_fk.hap.ktab.1:md5,3779758edcdcfc863f8cf9183422b11e", + ".mat_fk.hap.ktab.2:md5,b9aa23e5aca96272871361cf04137706", + "mat_fk.hap.ktab:md5,e7712947c87b5e117f78ed63607daa67" + ] + ] + ], + "2": [ + "versions.yml:md5,c5273cf653220afcc805c31c12dd9ee9" + ], + "mat_hap_ktab": [ + [ + { + "id": "pat", + "single_end": false + }, + [ + ".pat_fk.hap.ktab.1:md5,c0964e92ed3a16f221a1097898bd7d78", + ".pat_fk.hap.ktab.2:md5,c0964e92ed3a16f221a1097898bd7d78", + "pat_fk.hap.ktab:md5,b15ed2005a95952f6264fa8e12f0661e" + ] + ] + ], + "pat_hap_ktab": [ + [ + { + "id": "mat", + "single_end": false + }, + [ + ".mat_fk.hap.ktab.1:md5,3779758edcdcfc863f8cf9183422b11e", + ".mat_fk.hap.ktab.2:md5,b9aa23e5aca96272871361cf04137706", + "mat_fk.hap.ktab:md5,e7712947c87b5e117f78ed63607daa67" + ] + ] + ], + "versions": [ + "versions.yml:md5,c5273cf653220afcc805c31c12dd9ee9" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.5" + }, + "timestamp": "2025-03-19T15:10:49.31866412" + } +} \ No newline at end of file diff --git a/modules/nf-core/merquryfk/hapmaker/tests/nextflow.config b/modules/nf-core/merquryfk/hapmaker/tests/nextflow.config new file mode 100644 index 000000000000..04698a21a6d2 --- /dev/null +++ b/modules/nf-core/merquryfk/hapmaker/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: 'FASTK_FASTK' { + ext.args = '-t' + } +} \ No newline at end of file diff --git a/modules/nf-core/merquryfk/katcomp/environment.yml b/modules/nf-core/merquryfk/katcomp/environment.yml new file mode 100644 index 000000000000..897952cc9fb0 --- /dev/null +++ b/modules/nf-core/merquryfk/katcomp/environment.yml @@ -0,0 +1,9 @@ +channels: + - conda-forge + - bioconda + +dependencies: + - bioconda::fastk=1.1.0 + - bioconda::merquryfk=1.1.1 + - conda-forge::r-ggplot2=3.4.0 + - conda-forge::r-viridis=0.6.5 diff --git a/modules/nf-core/merquryfk/katcomp/main.nf b/modules/nf-core/merquryfk/katcomp/main.nf index 40d1006b7f68..62a732ddb0f9 100644 --- a/modules/nf-core/merquryfk/katcomp/main.nf +++ b/modules/nf-core/merquryfk/katcomp/main.nf @@ -3,38 +3,39 @@ process MERQURYFK_KATCOMP { label 'process_medium' // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. - container 'ghcr.io/nbisweden/fastk_genescopefk_merquryfk:1.2' + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/9f/9f0bee9bfacd05665a9b1a11dd087dbf1be41ac3e640931c38c914a2390642cf/data' : + 'community.wave.seqera.io/library/fastk_merquryfk_r-cowplot_r-ggplot2_r-viridis:f9994edc2270683c' }" input: tuple val(meta), path(fastk1_hist), path(fastk1_ktab), path(fastk2_hist), path(fastk2_ktab) output: - tuple val(meta), path("*.fi.png"), emit: filled_png , optional: true - tuple val(meta), path("*.ln.png"), emit: line_png , optional: true - tuple val(meta), path("*.st.png"), emit: stacked_png, optional: true - tuple val(meta), path("*.fi.pdf"), emit: filled_pdf , optional: true - tuple val(meta), path("*.ln.pdf"), emit: line_pdf , optional: true - tuple val(meta), path("*.st.pdf"), emit: stacked_pdf, optional: true - path "versions.yml" , emit: versions + tuple val(meta), path("*.fi.{png,pdf}"), emit: filled , optional: true + tuple val(meta), path("*.ln.{png,pdf}"), emit: line , optional: true + tuple val(meta), path("*.st.{png,pdf}"), emit: stacked, optional: true + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when script: - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - error "MERQURYFK_KATCOMP module does not support Conda. Please use Docker / Singularity / Podman instead." - } - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - def FASTK_VERSION = 'f18a4e6d2207539f7b84461daebc54530a9559b0' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. - def MERQURY_VERSION = '8f3ab706e4cf4d7b7d1dfe5739859e3ebd26c494' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def input_fk1 = fastk1_ktab.find{ it.toString().endsWith(".ktab") }.getBaseName() + def input_fk2 = fastk2_ktab.find{ it.toString().endsWith(".ktab") }.getBaseName() + + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def FASTK_VERSION = '1.1.0' + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def MERQURY_VERSION = '1.1.1' """ KatComp \\ $args \\ -T$task.cpus \\ - ${fastk1_ktab.find{ it.toString().endsWith(".ktab") }} \\ - ${fastk2_ktab.find{ it.toString().endsWith(".ktab") }} \\ + ${input_fk1} \\ + ${input_fk2} \\ $prefix cat <<-END_VERSIONS > versions.yml @@ -44,4 +45,25 @@ process MERQURYFK_KATCOMP { r: \$( R --version | sed '1!d; s/.*version //; s/ .*//' ) END_VERSIONS """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def FASTK_VERSION = '1.1.0' + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def MERQURY_VERSION = '1.1.1' + def outfmt = args.contains('-pdf') ? "pdf" : "png" + """ + touch ${prefix}.test.fi.${outfmt} + touch ${prefix}.test.ln.${outfmt} + touch ${prefix}.test.st.${outfmt} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + fastk: $FASTK_VERSION + merquryfk: $MERQURY_VERSION + r: \$( R --version | sed '1!d; s/.*version //; s/ .*//' ) + END_VERSIONS + """ } diff --git a/modules/nf-core/merquryfk/katcomp/meta.yml b/modules/nf-core/merquryfk/katcomp/meta.yml index f629c2a0f689..078eebbc2523 100644 --- a/modules/nf-core/merquryfk/katcomp/meta.yml +++ b/modules/nf-core/merquryfk/katcomp/meta.yml @@ -34,66 +34,42 @@ input: description: Histogram ktab files from the program FastK (option -t) pattern: "*.ktab*" output: - - filled_png: + - filled: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.fi.png": + pattern: "*.fi.{png,pdf}" + - "*.fi.{png,pdf}": type: file - description: Comparison of Kmers between sample 1 and 2 in filled PNG format. - pattern: "*.fi.png" - - line_png: - - meta: - type: map description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - "*.ln.png": - type: file - description: Comparison of Kmers between sample 1 and 2 in line PNG format. - pattern: "*.ln.png" - - stacked_png: + Comparison of Kmers between sample 1 and 2 in filled PNG or PDF format. + pattern: "*.fi.{png,pdf}" + - line: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.st.png": + pattern: "*.ln.{png,pdf}" + - "*.ln.{png,pdf}": type: file - description: Comparison of Kmers between sample 1 and 2 in stacked PNG format. - pattern: "*.st.png" - - filled_pdf: - - meta: - type: map description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - "*.fi.pdf": - type: file - description: Comparison of Kmers between sample 1 and 2 in filled PDF format. - pattern: "*.fi.pdf" - - line_pdf: + Comparison of Kmers between sample 1 and 2 in line PNG or PDF format. + pattern: "*.ln.{png,pdf}" + - stacked: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.ln.pdf": + pattern: "*.st.{png,pdf}" + - "*.st.{png,pdf}": type: file - description: Comparison of Kmers between sample 1 and 2 in line PDF format. - pattern: "*.ln.pdf" - - stacked_pdf: - - meta: - type: map description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - "*.st.pdf": - type: file - description: Comparison of Kmers between sample 1 and 2 in stacked PDF format. - pattern: "*.st.pdf" + Comparison of Kmers between sample 1 and 2 in stacked PNG or PDF format. + pattern: "*.st.{png,pdf}" - versions: - versions.yml: type: file diff --git a/modules/nf-core/merquryfk/katcomp/tests/main.nf.test b/modules/nf-core/merquryfk/katcomp/tests/main.nf.test new file mode 100644 index 000000000000..ad803864f216 --- /dev/null +++ b/modules/nf-core/merquryfk/katcomp/tests/main.nf.test @@ -0,0 +1,86 @@ +nextflow_process { + + name "Test Process MERQURYFK_KATCOMP" + script "../main.nf" + process "MERQURYFK_KATCOMP" + + tag "modules" + tag "modules_nfcore" + tag "merquryfk" + tag "merquryfk/katcomp" + tag "fastk" + tag "fastk/fastk" + + setup { + run("FASTK_FASTK", alias: "FASTK1") { + script "../../../fastk/fastk" + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ] + """ + } + } + + run("FASTK_FASTK", alias: "FASTK2") { + script "../../../fastk/fastk" + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ] + """ + } + } + } + + test("homo_sapiens - Illumina") { + config "./nextflow.config" + + when { + process { + """ + input[0] = FASTK1.out.hist + .join( FASTK1.out.ktab ) + .join( FASTK2.out.hist ) + .join( FASTK2.out.ktab ) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo_sapiens - Illumina - stub") { + config "./nextflow.config" + options '-stub' + + when { + process { + """ + input[0] = FASTK1.out.hist + .join( FASTK1.out.ktab ) + .join( FASTK2.out.hist ) + .join( FASTK2.out.ktab ) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } +} \ No newline at end of file diff --git a/modules/nf-core/merquryfk/katcomp/tests/main.nf.test.snap b/modules/nf-core/merquryfk/katcomp/tests/main.nf.test.snap new file mode 100644 index 000000000000..295f36991181 --- /dev/null +++ b/modules/nf-core/merquryfk/katcomp/tests/main.nf.test.snap @@ -0,0 +1,144 @@ +{ + "homo_sapiens - Illumina - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.test.fi.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.test.ln.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.test.st.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,2e70fea9056c7d10c1be49e5f6d31901" + ], + "filled": [ + [ + { + "id": "test", + "single_end": false + }, + "test.test.fi.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "line": [ + [ + { + "id": "test", + "single_end": false + }, + "test.test.ln.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "stacked": [ + [ + { + "id": "test", + "single_end": false + }, + "test.test.st.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,2e70fea9056c7d10c1be49e5f6d31901" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.5" + }, + "timestamp": "2025-03-18T15:58:45.391635763" + }, + "homo_sapiens - Illumina": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fi.png:md5,7dbd24b84f30992ef7f644869a1f3491" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.ln.png:md5,b6404177a90935be555e713e65d69da1" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.st.png:md5,edbf50ec86810fa5a98eff61250e0096" + ] + ], + "3": [ + "versions.yml:md5,2e70fea9056c7d10c1be49e5f6d31901" + ], + "filled": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fi.png:md5,7dbd24b84f30992ef7f644869a1f3491" + ] + ], + "line": [ + [ + { + "id": "test", + "single_end": false + }, + "test.ln.png:md5,b6404177a90935be555e713e65d69da1" + ] + ], + "stacked": [ + [ + { + "id": "test", + "single_end": false + }, + "test.st.png:md5,edbf50ec86810fa5a98eff61250e0096" + ] + ], + "versions": [ + "versions.yml:md5,2e70fea9056c7d10c1be49e5f6d31901" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.5" + }, + "timestamp": "2025-03-19T11:20:46.939451749" + } +} \ No newline at end of file diff --git a/modules/nf-core/merquryfk/katcomp/tests/nextflow.config b/modules/nf-core/merquryfk/katcomp/tests/nextflow.config new file mode 100644 index 000000000000..1cf0ccc7ae12 --- /dev/null +++ b/modules/nf-core/merquryfk/katcomp/tests/nextflow.config @@ -0,0 +1,16 @@ +process { + + withName: 'FASTK_.*' { + ext.args = '-t' + publishDir = [ enabled: false ] + } + + withName: 'FASTK1' { + ext.prefix = { "${meta.id}_sampleA" } + } + + withName: 'FASTK2' { + ext.prefix = { "${meta.id}_sampleB" } + } + +} \ No newline at end of file diff --git a/modules/nf-core/merquryfk/katgc/environment.yml b/modules/nf-core/merquryfk/katgc/environment.yml new file mode 100644 index 000000000000..897952cc9fb0 --- /dev/null +++ b/modules/nf-core/merquryfk/katgc/environment.yml @@ -0,0 +1,9 @@ +channels: + - conda-forge + - bioconda + +dependencies: + - bioconda::fastk=1.1.0 + - bioconda::merquryfk=1.1.1 + - conda-forge::r-ggplot2=3.4.0 + - conda-forge::r-viridis=0.6.5 diff --git a/modules/nf-core/merquryfk/katgc/main.nf b/modules/nf-core/merquryfk/katgc/main.nf index 6c3a4bf1854d..a1e4ab7c49f4 100644 --- a/modules/nf-core/merquryfk/katgc/main.nf +++ b/modules/nf-core/merquryfk/katgc/main.nf @@ -3,32 +3,30 @@ process MERQURYFK_KATGC { label 'process_medium' // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. - container 'ghcr.io/nbisweden/fastk_genescopefk_merquryfk:1.2' + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/9f/9f0bee9bfacd05665a9b1a11dd087dbf1be41ac3e640931c38c914a2390642cf/data' : + 'community.wave.seqera.io/library/fastk_merquryfk_r-cowplot_r-ggplot2_r-viridis:f9994edc2270683c' }" input: tuple val(meta), path(fastk_hist), path(fastk_ktab) output: - tuple val(meta), path("*.fi.png"), emit: filled_gc_plot_png , optional: true - tuple val(meta), path("*.fi.pdf"), emit: filled_gc_plot_pdf , optional: true - tuple val(meta), path("*.ln.png"), emit: line_gc_plot_png , optional: true - tuple val(meta), path("*.ln.pdf"), emit: line_gc_plot_pdf , optional: true - tuple val(meta), path("*.st.png"), emit: stacked_gc_plot_png, optional: true - tuple val(meta), path("*.st.pdf"), emit: stacked_gc_plot_pdf, optional: true - path "versions.yml" , emit: versions + tuple val(meta), path("*.fi.{png,pdf}"), emit: filled_gc_plot , optional: true + tuple val(meta), path("*.ln.{png,pdf}"), emit: line_gc_plot , optional: true + tuple val(meta), path("*.st.{png,pdf}"), emit: stacked_gc_plot, optional: true + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when script: - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - error "MERQURYFK_KATGC module does not support Conda. Please use Docker / Singularity / Podman instead." - } - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - def FASTK_VERSION = 'f18a4e6d2207539f7b84461daebc54530a9559b0' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. - def MERQURY_VERSION = '8f3ab706e4cf4d7b7d1dfe5739859e3ebd26c494' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def FASTK_VERSION = '1.1.0' + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def MERQURY_VERSION = '1.1.1' """ KatGC \\ $args \\ @@ -43,4 +41,25 @@ process MERQURYFK_KATGC { r: \$( R --version | sed '1!d; s/.*version //; s/ .*//' ) END_VERSIONS """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def FASTK_VERSION = '1.1.0' + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def MERQURY_VERSION = '1.1.1' + def outfmt = args.contains('-pdf') ? "pdf" : "png" + """ + touch ${prefix}.test.fi.${outfmt} + touch ${prefix}.test.ln.${outfmt} + touch ${prefix}.test.st.${outfmt} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + fastk: $FASTK_VERSION + merquryfk: $MERQURY_VERSION + r: \$( R --version | sed '1!d; s/.*version //; s/ .*//' ) + END_VERSIONS + """ } diff --git a/modules/nf-core/merquryfk/katgc/meta.yml b/modules/nf-core/merquryfk/katgc/meta.yml index 0d553d5c2c0e..b082f0a4f61a 100644 --- a/modules/nf-core/merquryfk/katgc/meta.yml +++ b/modules/nf-core/merquryfk/katgc/meta.yml @@ -27,66 +27,42 @@ input: description: ktab files from the program FastK pattern: "*.ktab*" output: - - filled_gc_plot_png: + - filled_gc_plot: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.fi.png": + pattern: "*.fi.{png,pdf}" + - "*.fi.{png,pdf}": type: file - description: A filled GC content plot in PNG format - pattern: "*.fi.png" - - filled_gc_plot_pdf: - - meta: - type: map description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - "*.fi.pdf": - type: file - description: A filled GC content plot in PDF format - pattern: "*.fi.pdf" - - line_gc_plot_png: + A filled GC content plot in PNG or PDF format + pattern: "*.fi.{png,pdf}" + - line_gc_plot: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.ln.png": + pattern: "*.ln.{png,pdf}" + - "*.ln.{png,pdf}": type: file - description: A line GC content plot in PNG format - pattern: "*.ln.png" - - line_gc_plot_pdf: - - meta: - type: map description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - "*.ln.pdf": - type: file - description: A line GC content plot in PDF format - pattern: "*.ln.pdf" - - stacked_gc_plot_png: + A filled GC content plot in PNG or PDF format + pattern: "*.ln.{png,pdf}" + - stacked_gc_plot: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.st.png": - type: file - description: A stacked GC content plot in PNG format - pattern: "*.st.png" - - stacked_gc_plot_pdf: - - meta: + pattern: "*.st.{png,pdf}" + - "*.st.{png,pdf}": type: map description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - "*.st.pdf": - type: file - description: A stacked GC content plot in PDF format - pattern: "*.st.pdf" + A stacked GC content plot in PNG or PDF format + pattern: "*.st.{png,pdf}" - versions: - versions.yml: type: file diff --git a/modules/nf-core/merquryfk/katgc/tests/main.nf.test b/modules/nf-core/merquryfk/katgc/tests/main.nf.test new file mode 100644 index 000000000000..a6ef5d0d138e --- /dev/null +++ b/modules/nf-core/merquryfk/katgc/tests/main.nf.test @@ -0,0 +1,71 @@ +nextflow_process { + + name "Test Process MERQURYFK_KATGC" + script "../main.nf" + process "MERQURYFK_KATGC" + + tag "modules" + tag "modules_nfcore" + tag "merquryfk" + tag "merquryfk/katgc" + tag "fastk" + tag "fastk/fastk" + + setup { + run("FASTK_FASTK") { + script "../../../fastk/fastk" + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ] + """ + } + } + } + + test("homo_sapiens - Illumina") { + config "./nextflow.config" + + when { + process { + """ + input[0] = FASTK_FASTK.out.hist + .join(FASTK_FASTK.out.ktab) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo_sapiens - Illumina - stub") { + config "./nextflow.config" + options '-stub' + + when { + process { + """ + input[0] = FASTK_FASTK.out.hist + .join( FASTK_FASTK.out.ktab ) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} \ No newline at end of file diff --git a/modules/nf-core/merquryfk/katgc/tests/main.nf.test.snap b/modules/nf-core/merquryfk/katgc/tests/main.nf.test.snap new file mode 100644 index 000000000000..53b834b53f86 --- /dev/null +++ b/modules/nf-core/merquryfk/katgc/tests/main.nf.test.snap @@ -0,0 +1,144 @@ +{ + "homo_sapiens - Illumina - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.test.fi.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.test.ln.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.test.st.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,f4de5ff85e313404340fd7e1fba9b47d" + ], + "filled_gc_plot": [ + [ + { + "id": "test", + "single_end": false + }, + "test.test.fi.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "line_gc_plot": [ + [ + { + "id": "test", + "single_end": false + }, + "test.test.ln.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "stacked_gc_plot": [ + [ + { + "id": "test", + "single_end": false + }, + "test.test.st.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,f4de5ff85e313404340fd7e1fba9b47d" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.5" + }, + "timestamp": "2025-03-18T16:04:37.280403406" + }, + "homo_sapiens - Illumina": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fi.png:md5,91865b907bdab45b22e47dcabb275fee" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.ln.png:md5,2982773ea57bf5e804e8c787a4b9d99e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.st.png:md5,c6999accdbd589cb9e88bf20c9913630" + ] + ], + "3": [ + "versions.yml:md5,f4de5ff85e313404340fd7e1fba9b47d" + ], + "filled_gc_plot": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fi.png:md5,91865b907bdab45b22e47dcabb275fee" + ] + ], + "line_gc_plot": [ + [ + { + "id": "test", + "single_end": false + }, + "test.ln.png:md5,2982773ea57bf5e804e8c787a4b9d99e" + ] + ], + "stacked_gc_plot": [ + [ + { + "id": "test", + "single_end": false + }, + "test.st.png:md5,c6999accdbd589cb9e88bf20c9913630" + ] + ], + "versions": [ + "versions.yml:md5,f4de5ff85e313404340fd7e1fba9b47d" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.5" + }, + "timestamp": "2025-03-19T11:21:21.294239143" + } +} \ No newline at end of file diff --git a/modules/nf-core/merquryfk/merquryfk/tests/nextflow.png.config b/modules/nf-core/merquryfk/katgc/tests/nextflow.config similarity index 62% rename from modules/nf-core/merquryfk/merquryfk/tests/nextflow.png.config rename to modules/nf-core/merquryfk/katgc/tests/nextflow.config index 47c3d63eeb94..4a8fb5e2a31d 100644 --- a/modules/nf-core/merquryfk/merquryfk/tests/nextflow.png.config +++ b/modules/nf-core/merquryfk/katgc/tests/nextflow.config @@ -1,9 +1,8 @@ process { + withName: 'FASTK_.*' { ext.args = '-t' publishDir = [ enabled: false ] } - withName: 'MERQURYFK_MERQURYFK' { - ext.args = '-lfs' - } -} + +} \ No newline at end of file diff --git a/modules/nf-core/merquryfk/merquryfk/environment.yml b/modules/nf-core/merquryfk/merquryfk/environment.yml new file mode 100644 index 000000000000..897952cc9fb0 --- /dev/null +++ b/modules/nf-core/merquryfk/merquryfk/environment.yml @@ -0,0 +1,9 @@ +channels: + - conda-forge + - bioconda + +dependencies: + - bioconda::fastk=1.1.0 + - bioconda::merquryfk=1.1.1 + - conda-forge::r-ggplot2=3.4.0 + - conda-forge::r-viridis=0.6.5 diff --git a/modules/nf-core/merquryfk/merquryfk/main.nf b/modules/nf-core/merquryfk/merquryfk/main.nf index 1ee8b35f1e8f..3c4bf9117fac 100644 --- a/modules/nf-core/merquryfk/merquryfk/main.nf +++ b/modules/nf-core/merquryfk/merquryfk/main.nf @@ -3,53 +3,60 @@ process MERQURYFK_MERQURYFK { label 'process_medium' // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. - container 'ghcr.io/nbisweden/fastk_genescopefk_merquryfk:1.2' + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/9f/9f0bee9bfacd05665a9b1a11dd087dbf1be41ac3e640931c38c914a2390642cf/data' : + 'community.wave.seqera.io/library/fastk_merquryfk_r-cowplot_r-ggplot2_r-viridis:f9994edc2270683c' }" input: - tuple val(meta), path(fastk_hist),path(fastk_ktab),path(assembly),path(haplotigs) - path matktab //optional - path patktab //optional + tuple val(meta) , path(fastk_hist),path(fastk_ktab), path(assembly), path(haplotigs) + tuple val(meta2), path(mathaptab) // optional, trio mode + tuple val(meta3), path(pathaptab) // optional, trio mode output: tuple val(meta), path("${prefix}.completeness.stats") , emit: stats tuple val(meta), path("${prefix}.*_only.bed") , emit: bed tuple val(meta), path("${prefix}.*.qv") , emit: assembly_qv - tuple val(meta), path("${prefix}.*.spectra-cn.fl.{png,pdf}") , emit: spectra_cn_fl, optional: true - tuple val(meta), path("${prefix}.*.spectra-cn.ln.{png,pdf}") , emit: spectra_cn_ln, optional: true - tuple val(meta), path("${prefix}.*.spectra-cn.st.{png,pdf}") , emit: spectra_cn_st, optional: true + tuple val(meta), path("${prefix}.*.spectra-cn.fl.{png,pdf}") , emit: spectra_cn_fl , optional: true + tuple val(meta), path("${prefix}.*.spectra-cn.ln.{png,pdf}") , emit: spectra_cn_ln , optional: true + tuple val(meta), path("${prefix}.*.spectra-cn.st.{png,pdf}") , emit: spectra_cn_st , optional: true tuple val(meta), path("${prefix}.qv") , emit: qv - tuple val(meta), path("${prefix}.spectra-asm.fl.{png,pdf}") , emit: spectra_asm_fl, optional: true - tuple val(meta), path("${prefix}.spectra-asm.ln.{png,pdf}") , emit: spectra_asm_ln, optional: true - tuple val(meta), path("${prefix}.spectra-asm.st.{png,pdf}") , emit: spectra_asm_st, optional: true - tuple val(meta), path("${prefix}.phased_block.bed") , emit: phased_block_bed, optional: true + tuple val(meta), path("${prefix}.spectra-asm.fl.{png,pdf}") , emit: spectra_asm_fl , optional: true + tuple val(meta), path("${prefix}.spectra-asm.ln.{png,pdf}") , emit: spectra_asm_ln , optional: true + tuple val(meta), path("${prefix}.spectra-asm.st.{png,pdf}") , emit: spectra_asm_st , optional: true + tuple val(meta), path("${prefix}.phased_block.bed") , emit: phased_block_bed , optional: true tuple val(meta), path("${prefix}.phased_block.stats") , emit: phased_block_stats, optional: true - tuple val(meta), path("${prefix}.continuity.N.{pdf,png}") , emit: continuity_N, optional: true - tuple val(meta), path("${prefix}.block.N.{pdf,png}") , emit: block_N, optional: true - tuple val(meta), path("${prefix}.block.blob.{pdf,png}") , emit: block_blob, optional: true - tuple val(meta), path("${prefix}.hapmers.blob.{pdf,png}") , emit: hapmers_blob, optional: true + tuple val(meta), path("${prefix}.continuity.N.{pdf,png}") , emit: continuity_N , optional: true + tuple val(meta), path("${prefix}.block.N.{pdf,png}") , emit: block_N , optional: true + tuple val(meta), path("${prefix}.block.blob.{pdf,png}") , emit: block_blob , optional: true + tuple val(meta), path("${prefix}.hapmers.blob.{pdf,png}") , emit: hapmers_blob , optional: true path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when script: - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - error "MERQURYFK_MERQURYFK module does not support Conda. Please use Docker / Singularity / Podman instead." + if([mathaptab, pathaptab].any() && ![mathaptab, pathaptab].every()) { + log.error("Error: Only one of the maternal and paternal hap tabs have been provided!") } - def args = task.ext.args ?: '' - prefix = task.ext.prefix ?: "${meta.id}" - def mat_ktab = matktab ? "${matktab.find{ it.toString().endsWith(".ktab") }}" : '' - def pat_ktab = patktab ? "${patktab.find{ it.toString().endsWith(".ktab") }}" : '' - def FASTK_VERSION = 'f18a4e6d2207539f7b84461daebc54530a9559b0' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. - def MERQURY_VERSION = '8ae344092df5dcaf83cfb7f90f662597a9b1fc61' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + fk_ktab = fastk_ktab ? "${fastk_ktab.find{ it.toString().endsWith(".ktab") }}" : '' + mat_hapktab = mathaptab ? "${mathaptab.find{ it.toString().endsWith(".ktab") }}" : '' + pat_hapktab = pathaptab ? "${pathaptab.find{ it.toString().endsWith(".ktab") }}" : '' + + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def FASTK_VERSION = '1.1.0' + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def MERQURY_VERSION = '1.1.1' """ MerquryFK \\ $args \\ -T$task.cpus \\ - ${fastk_ktab.find{ it.toString().endsWith(".ktab") }} \\ - ${mat_ktab} \\ - ${pat_ktab} \\ + ${fk_ktab} \\ + ${mat_hapktab} \\ + ${pat_hapktab} \\ $assembly \\ $haplotigs \\ $prefix @@ -61,15 +68,19 @@ process MERQURYFK_MERQURYFK { r: \$( R --version | sed '1!d; s/.*version //; s/ .*//' ) END_VERSIONS """ + stub: - prefix = task.ext.prefix ?: "${meta.id}" - def FASTK_VERSION = 'f18a4e6d2207539f7b84461daebc54530a9559b0' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. - def MERQURY_VERSION = '8ae344092df5dcaf83cfb7f90f662597a9b1fc61' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + prefix = task.ext.prefix ?: "${meta.id}" + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def FASTK_VERSION = '1.1.0' + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def MERQURY_VERSION = '1.1.1' """ touch ${prefix}.completeness.stats touch ${prefix}.qv touch ${prefix}._.qv touch ${prefix}._only.bed + cat <<-END_VERSIONS > versions.yml "${task.process}": fastk: $FASTK_VERSION diff --git a/modules/nf-core/merquryfk/merquryfk/meta.yml b/modules/nf-core/merquryfk/merquryfk/meta.yml index 67e680452f4a..777a30f58896 100644 --- a/modules/nf-core/merquryfk/merquryfk/meta.yml +++ b/modules/nf-core/merquryfk/merquryfk/meta.yml @@ -33,12 +33,22 @@ input: type: file description: Assembly haplotigs (fasta format) pattern: ".fasta" - - - matktab: + - - meta2: + type: map + description: | + Groovy Map containing maternal sample information + e.g. [ id:'test', single_end:false ] + - mathaptab: type: file description: trio maternal histogram ktab files from the program FastK (option -t) pattern: "*.ktab*" - - - patktab: + - - meta3: + type: map + description: | + Groovy Map containing paternal sample information + e.g. [ id:'test', single_end:false ] + - pathaptab: type: file description: trio paternal histogram ktab files from the program FastK (option -t) diff --git a/modules/nf-core/merquryfk/merquryfk/tests/main.nf.test b/modules/nf-core/merquryfk/merquryfk/tests/main.nf.test index c46843c6d681..db748a3230c7 100644 --- a/modules/nf-core/merquryfk/merquryfk/tests/main.nf.test +++ b/modules/nf-core/merquryfk/merquryfk/tests/main.nf.test @@ -12,7 +12,7 @@ nextflow_process { tag "fastk/fastk" setup { - run("FASTK_FASTK") { + run("FASTK_FASTK") { script "../../../fastk/fastk" process { """ @@ -22,63 +22,35 @@ nextflow_process { ] """ } - } - run("FASTK_FASTK", alias: "FASTK_MAT") { + } + + run("FASTK_FASTK", alias: "FASTK_MAT") { script "../../../fastk/fastk" process { """ input[0] = [ - [ id:'test', single_end:false ], + [ id:'test_mat', single_end:false ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_1.fastq.gz', checkIfExists: true), ] """ } - } + } run("FASTK_FASTK", alias: "FASTK_PAT") { script "../../../fastk/fastk" process { """ input[0] = [ - [ id:'test', single_end:false ], + [ id:'test_pat', single_end:false ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_2.fastq.gz', checkIfExists: true), ] """ } - } - } - - test("homo_sapiens - Illumina - png") { - config "./nextflow.png.config" - when { - process { - """ - assembly = [ - [ id:'test', single_end:true ], - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) - ] - - haplotigs = [ - [ id:'test', single_end:true ], [] - ] - input[0] = FASTK_FASTK.out.hist.join(FASTK_FASTK.out.ktab).join(Channel.from(assembly)).join(Channel.from(haplotigs)) - input[1] = [] - input[2] = [] - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) } - } - test("homo_sapiens - Illumina - pdf") { - config "./nextflow.pdf.config" + test("homo_sapiens - Illumina") { + config "./nextflow.config" when { process { """ @@ -105,12 +77,12 @@ nextflow_process { } } - + test("homo_sapiens - Illumina - trio") { - config "./nextflow.trio.config" + config "./nextflow.config" when { process { - """ + """ assembly = [ [ id:'test', single_end:true ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) @@ -137,7 +109,7 @@ nextflow_process { test("homo_sapiens - Illumina - stub") { options "-stub" - config "./nextflow.pdf.config" + config "./nextflow.config" when { process { """ @@ -166,5 +138,5 @@ nextflow_process { } - + } \ No newline at end of file diff --git a/modules/nf-core/merquryfk/merquryfk/tests/main.nf.test.snap b/modules/nf-core/merquryfk/merquryfk/tests/main.nf.test.snap index f7ce47f0c864..7d536ce24073 100644 --- a/modules/nf-core/merquryfk/merquryfk/tests/main.nf.test.snap +++ b/modules/nf-core/merquryfk/merquryfk/tests/main.nf.test.snap @@ -112,120 +112,7 @@ }, "timestamp": "2024-08-15T15:22:52.240373868" }, - "homo_sapiens - Illumina - pdf": { - "content": [ - { - "0": [ - - ], - "1": [ - - ], - "10": [ - - ], - "11": [ - - ], - "12": [ - - ], - "13": [ - - ], - "14": [ - - ], - "15": [ - - ], - "16": [ - - ], - "2": [ - - ], - "3": [ - - ], - "4": [ - - ], - "5": [ - - ], - "6": [ - - ], - "7": [ - - ], - "8": [ - - ], - "9": [ - - ], - "assembly_qv": [ - - ], - "bed": [ - - ], - "block_N": [ - - ], - "block_blob": [ - - ], - "continuity_N": [ - - ], - "hapmers_blob": [ - - ], - "phased_block_bed": [ - - ], - "phased_block_stats": [ - - ], - "qv": [ - - ], - "spectra_asm_fl": [ - - ], - "spectra_asm_ln": [ - - ], - "spectra_asm_st": [ - - ], - "spectra_cn_fl": [ - - ], - "spectra_cn_ln": [ - - ], - "spectra_cn_st": [ - - ], - "stats": [ - - ], - "versions": [ - - ] - } - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" - }, - "timestamp": "2024-08-15T15:22:19.530675341" - }, - "homo_sapiens - Illumina - png": { + "homo_sapiens - Illumina - trio": { "content": [ { "0": [ @@ -336,9 +223,9 @@ "nf-test": "0.8.4", "nextflow": "24.04.2" }, - "timestamp": "2024-08-15T15:21:57.682723412" + "timestamp": "2024-08-15T15:22:40.060937299" }, - "homo_sapiens - Illumina - trio": { + "homo_sapiens - Illumina": { "content": [ { "0": [ @@ -446,9 +333,9 @@ } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.2", + "nextflow": "24.10.5" }, - "timestamp": "2024-08-15T15:22:40.060937299" + "timestamp": "2025-03-19T11:21:53.577037669" } } \ No newline at end of file diff --git a/modules/nf-core/merquryfk/merquryfk/tests/nextflow.config b/modules/nf-core/merquryfk/merquryfk/tests/nextflow.config index ba1eebc98bfa..c7432864a46c 100644 --- a/modules/nf-core/merquryfk/merquryfk/tests/nextflow.config +++ b/modules/nf-core/merquryfk/merquryfk/tests/nextflow.config @@ -1,8 +1,12 @@ process { - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - withName: 'FASTK_.*' { - ext.args = '-t' - publishDir = [ enabled: false ] + // Singularity tests fail due to memory allocation issues + // Fix memory to something low to ensure they pass + memory = '1.GB' + ext.args = '-t' + publishDir = [ enabled: false ] + } + withName: 'MERQURYFK_MERQURYFK' { + ext.args = '-lfs' } } diff --git a/modules/nf-core/merquryfk/merquryfk/tests/nextflow.pdf.config b/modules/nf-core/merquryfk/merquryfk/tests/nextflow.pdf.config deleted file mode 100644 index 52beeaa305c3..000000000000 --- a/modules/nf-core/merquryfk/merquryfk/tests/nextflow.pdf.config +++ /dev/null @@ -1,9 +0,0 @@ -process { - withName: 'FASTK_.*' { - ext.args = '-t' - publishDir = [ enabled: false ] - } - withName: 'MERQURYFK_MERQURYFK' { - ext.args = '-lfs -pdf' - } -} diff --git a/modules/nf-core/merquryfk/ploidyplot/environment.yml b/modules/nf-core/merquryfk/ploidyplot/environment.yml new file mode 100644 index 000000000000..897952cc9fb0 --- /dev/null +++ b/modules/nf-core/merquryfk/ploidyplot/environment.yml @@ -0,0 +1,9 @@ +channels: + - conda-forge + - bioconda + +dependencies: + - bioconda::fastk=1.1.0 + - bioconda::merquryfk=1.1.1 + - conda-forge::r-ggplot2=3.4.0 + - conda-forge::r-viridis=0.6.5 diff --git a/modules/nf-core/merquryfk/ploidyplot/main.nf b/modules/nf-core/merquryfk/ploidyplot/main.nf index 2096e1b2edee..b077f5e73888 100644 --- a/modules/nf-core/merquryfk/ploidyplot/main.nf +++ b/modules/nf-core/merquryfk/ploidyplot/main.nf @@ -3,38 +3,57 @@ process MERQURYFK_PLOIDYPLOT { label 'process_medium' // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. - container 'ghcr.io/nbisweden/fastk_genescopefk_merquryfk:1.2' + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/9f/9f0bee9bfacd05665a9b1a11dd087dbf1be41ac3e640931c38c914a2390642cf/data' : + 'community.wave.seqera.io/library/fastk_merquryfk_r-cowplot_r-ggplot2_r-viridis:f9994edc2270683c' }" input: tuple val(meta), path(fastk_hist), path(fastk_ktab) output: - tuple val(meta), path("*.fi.png"), emit: filled_ploidy_plot_png , optional: true - tuple val(meta), path("*.fi.pdf"), emit: filled_ploidy_plot_pdf , optional: true - tuple val(meta), path("*.ln.png"), emit: line_ploidy_plot_png , optional: true - tuple val(meta), path("*.ln.pdf"), emit: line_ploidy_plot_pdf , optional: true - tuple val(meta), path("*.st.png"), emit: stacked_ploidy_plot_png, optional: true - tuple val(meta), path("*.st.pdf"), emit: stacked_ploidy_plot_pdf, optional: true + tuple val(meta), path("*.fi.{png,pdf}"), emit: filled_ploidy_plot , optional: true + tuple val(meta), path("*.ln.{png,pdf}"), emit: line_ploidy_plot , optional: true + tuple val(meta), path("*.st.{png,pdf}"), emit: stacked_ploidy_plot, optional: true path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when script: - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - error "MERQURYFK_PLOIDYPLOT module does not support Conda. Please use Docker / Singularity / Podman instead." - } - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - def FASTK_VERSION = 'f18a4e6d2207539f7b84461daebc54530a9559b0' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. - def MERQURY_VERSION = '8f3ab706e4cf4d7b7d1dfe5739859e3ebd26c494' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def FASTK_VERSION = '1.1.0' + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def MERQURY_VERSION = '1.1.1' """ PloidyPlot \\ $args \\ -T$task.cpus \\ - -o$prefix \\ - ${fastk_ktab.find{ it.toString().endsWith(".ktab") }} + ${fastk_ktab.find{ it.toString().endsWith(".ktab") }} \\ + ${prefix} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + fastk: $FASTK_VERSION + merquryfk: $MERQURY_VERSION + r: \$( R --version | sed '1!d; s/.*version //; s/ .*//' ) + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def FASTK_VERSION = '1.1.0' + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def MERQURY_VERSION = '1.1.1' + def outfmt = args.contains('-pdf') ? "pdf" : "png" + """ + touch ${prefix}.fi.${outfmt} + touch ${prefix}.ln.${outfmt} + touch ${prefix}.st.${outfmt} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/merquryfk/ploidyplot/meta.yml b/modules/nf-core/merquryfk/ploidyplot/meta.yml index ab3756efad5e..c2b60c6b401b 100644 --- a/modules/nf-core/merquryfk/ploidyplot/meta.yml +++ b/modules/nf-core/merquryfk/ploidyplot/meta.yml @@ -26,66 +26,36 @@ input: description: ktab files from the program FastK pattern: "*.ktab*" output: - - filled_ploidy_plot_png: + - filled_ploidy_plot: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.fi.png": + - "*.fi.{png,pdf}": type: file - description: A filled ploidy plot in PNG format - pattern: "*.fi.png" - - filled_ploidy_plot_pdf: + description: A filled ploidy plot in or PDF format + pattern: "*.fi.{png,pdf}" + - line_ploidy_plot: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.fi.pdf": + - "*.ln.{png,pdf}": type: file - description: A filled ploidy plot in PDF format - pattern: "*.fi.pdf" - - line_ploidy_plot_png: + description: A line ploidy plot in PNG or PDF format + pattern: "*.ln.{png,pdf}" + - stacked_ploidy_plot: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.ln.png": + - "*.st.{png,pdf}": type: file - description: A line ploidy plot in PNG format - pattern: "*.ln.png" - - line_ploidy_plot_pdf: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - "*.ln.pdf": - type: file - description: A lin4 ploidy plot in PDF format - pattern: "*.ln.pdf" - - stacked_ploidy_plot_png: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - "*.st.png": - type: file - description: A stacked ploidy plot in PNG format - pattern: "*.st.png" - - stacked_ploidy_plot_pdf: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - "*.st.pdf": - type: file - description: A stacked ploidy plot in PDF format - pattern: "*.st.pdf" + description: A stacked ploidy plot in PNG or PDFformat + pattern: "*.st.{png,pdf}" - versions: - versions.yml: type: file diff --git a/modules/nf-core/merquryfk/ploidyplot/tests/main.nf.test b/modules/nf-core/merquryfk/ploidyplot/tests/main.nf.test new file mode 100644 index 000000000000..17a66ac02abb --- /dev/null +++ b/modules/nf-core/merquryfk/ploidyplot/tests/main.nf.test @@ -0,0 +1,70 @@ +nextflow_process { + + name "Test Process MERQURYFK_PLOIDYPLOT" + script "../main.nf" + process "MERQURYFK_PLOIDYPLOT" + + tag "modules" + tag "modules_nfcore" + tag "merquryfk" + tag "merquryfk/ploidyplot" + tag "fastk" + tag "fastk/fastk" + + setup { + run("FASTK_FASTK") { + script "../../../fastk/fastk" + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ] + """ + } + } + } + + test("homo_sapiens - Illumina") { + config "./nextflow.config" + + when { + process { + """ + input[0] = FASTK_FASTK.out.hist + .join(FASTK_FASTK.out.ktab) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo_sapiens - Illumina - stub") { + config "./nextflow.config" + options '-stub' + + when { + process { + """ + input[0] = FASTK_FASTK.out.hist + .join(FASTK_FASTK.out.ktab) """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} \ No newline at end of file diff --git a/modules/nf-core/merquryfk/ploidyplot/tests/main.nf.test.snap b/modules/nf-core/merquryfk/ploidyplot/tests/main.nf.test.snap new file mode 100644 index 000000000000..a704e2714bb3 --- /dev/null +++ b/modules/nf-core/merquryfk/ploidyplot/tests/main.nf.test.snap @@ -0,0 +1,144 @@ +{ + "homo_sapiens - Illumina - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fi.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.ln.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.st.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,9ea677a670e1f1d4851c47569c26df94" + ], + "filled_ploidy_plot": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fi.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "line_ploidy_plot": [ + [ + { + "id": "test", + "single_end": false + }, + "test.ln.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "stacked_ploidy_plot": [ + [ + { + "id": "test", + "single_end": false + }, + "test.st.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,9ea677a670e1f1d4851c47569c26df94" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.5" + }, + "timestamp": "2025-03-18T16:30:33.949890385" + }, + "homo_sapiens - Illumina": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fi.png:md5,5c589a856ecef275ab461b376216cb59" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.ln.png:md5,327bb869ea34b97666cf5975f40d11e5" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.st.png:md5,a76ca4a603c8e297c16bb9f1c524dc8e" + ] + ], + "3": [ + "versions.yml:md5,9ea677a670e1f1d4851c47569c26df94" + ], + "filled_ploidy_plot": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fi.png:md5,5c589a856ecef275ab461b376216cb59" + ] + ], + "line_ploidy_plot": [ + [ + { + "id": "test", + "single_end": false + }, + "test.ln.png:md5,327bb869ea34b97666cf5975f40d11e5" + ] + ], + "stacked_ploidy_plot": [ + [ + { + "id": "test", + "single_end": false + }, + "test.st.png:md5,a76ca4a603c8e297c16bb9f1c524dc8e" + ] + ], + "versions": [ + "versions.yml:md5,9ea677a670e1f1d4851c47569c26df94" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.5" + }, + "timestamp": "2025-03-19T11:22:51.189979413" + } +} \ No newline at end of file diff --git a/modules/nf-core/merquryfk/merquryfk/tests/nextflow.trio.config b/modules/nf-core/merquryfk/ploidyplot/tests/nextflow.config similarity index 62% rename from modules/nf-core/merquryfk/merquryfk/tests/nextflow.trio.config rename to modules/nf-core/merquryfk/ploidyplot/tests/nextflow.config index 47c3d63eeb94..4a8fb5e2a31d 100644 --- a/modules/nf-core/merquryfk/merquryfk/tests/nextflow.trio.config +++ b/modules/nf-core/merquryfk/ploidyplot/tests/nextflow.config @@ -1,9 +1,8 @@ process { + withName: 'FASTK_.*' { ext.args = '-t' publishDir = [ enabled: false ] } - withName: 'MERQURYFK_MERQURYFK' { - ext.args = '-lfs' - } -} + +} \ No newline at end of file diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 7d7d01572c0e..f4fc223a0fbe 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -97,12 +97,6 @@ entrezdirect/xtract: expansionhunterdenovo/merge: - modules/nf-core/expansionhunterdenovo/merge/** - tests/modules/nf-core/expansionhunterdenovo/merge/** -fastk/histex: - - modules/nf-core/fastk/histex/** - - tests/modules/nf-core/fastk/histex/** -fastk/merge: - - modules/nf-core/fastk/merge/** - - tests/modules/nf-core/fastk/merge/** fcs/fcsgx: - modules/nf-core/fcs/fcsgx/** - tests/modules/nf-core/fcs/fcsgx/** @@ -206,15 +200,6 @@ maxquant/lfq: megan/daa2info: - modules/nf-core/megan/daa2info/** - tests/modules/nf-core/megan/daa2info/** -merquryfk/katcomp: - - modules/nf-core/merquryfk/katcomp/** - - tests/modules/nf-core/merquryfk/katcomp/** -merquryfk/katgc: - - modules/nf-core/merquryfk/katgc/** - - tests/modules/nf-core/merquryfk/katgc/** -merquryfk/ploidyplot: - - modules/nf-core/merquryfk/ploidyplot/** - - tests/modules/nf-core/merquryfk/ploidyplot/** metaeuk/easypredict: - modules/nf-core/metaeuk/easypredict/** - tests/modules/nf-core/metaeuk/easypredict/** diff --git a/tests/modules/nf-core/fastk/histex/main.nf b/tests/modules/nf-core/fastk/histex/main.nf deleted file mode 100644 index cc0f3f8ae79f..000000000000 --- a/tests/modules/nf-core/fastk/histex/main.nf +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { FASTK_FASTK } from '../../../../../modules/nf-core/fastk/fastk/main.nf' -include { FASTK_HISTEX } from '../../../../../modules/nf-core/fastk/histex/main.nf' - -workflow test_fastk_histex { - - input = [ - [ id:'test' , single_end: true ], // meta map - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) - ] - - FASTK_FASTK ( input ) - FASTK_HISTEX ( FASTK_FASTK.out.hist ) -} diff --git a/tests/modules/nf-core/fastk/histex/nextflow.config b/tests/modules/nf-core/fastk/histex/nextflow.config deleted file mode 100644 index 038a089787b4..000000000000 --- a/tests/modules/nf-core/fastk/histex/nextflow.config +++ /dev/null @@ -1,8 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: 'FASTK_FASTK' { - publishDir = [ enabled: false ] - } -} diff --git a/tests/modules/nf-core/fastk/histex/test.yml b/tests/modules/nf-core/fastk/histex/test.yml deleted file mode 100644 index df8e0d914e5c..000000000000 --- a/tests/modules/nf-core/fastk/histex/test.yml +++ /dev/null @@ -1,8 +0,0 @@ -- name: fastk histex test_fastk_histex - command: nextflow run ./tests/modules/nf-core/fastk/histex -entry test_fastk_histex -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/fastk/histex/nextflow.config - tags: - - fastk/histex - - fastk - files: - - path: output/fastk/test.hist - md5sum: e3f0c9e7641a46525123312008e4ae86 diff --git a/tests/modules/nf-core/fastk/merge/main.nf b/tests/modules/nf-core/fastk/merge/main.nf deleted file mode 100644 index 9ff9b338bae4..000000000000 --- a/tests/modules/nf-core/fastk/merge/main.nf +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { FASTK_FASTK } from '../../../../../modules/nf-core/fastk/fastk/main.nf' -include { FASTK_MERGE } from '../../../../../modules/nf-core/fastk/merge/main.nf' - -workflow test_fastk_merge_hist_only { - - input1 = [ - [ id:'test', single_end:false ], // meta map - [ - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) - ] - ] - input2= [ - [ id:'test', single_end:false ], // meta map - [ - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) - ] - ] - - FASTK_FASTK ( Channel.of( input1, input2 ) ) - FASTK_MERGE ( - FASTK_FASTK.out.hist.groupTuple() - .join( FASTK_FASTK.out.ktab.groupTuple(), remainder: true ) - .join( FASTK_FASTK.out.prof.groupTuple(), remainder: true ) - .map { meta, hist, ktab, prof -> [meta, hist, ktab ? ktab.flatten() : [] , prof ? prof.flatten() : [] ] } - ) -} - -workflow test_fastk_merge_all_files { - - input1 = [ - [ id:'test', single_end:false ], // meta map - [ - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) - ] - ] - input2= [ - [ id:'test', single_end:false ], // meta map - [ - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) - ] - ] - - FASTK_FASTK ( Channel.of( input1, input2 ) ) - FASTK_MERGE ( - FASTK_FASTK.out.hist.groupTuple() - .join( FASTK_FASTK.out.ktab.groupTuple(), remainder: true ) - .join( FASTK_FASTK.out.prof.groupTuple(), remainder: true ) - .map { meta, hist, ktab, prof -> [meta, hist, ktab ? ktab.flatten() : [] , prof ? prof.flatten() : [] ] } - ) -} diff --git a/tests/modules/nf-core/fastk/merge/nextflow.config b/tests/modules/nf-core/fastk/merge/nextflow.config deleted file mode 100644 index 57fd2c736cb3..000000000000 --- a/tests/modules/nf-core/fastk/merge/nextflow.config +++ /dev/null @@ -1,14 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: 'test_fastk_merge_all_files:FASTK_FASTK' { - ext.args = '-t1 -p' - } - withName: 'FASTK_FASTK' { - ext.args = '-t1' - ext.prefix = { "${meta.id}_${task.index}" } - publishDir = [ enabled: false ] - } - -} diff --git a/tests/modules/nf-core/fastk/merge/test.yml b/tests/modules/nf-core/fastk/merge/test.yml deleted file mode 100644 index d8fe5ccc6665..000000000000 --- a/tests/modules/nf-core/fastk/merge/test.yml +++ /dev/null @@ -1,39 +0,0 @@ -- name: fastk merge test_fastk_merge_hist_only - command: nextflow run ./tests/modules/nf-core/fastk/merge -entry test_fastk_merge_hist_only -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/fastk/merge/nextflow.config - tags: - - fastk/merge - - fastk - files: - - path: output/fastk/.test.ktab.1 - md5sum: dff1e9d326aea87778645235cfa3380f - - path: output/fastk/.test.ktab.2 - md5sum: 438e7807dcc2eb8120e1338838147600 - - path: output/fastk/test.hist - md5sum: 75d41eb0e3f8af5456711a95966e2b00 - - path: output/fastk/test.ktab - md5sum: 7d882f4e3542df1a2f5cb0858b12dc03 - -- name: fastk merge test_fastk_merge_all_files - command: nextflow run ./tests/modules/nf-core/fastk/merge -entry test_fastk_merge_all_files -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/fastk/merge/nextflow.config - tags: - - fastk/merge - - fastk - files: - - path: output/fastk/.test.ktab.1 - md5sum: dff1e9d326aea87778645235cfa3380f - - path: output/fastk/.test.ktab.2 - md5sum: 438e7807dcc2eb8120e1338838147600 - - path: output/fastk/.test.pidx.1 - md5sum: 7553344778f6571192f04c7e659b967c - - path: output/fastk/.test.pidx.2 - md5sum: 09bb65fb10db58d1fd5bb0a123fccfc6 - - path: output/fastk/.test.prof.1 - md5sum: 7f0f84a62c89063ec18c9b0e447afe93 - - path: output/fastk/.test.prof.2 - md5sum: 7f0f84a62c89063ec18c9b0e447afe93 - - path: output/fastk/test.hist - md5sum: 75d41eb0e3f8af5456711a95966e2b00 - - path: output/fastk/test.ktab - md5sum: 7d882f4e3542df1a2f5cb0858b12dc03 - - path: output/fastk/test.prof - md5sum: d3c7d8decd4ea6e298291b8be0e2de85 diff --git a/tests/modules/nf-core/merquryfk/katcomp/main.nf b/tests/modules/nf-core/merquryfk/katcomp/main.nf deleted file mode 100644 index 78857f85494e..000000000000 --- a/tests/modules/nf-core/merquryfk/katcomp/main.nf +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { FASTK_FASTK as FASTK1 } from '../../../../../modules/nf-core/fastk/fastk/main.nf' -include { FASTK_FASTK as FASTK2 } from '../../../../../modules/nf-core/fastk/fastk/main.nf' -include { MERQURYFK_KATCOMP } from '../../../../../modules/nf-core/merquryfk/katcomp/main.nf' - -workflow test_merquryfk_katcomp_png { - - input = [ - [ id:'test', single_end:true ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_1_fastq_gz'], checkIfExists: true) - ] - - FASTK1 ( input ) - FASTK2 ( input ) - MERQURYFK_KATCOMP ( - FASTK1.out.hist - .join( FASTK1.out.ktab ) - .join( FASTK2.out.hist ) - .join( FASTK2.out.ktab ) - ) -} - -workflow test_merquryfk_katcomp_pdf { - - input = [ - [ id:'test', single_end:true ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_1_fastq_gz'], checkIfExists: true) - ] - - FASTK1 ( input ) - FASTK2 ( input ) - MERQURYFK_KATCOMP ( - FASTK1.out.hist - .join( FASTK1.out.ktab ) - .join( FASTK2.out.hist ) - .join( FASTK2.out.ktab ) - ) -} diff --git a/tests/modules/nf-core/merquryfk/katcomp/nextflow.config b/tests/modules/nf-core/merquryfk/katcomp/nextflow.config deleted file mode 100644 index 02629e809e9b..000000000000 --- a/tests/modules/nf-core/merquryfk/katcomp/nextflow.config +++ /dev/null @@ -1,19 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: 'FASTK.*' { - ext.args = '-t' - publishDir = [ enabled: false ] - } - withName: 'FASTK1' { - ext.prefix = { "${meta.id}_sampleA" } - } - withName: 'FASTK2' { - ext.prefix = { "${meta.id}_sampleB" } - } - withName: 'test_merquryfk_katcomp_pdf:MERQURYFK_KATCOMP' { - ext.args = '-pdf' - } - -} diff --git a/tests/modules/nf-core/merquryfk/katcomp/test.yml b/tests/modules/nf-core/merquryfk/katcomp/test.yml deleted file mode 100644 index 21d80bf8a832..000000000000 --- a/tests/modules/nf-core/merquryfk/katcomp/test.yml +++ /dev/null @@ -1,22 +0,0 @@ -- name: merquryfk katcomp test_merquryfk_katcomp_png - command: nextflow run ./tests/modules/nf-core/merquryfk/katcomp -entry test_merquryfk_katcomp_png -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/merquryfk/katcomp/nextflow.config - tags: - - merquryfk - - merquryfk/katcomp - files: - - path: output/merquryfk/test.fi.png - md5sum: 83b30d2f6103190887e66d3690c63d55 - - path: output/merquryfk/test.ln.png - md5sum: 6d223a9b91937b1f984e3415fd1580bb - - path: output/merquryfk/test.st.png - md5sum: 00a851c8f1c7f2f5b8bb57c6f07b161c - -- name: merquryfk katcomp test_merquryfk_katcomp_pdf - command: nextflow run ./tests/modules/nf-core/merquryfk/katcomp -entry test_merquryfk_katcomp_pdf -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/merquryfk/katcomp/nextflow.config - tags: - - merquryfk - - merquryfk/katcomp - files: - - path: output/merquryfk/test.fi.pdf - - path: output/merquryfk/test.ln.pdf - - path: output/merquryfk/test.st.pdf diff --git a/tests/modules/nf-core/merquryfk/katgc/main.nf b/tests/modules/nf-core/merquryfk/katgc/main.nf deleted file mode 100644 index d16ef2a16737..000000000000 --- a/tests/modules/nf-core/merquryfk/katgc/main.nf +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { FASTK_FASTK } from '../../../../../modules/nf-core/fastk/fastk/main.nf' -include { MERQURYFK_KATGC } from '../../../../../modules/nf-core/merquryfk/katgc/main.nf' - -workflow test_merquryfk_katgc_png { - - input = [ - [ id:'test', single_end:true ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_1_fastq_gz'], checkIfExists: true) - ] - - FASTK_FASTK ( input ) - MERQURYFK_KATGC ( FASTK_FASTK.out.hist - .join( FASTK_FASTK.out.ktab ) - ) -} - -workflow test_merquryfk_katgc_pdf { - - input = [ - [ id:'test', single_end:true ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_1_fastq_gz'], checkIfExists: true) - ] - - FASTK_FASTK ( input ) - MERQURYFK_KATGC ( FASTK_FASTK.out.hist - .join( FASTK_FASTK.out.ktab ) - ) -} diff --git a/tests/modules/nf-core/merquryfk/katgc/nextflow.config b/tests/modules/nf-core/merquryfk/katgc/nextflow.config deleted file mode 100644 index 7a5ac7a2dc25..000000000000 --- a/tests/modules/nf-core/merquryfk/katgc/nextflow.config +++ /dev/null @@ -1,12 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: 'FASTK_.*' { - ext.args = '-t' - publishDir = [ enabled: false ] - } - withName: 'test_merquryfk_katgc_pdf:MERQURYFK_KATGC' { - ext.args = '-pdf' - } -} diff --git a/tests/modules/nf-core/merquryfk/katgc/test.yml b/tests/modules/nf-core/merquryfk/katgc/test.yml deleted file mode 100644 index 41ef4f92f0d6..000000000000 --- a/tests/modules/nf-core/merquryfk/katgc/test.yml +++ /dev/null @@ -1,22 +0,0 @@ -- name: merquryfk katgc test_merquryfk_katgc_png - command: nextflow run ./tests/modules/nf-core/merquryfk/katgc -entry test_merquryfk_katgc_png -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/merquryfk/katgc/nextflow.config - tags: - - merquryfk - - merquryfk/katgc - files: - - path: output/merquryfk/test.fi.png - md5sum: bd4cf549d5c8eaaba82f78010f652dac - - path: output/merquryfk/test.ln.png - md5sum: 3f55f27a486c9be6187d71e3a570beb5 - - path: output/merquryfk/test.st.png - md5sum: 636339e17af69c4b64f27f36d66edcd8 - -- name: merquryfk katgc test_merquryfk_katgc_pdf - command: nextflow run ./tests/modules/nf-core/merquryfk/katgc -entry test_merquryfk_katgc_pdf -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/merquryfk/katgc/nextflow.config - tags: - - merquryfk - - merquryfk/katgc - files: - - path: output/merquryfk/test.fi.pdf - - path: output/merquryfk/test.ln.pdf - - path: output/merquryfk/test.st.pdf diff --git a/tests/modules/nf-core/merquryfk/ploidyplot/main.nf b/tests/modules/nf-core/merquryfk/ploidyplot/main.nf deleted file mode 100644 index 26d228ed5346..000000000000 --- a/tests/modules/nf-core/merquryfk/ploidyplot/main.nf +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { FASTK_FASTK } from '../../../../../modules/nf-core/fastk/fastk/main.nf' -include { MERQURYFK_PLOIDYPLOT } from '../../../../../modules/nf-core/merquryfk/ploidyplot/main.nf' - -workflow test_merquryfk_ploidyplot_png { - - input = [ - [ id:'test', single_end:true ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_1_fastq_gz'], checkIfExists: true) - ] - - FASTK_FASTK ( input ) - MERQURYFK_PLOIDYPLOT ( FASTK_FASTK.out.hist - .join( FASTK_FASTK.out.ktab ) - ) -} - -workflow test_merquryfk_ploidyplot_pdf { - - input = [ - [ id:'test', single_end:true ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_1_fastq_gz'], checkIfExists: true) - ] - - FASTK_FASTK ( input ) - MERQURYFK_PLOIDYPLOT ( - FASTK_FASTK.out.hist - .join( FASTK_FASTK.out.ktab ) - ) -} diff --git a/tests/modules/nf-core/merquryfk/ploidyplot/nextflow.config b/tests/modules/nf-core/merquryfk/ploidyplot/nextflow.config deleted file mode 100644 index 64737e067867..000000000000 --- a/tests/modules/nf-core/merquryfk/ploidyplot/nextflow.config +++ /dev/null @@ -1,13 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: 'FASTK_.*' { - ext.args = '-t' - publishDir = [ enabled: false ] - } - withName: 'test_merquryfk_ploidyplot_pdf:MERQURYFK_PLOIDYPLOT' { - ext.args = '-pdf' - } - -} diff --git a/tests/modules/nf-core/merquryfk/ploidyplot/test.yml b/tests/modules/nf-core/merquryfk/ploidyplot/test.yml deleted file mode 100644 index 1a0277a1dac7..000000000000 --- a/tests/modules/nf-core/merquryfk/ploidyplot/test.yml +++ /dev/null @@ -1,22 +0,0 @@ -- name: merquryfk ploidyplot test_merquryfk_ploidyplot_png - command: nextflow run ./tests/modules/nf-core/merquryfk/ploidyplot -entry test_merquryfk_ploidyplot_png -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/merquryfk/ploidyplot/nextflow.config - tags: - - merquryfk - - merquryfk/ploidyplot - files: - - path: output/merquryfk/test.fi.png - md5sum: c6f883f3d57ad64727219052e97d39b3 - - path: output/merquryfk/test.ln.png - md5sum: bd299e2eceb258328d1a41c024d7fbf4 - - path: output/merquryfk/test.st.png - md5sum: 4f858ed9712196606859675c3f3ba7a9 - -- name: merquryfk ploidyplot test_merquryfk_ploidyplot_pdf - command: nextflow run ./tests/modules/nf-core/merquryfk/ploidyplot -entry test_merquryfk_ploidyplot_pdf -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/merquryfk/ploidyplot/nextflow.config - tags: - - merquryfk - - merquryfk/ploidyplot - files: - - path: output/merquryfk/test.fi.pdf - - path: output/merquryfk/test.ln.pdf - - path: output/merquryfk/test.st.pdf