From 3fc8d44fa5c58eab3a24c0c7ab0796b8a6890a5c Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Tue, 26 Mar 2024 19:08:47 +0000 Subject: [PATCH 01/16] migrate to nf-test and update version --- modules/nf-core/meryl/count/environment.yml | 2 +- modules/nf-core/meryl/count/main.nf | 4 +- .../nf-core/meryl/count/tests/main.nf.test | 68 +++++++++++++++++++ .../nf-core/meryl/count/tests/nextflow.config | 3 + modules/nf-core/meryl/count/tests/tags.yml | 2 + tests/config/pytest_modules.yml | 3 - tests/modules/nf-core/meryl/count/main.nf | 28 -------- .../nf-core/meryl/count/nextflow.config | 6 -- tests/modules/nf-core/meryl/count/test.yml | 17 ----- 9 files changed, 76 insertions(+), 57 deletions(-) create mode 100644 modules/nf-core/meryl/count/tests/main.nf.test create mode 100644 modules/nf-core/meryl/count/tests/nextflow.config create mode 100644 modules/nf-core/meryl/count/tests/tags.yml delete mode 100644 tests/modules/nf-core/meryl/count/main.nf delete mode 100644 tests/modules/nf-core/meryl/count/nextflow.config delete mode 100644 tests/modules/nf-core/meryl/count/test.yml diff --git a/modules/nf-core/meryl/count/environment.yml b/modules/nf-core/meryl/count/environment.yml index e2bac0f2ec1..808565ee796 100644 --- a/modules/nf-core/meryl/count/environment.yml +++ b/modules/nf-core/meryl/count/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::meryl=1.3 + - bioconda::meryl=1.4.1 diff --git a/modules/nf-core/meryl/count/main.nf b/modules/nf-core/meryl/count/main.nf index 073d11b63d1..6e46d2a20a7 100644 --- a/modules/nf-core/meryl/count/main.nf +++ b/modules/nf-core/meryl/count/main.nf @@ -4,8 +4,8 @@ process MERYL_COUNT { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/meryl:1.3--h87f3376_1': - 'biocontainers/meryl:1.3--h87f3376_1' }" + 'https://depot.galaxyproject.org/singularity/meryl:1.4.1--h4ac6f70_0': + 'biocontainers/meryl:1.4.1--h4ac6f70_0' }" input: tuple val(meta), path(reads) diff --git a/modules/nf-core/meryl/count/tests/main.nf.test b/modules/nf-core/meryl/count/tests/main.nf.test new file mode 100644 index 00000000000..400e7432d37 --- /dev/null +++ b/modules/nf-core/meryl/count/tests/main.nf.test @@ -0,0 +1,68 @@ +// TODO nf-core: Once you have added the required tests, please run the following command to build this file: +// nf-core modules test meryl/count +nextflow_process { + + name "Test Process MERYL_COUNT" + script "../main.nf" + process "MERYL_COUNT" + + tag "modules" + tag "modules_nfcore" + tag "meryl" + tag "meryl/count" + + // TODO nf-core: Change the test name preferably indicating the test-data and file-format used + test("sarscov2 - bam") { + + // TODO nf-core: If you are created a test for a chained module + // (the module requires running more than one process to generate the required output) + // add the 'setup' method here. + // You can find more information about how to use a 'setup' method in the docs (https://nf-co.re/docs/contributing/modules#steps-for-creating-nf-test-for-chained-modules). + + when { + process { + """ + // TODO nf-core: define inputs of the process here. Example: + + input[0] = file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + //TODO nf-core: Add all required assertions to verify the test output. + // See https://nf-co.re/docs/contributing/tutorials/nf-test_assertions for more information and examples. + ) + } + + } + + // TODO nf-core: Change the test name preferably indicating the test-data and file-format used but keep the " - stub" suffix. + test("sarscov2 - bam - stub") { + + options "-stub" + + when { + process { + """ + // TODO nf-core: define inputs of the process here. Example: + + input[0] = file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + //TODO nf-core: Add all required assertions to verify the test output. + ) + } + + } + +} diff --git a/modules/nf-core/meryl/count/tests/nextflow.config b/modules/nf-core/meryl/count/tests/nextflow.config new file mode 100644 index 00000000000..a657f33359d --- /dev/null +++ b/modules/nf-core/meryl/count/tests/nextflow.config @@ -0,0 +1,3 @@ +process { + ext.args = 'k=21' +} diff --git a/modules/nf-core/meryl/count/tests/tags.yml b/modules/nf-core/meryl/count/tests/tags.yml new file mode 100644 index 00000000000..b25bfa60655 --- /dev/null +++ b/modules/nf-core/meryl/count/tests/tags.yml @@ -0,0 +1,2 @@ +meryl/count: + - "modules/nf-core/meryl/count/**" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index a539e80802b..30f23ee4131 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1234,9 +1234,6 @@ merquryfk/merquryfk: merquryfk/ploidyplot: - modules/nf-core/merquryfk/ploidyplot/** - tests/modules/nf-core/merquryfk/ploidyplot/** -meryl/count: - - modules/nf-core/meryl/count/** - - tests/modules/nf-core/meryl/count/** meryl/histogram: - modules/nf-core/meryl/histogram/** - tests/modules/nf-core/meryl/histogram/** diff --git a/tests/modules/nf-core/meryl/count/main.nf b/tests/modules/nf-core/meryl/count/main.nf deleted file mode 100644 index cd71fb983da..00000000000 --- a/tests/modules/nf-core/meryl/count/main.nf +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { MERYL_COUNT } from '../../../../../modules/nf-core/meryl/count/main.nf' - -workflow test_meryl_count_single_end { - - input = [ - [ id:'test' , single_end: true ], // meta map - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) - ] - - MERYL_COUNT ( input ) -} - -workflow test_meryl_count_paired_end { - - input = [ - [ 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) - ] - ] - - MERYL_COUNT ( input ) -} diff --git a/tests/modules/nf-core/meryl/count/nextflow.config b/tests/modules/nf-core/meryl/count/nextflow.config deleted file mode 100644 index 6d899c503af..00000000000 --- a/tests/modules/nf-core/meryl/count/nextflow.config +++ /dev/null @@ -1,6 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - ext.args = 'k=21' - -} diff --git a/tests/modules/nf-core/meryl/count/test.yml b/tests/modules/nf-core/meryl/count/test.yml deleted file mode 100644 index 7f4f9a50aac..00000000000 --- a/tests/modules/nf-core/meryl/count/test.yml +++ /dev/null @@ -1,17 +0,0 @@ -- name: meryl count test_meryl_count_single_end - command: nextflow run ./tests/modules/nf-core/meryl/count -entry test_meryl_count_single_end -c ./tests/config/nextflow.config - tags: - - meryl/count - - meryl - files: - - path: output/meryl/versions.yml - md5sum: 5fe537d873925ccbcc4edf0983e9eda0 - -- name: meryl count test_meryl_count_paired_end - command: nextflow run ./tests/modules/nf-core/meryl/count -entry test_meryl_count_paired_end -c ./tests/config/nextflow.config - tags: - - meryl/count - - meryl - files: - - path: output/meryl/versions.yml - md5sum: 4961f13cfb60ba8764ed666e70dbf12c From 933f88f430821bdd8a4c307434f4b9f29cdd8ed2 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Tue, 26 Mar 2024 19:16:59 +0000 Subject: [PATCH 02/16] Add stub Co-authored-by: rodtheo --- modules/nf-core/meryl/count/main.nf | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/nf-core/meryl/count/main.nf b/modules/nf-core/meryl/count/main.nf index 6e46d2a20a7..bd48f8624f4 100644 --- a/modules/nf-core/meryl/count/main.nf +++ b/modules/nf-core/meryl/count/main.nf @@ -34,4 +34,18 @@ process MERYL_COUNT { meryl: \$( meryl --version |& sed 's/meryl //' ) END_VERSIONS """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + for READ in $reads; do + touch read.\${READ%.f*}.meryldb + done + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + meryl: \$( meryl --version |& sed 's/meryl //' ) + END_VERSIONS + """ } From 2b20266d8c954359e3dd0188678a784fb2bb8fb1 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Tue, 26 Mar 2024 19:19:19 +0000 Subject: [PATCH 03/16] Fix linting Co-authored-by: rodtheo --- modules/nf-core/meryl/count/meta.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/nf-core/meryl/count/meta.yml b/modules/nf-core/meryl/count/meta.yml index a4de42e0bcc..0c9427e9ccf 100644 --- a/modules/nf-core/meryl/count/meta.yml +++ b/modules/nf-core/meryl/count/meta.yml @@ -3,13 +3,14 @@ description: A genomic k-mer counter (and sequence utility) with nice features. keywords: - k-mer - count + - reference-free tools: - "meryl": description: "A genomic k-mer counter (and sequence utility) with nice features. " homepage: "https://github.com/marbl/meryl" documentation: "https://meryl.readthedocs.io/en/latest/quick-start.html" tool_dev_url: "https://github.com/marbl/meryl" - licence: "['GPL']" + licence: ["GPL"] input: - meta: type: map From 76c1e8c7baf9c4e991b604002d191c84ab10e44c Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Tue, 26 Mar 2024 19:26:49 +0000 Subject: [PATCH 04/16] Update test --- .../nf-core/meryl/count/tests/main.nf.test | 30 ++++++++----------- .../nf-core/meryl/count/tests/nextflow.config | 3 -- 2 files changed, 12 insertions(+), 21 deletions(-) delete mode 100644 modules/nf-core/meryl/count/tests/nextflow.config diff --git a/modules/nf-core/meryl/count/tests/main.nf.test b/modules/nf-core/meryl/count/tests/main.nf.test index 400e7432d37..a4d27789c1c 100644 --- a/modules/nf-core/meryl/count/tests/main.nf.test +++ b/modules/nf-core/meryl/count/tests/main.nf.test @@ -11,20 +11,16 @@ nextflow_process { tag "meryl" tag "meryl/count" - // TODO nf-core: Change the test name preferably indicating the test-data and file-format used - test("sarscov2 - bam") { - - // TODO nf-core: If you are created a test for a chained module - // (the module requires running more than one process to generate the required output) - // add the 'setup' method here. - // You can find more information about how to use a 'setup' method in the docs (https://nf-co.re/docs/contributing/modules#steps-for-creating-nf-test-for-chained-modules). + test("bacteroides_fragilis - fastq") { when { process { """ - // TODO nf-core: define inputs of the process here. Example: - - input[0] = file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true) + input[0] = Channel.value([ + [ id: 'test', single_end: true ], // meta map + file( params.modules_testdata_base_path + "/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_1.fastq.gz", checkIfExists: true ) + ]) + input[1] = Channel.value(21) """ } } @@ -33,24 +29,23 @@ nextflow_process { assertAll( { assert process.success }, { assert snapshot(process.out).match() } - //TODO nf-core: Add all required assertions to verify the test output. - // See https://nf-co.re/docs/contributing/tutorials/nf-test_assertions for more information and examples. ) } } - // TODO nf-core: Change the test name preferably indicating the test-data and file-format used but keep the " - stub" suffix. - test("sarscov2 - bam - stub") { + test("bacteroides_fragilis - fastq - stub") { options "-stub" when { process { """ - // TODO nf-core: define inputs of the process here. Example: - - input[0] = file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true) + input[0] = Channel.value([ + [ id: 'test', single_end: true ], // meta map + file( params.modules_testdata_base_path + "/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_1.fastq.gz", checkIfExists: true ) + ]) + input[1] = Channel.value(21) """ } } @@ -59,7 +54,6 @@ nextflow_process { assertAll( { assert process.success }, { assert snapshot(process.out).match() } - //TODO nf-core: Add all required assertions to verify the test output. ) } diff --git a/modules/nf-core/meryl/count/tests/nextflow.config b/modules/nf-core/meryl/count/tests/nextflow.config deleted file mode 100644 index a657f33359d..00000000000 --- a/modules/nf-core/meryl/count/tests/nextflow.config +++ /dev/null @@ -1,3 +0,0 @@ -process { - ext.args = 'k=21' -} From d280e1fe09a89b190c8398ce038947cba16c74b3 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Tue, 26 Mar 2024 19:28:56 +0000 Subject: [PATCH 05/16] Add kvalue as mandatory input --- modules/nf-core/meryl/count/main.nf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/nf-core/meryl/count/main.nf b/modules/nf-core/meryl/count/main.nf index bd48f8624f4..2f0518f3ee9 100644 --- a/modules/nf-core/meryl/count/main.nf +++ b/modules/nf-core/meryl/count/main.nf @@ -9,6 +9,7 @@ process MERYL_COUNT { input: tuple val(meta), path(reads) + val kvalue output: tuple val(meta), path("*.meryldb"), emit: meryl_db @@ -23,6 +24,7 @@ process MERYL_COUNT { """ for READ in $reads; do meryl count \\ + k=$kvalue \\ threads=$task.cpus \\ $args \\ $reads \\ @@ -42,7 +44,7 @@ process MERYL_COUNT { for READ in $reads; do touch read.\${READ%.f*}.meryldb done - + cat <<-END_VERSIONS > versions.yml "${task.process}": meryl: \$( meryl --version |& sed 's/meryl //' ) From 12243ab504b1f7a0df007aa022c0e055840e8842 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Tue, 26 Mar 2024 19:36:04 +0000 Subject: [PATCH 06/16] Add snapshot --- .../meryl/count/tests/main.nf.test.snap | 332 ++++++++++++++++++ 1 file changed, 332 insertions(+) create mode 100644 modules/nf-core/meryl/count/tests/main.nf.test.snap diff --git a/modules/nf-core/meryl/count/tests/main.nf.test.snap b/modules/nf-core/meryl/count/tests/main.nf.test.snap new file mode 100644 index 00000000000..da7c9f31916 --- /dev/null +++ b/modules/nf-core/meryl/count/tests/main.nf.test.snap @@ -0,0 +1,332 @@ +{ + "bacteroides_fragilis - fastq": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + [ + "0x000000.merylData:md5,eefafbacbd0c41e4e4851e0e79a665a2", + "0x000000.merylIndex:md5,be9c1da85afee20689c5c7780b6c4996", + "0x000001.merylData:md5,d7e46736fc2896085b4610c50ec74835", + "0x000001.merylIndex:md5,a68e8b877ed5ce04e6f36a279b2fac0b", + "0x000010.merylData:md5,635badb59ad796363c2ff31801ab3d07", + "0x000010.merylIndex:md5,afed85194fcbd762b7acf86427b41cdd", + "0x000011.merylData:md5,b79970fce39d47cda1312080cac2f5d4", + "0x000011.merylIndex:md5,402ba5cf71656e2d19e584e4b65cadaa", + "0x000100.merylData:md5,48a7160c93fe5dd22fcdf8beb30e9256", + "0x000100.merylIndex:md5,fbfae07482bed8b00c6a690850c632fc", + "0x000101.merylData:md5,3ff336b4d59850f6726a4bd5670d49be", + "0x000101.merylIndex:md5,817edfe6dcbb07801bb9de54e0e1839a", + "0x000110.merylData:md5,41f253dc8240dd26cd8bbe379968aa1f", + "0x000110.merylIndex:md5,64f1400897c3108d5bc4957bea80569c", + "0x000111.merylData:md5,0860dd1bb6ee8e99a315c976b0c6226a", + "0x000111.merylIndex:md5,794aadc07e62b0d872763f2b40615627", + "0x001000.merylData:md5,daee6b4d18a43ce3a6c46ee2e8105a93", + "0x001000.merylIndex:md5,5ec6234ffd7d0380db3adc5aa3a3bb85", + "0x001001.merylData:md5,7e9b6d3c6f116fe418c4a4b0529a795e", + "0x001001.merylIndex:md5,eb63cc438cac77169a527bd6607bd781", + "0x001010.merylData:md5,f93c20dbdd16be37cdcfa263fe3c4ca4", + "0x001010.merylIndex:md5,d00fe5bd25b49bc9084b705017ccf4b9", + "0x001011.merylData:md5,eb25d445533ba345ea4e315750dd878c", + "0x001011.merylIndex:md5,1cacb579a9991dc5ebeef884347b81f5", + "0x001100.merylData:md5,7c783f255d155c23218e14c390b4c505", + "0x001100.merylIndex:md5,41a4d42d07928f3a33fd6c2d4ff613d8", + "0x001101.merylData:md5,98f323f13f99a2c75ccf8db9179f4b7d", + "0x001101.merylIndex:md5,528f3cdc0cbde3f0c91f8e8acd00a3e1", + "0x001110.merylData:md5,12f1c899ed2878d60c3a7ee5eb599839", + "0x001110.merylIndex:md5,755fc26bb9c8fec041798958f83b37b8", + "0x001111.merylData:md5,594881e83a5ece0879e79e2be82847f9", + "0x001111.merylIndex:md5,62625db2836f07303c9e4d383574143f", + "0x010000.merylData:md5,537d1a60554bd68386509fc3edd5e609", + "0x010000.merylIndex:md5,2bf23b6a552306dab61d0da0ad0789e0", + "0x010001.merylData:md5,9baef5a2ea4ed43caf18cabcdccaa3eb", + "0x010001.merylIndex:md5,ff98a6e5d18ab52795c6af00f47fc355", + "0x010010.merylData:md5,3b37668e9f9e1fc220e1fed36ecb7f86", + "0x010010.merylIndex:md5,0724a75055d62586f95f8b5c58688dd3", + "0x010011.merylData:md5,b4a039219f34df414048a023beea583b", + "0x010011.merylIndex:md5,34b29bdb6676e172e80202d36a0551d7", + "0x010100.merylData:md5,a49dfdebd8c4b3ff5ed1f4f84128b7e7", + "0x010100.merylIndex:md5,7cf00a46160bcb04de47e8bd05e8696b", + "0x010101.merylData:md5,0065195381f0a8629426139f3ba97327", + "0x010101.merylIndex:md5,de73cfc31abb763a11e063711f4b86bd", + "0x010110.merylData:md5,b331a0a2a59e46741366b8f811eaafcb", + "0x010110.merylIndex:md5,1caca7c16ffcc8070fbb58f4c9936089", + "0x010111.merylData:md5,7a51306a008a7f7639d98b4d1f24be92", + "0x010111.merylIndex:md5,12572a822643689bbc77030acb395850", + "0x011000.merylData:md5,6cdc1ab34d47f23a298ed3fc1d80ab4a", + "0x011000.merylIndex:md5,8947c6d693556b2530aed1f9ba0f23ba", + "0x011001.merylData:md5,9901aed256e9790ee9fe4a797bdc2348", + "0x011001.merylIndex:md5,1538131168e32210c7ada2fe7379ca18", + "0x011010.merylData:md5,30a5df2f9d2b33bd76780c5e1a1dca39", + "0x011010.merylIndex:md5,61d929e6929922e3206d6338340a9f87", + "0x011011.merylData:md5,edf65fc218d2b867a7117d0cd20bb578", + "0x011011.merylIndex:md5,fd6c02e383ec73fe31051ab16c3dc590", + "0x011100.merylData:md5,c0cbe5856dab102fc6ecdc481739936e", + "0x011100.merylIndex:md5,2c938d6d5806169f5718e35308d5664e", + "0x011101.merylData:md5,135031f4ec8f4f9fee07a6cd980a8f4e", + "0x011101.merylIndex:md5,855f5b00dce3c1307db74935f34ff777", + "0x011110.merylData:md5,e9c9a04e6d1a8763ad22dbc810918c8e", + "0x011110.merylIndex:md5,4bf0e856bea5404c683f77a857c8be04", + "0x011111.merylData:md5,5f8032cedc4fe13e9eee3a1e7b58ffd9", + "0x011111.merylIndex:md5,c7ff331ae2cb2c9f63cd33a57e3f707a", + "0x100000.merylData:md5,100d73f6f495c20c52c12c2e12764c33", + "0x100000.merylIndex:md5,3e1715843526e9ad1908d1a6dd882364", + "0x100001.merylData:md5,f97f4b5624e8cc4d7899fe31898b75ba", + "0x100001.merylIndex:md5,f5b5337094755876ad5ddfe9471f17a7", + "0x100010.merylData:md5,d68cc8b0acd31a80b46dc59c682a9875", + "0x100010.merylIndex:md5,d3e62d9d487c8299dd4b2806309f2757", + "0x100011.merylData:md5,71b87c478dcfdd496dfaae98c532c551", + "0x100011.merylIndex:md5,5cbdcd1ebbbc5e0e4848aedfba8f4d7a", + "0x100100.merylData:md5,bfbd0b14ae7633f162c2eba5ebf429f2", + "0x100100.merylIndex:md5,327cdff7a43f60879b611c56fc689570", + "0x100101.merylData:md5,c9147b0a4adc493a15f4c79d39792956", + "0x100101.merylIndex:md5,93f5cb4c0a35c15fc45d88561627d6c8", + "0x100110.merylData:md5,4e05cbeec33b4085f460093e1a5905a7", + "0x100110.merylIndex:md5,b065c6aa4180b82bcc1d723513bd5d4b", + "0x100111.merylData:md5,68a6a2ca12adba1c57dad51d73d47339", + "0x100111.merylIndex:md5,f1344a178e0141497f404de76758cc27", + "0x101000.merylData:md5,15cefb92f8ba5ee54472b66b44fb6d9d", + "0x101000.merylIndex:md5,4c83229ee4be2fbd5732d6dae5aacb28", + "0x101001.merylData:md5,910c4abf7a925e2582b13d7e396c591b", + "0x101001.merylIndex:md5,8fc1b16e74ad2ccf7a5cf330df47735c", + "0x101010.merylData:md5,85bf310f1cd130f2201d81daca291ff7", + "0x101010.merylIndex:md5,72ea3767e2730d318c292d5d48deb63f", + "0x101011.merylData:md5,033989603839db494fdffadedca76a6c", + "0x101011.merylIndex:md5,8f3731e5cf80723f7bcf1f2b90d5667b", + "0x101100.merylData:md5,df342143a9c4c54f2e8e6496b6e4f708", + "0x101100.merylIndex:md5,c3421ce5e8b49548df91cd195315e139", + "0x101101.merylData:md5,42d25675e9d0bc06c8b34d75d07a4caf", + "0x101101.merylIndex:md5,5c2f10b939ec5d463c524af55cd25c24", + "0x101110.merylData:md5,2e43f76c1e826da6fb9757b4f812acd1", + "0x101110.merylIndex:md5,b6b3ba4282ca1417462c50c43c164a0c", + "0x101111.merylData:md5,45732e59a9113476954035ffe0e7b601", + "0x101111.merylIndex:md5,45a3da9ddd34c4b5651690ce421ee5f2", + "0x110000.merylData:md5,e10a6e9169bc8fbdbbbac680e58e9781", + "0x110000.merylIndex:md5,53b2dbff4c7598489dba7956f2accdda", + "0x110001.merylData:md5,3db19699cedecafea182e146ecf2b24d", + "0x110001.merylIndex:md5,3271f69d5830172dbab92cdae3a5b3a3", + "0x110010.merylData:md5,6c9ccb0ca19ec3dd0bcac3d4ac16c1bb", + "0x110010.merylIndex:md5,f9a3fcc0aa34271866a2730a487bcff0", + "0x110011.merylData:md5,03138380dd03d3ec08b6ceee3bb8ecdc", + "0x110011.merylIndex:md5,26a57f682f875ee3e920e28f9351e586", + "0x110100.merylData:md5,caa3b1d6f1a5ea7815511b729dcb4f5a", + "0x110100.merylIndex:md5,7d4f76e3dddb398de2f233bfb80f6161", + "0x110101.merylData:md5,1f3a72ccf2fdee4332f2b34d2368f585", + "0x110101.merylIndex:md5,317e723efbc4bb073cddaaae3bba0931", + "0x110110.merylData:md5,fe8eb93ed0cf30cac4678179b0d2daa7", + "0x110110.merylIndex:md5,66c33da6a8b65ad35d0e0717c9d134eb", + "0x110111.merylData:md5,b7aefc0873d30cde41d38c7f1b90efc3", + "0x110111.merylIndex:md5,08cc48d6a13aa4fdce144c3ff41f5be6", + "0x111000.merylData:md5,9504dab5d20741912da8f815912507b9", + "0x111000.merylIndex:md5,e677a2fb775336b8efda8e41e4bc2720", + "0x111001.merylData:md5,eabf6c9b053696a34f38136f4fa05ed8", + "0x111001.merylIndex:md5,55479260f69d1d3abab93d0e155d0f2f", + "0x111010.merylData:md5,0ea69feac704ed4bcd434c67a6e5a769", + "0x111010.merylIndex:md5,f60e31a49a6d097b44d0a244685747f9", + "0x111011.merylData:md5,20e7301ecc915e918d390fd45b8bb428", + "0x111011.merylIndex:md5,1d8a61f45b82db9caa8e4b5cb1dbfb30", + "0x111100.merylData:md5,95e6fe905b6c07e7e3537d1ee6a2dca9", + "0x111100.merylIndex:md5,231ddde97648162e313290f49ceab69b", + "0x111101.merylData:md5,79cdba511fae030098025de90472e21d", + "0x111101.merylIndex:md5,e93892161446762ac545e0399e362685", + "0x111110.merylData:md5,062ba875af75297889359bc39409ab99", + "0x111110.merylIndex:md5,0cd1b81c64fee3bf067ce5ca1755a2bc", + "0x111111.merylData:md5,68feb8f1bade7885a9a696bb0825a17f", + "0x111111.merylIndex:md5,fd631e33829939cd7f06581c80791dc4", + "merylIndex:md5,d9e794e14b1eeb0eaa4d98e10eb571cc" + ] + ] + ], + "1": [ + "versions.yml:md5,a4a6baac7481f1d4595ba54622bdf33d" + ], + "meryl_db": [ + [ + { + "id": "test", + "single_end": true + }, + [ + "0x000000.merylData:md5,eefafbacbd0c41e4e4851e0e79a665a2", + "0x000000.merylIndex:md5,be9c1da85afee20689c5c7780b6c4996", + "0x000001.merylData:md5,d7e46736fc2896085b4610c50ec74835", + "0x000001.merylIndex:md5,a68e8b877ed5ce04e6f36a279b2fac0b", + "0x000010.merylData:md5,635badb59ad796363c2ff31801ab3d07", + "0x000010.merylIndex:md5,afed85194fcbd762b7acf86427b41cdd", + "0x000011.merylData:md5,b79970fce39d47cda1312080cac2f5d4", + "0x000011.merylIndex:md5,402ba5cf71656e2d19e584e4b65cadaa", + "0x000100.merylData:md5,48a7160c93fe5dd22fcdf8beb30e9256", + "0x000100.merylIndex:md5,fbfae07482bed8b00c6a690850c632fc", + "0x000101.merylData:md5,3ff336b4d59850f6726a4bd5670d49be", + "0x000101.merylIndex:md5,817edfe6dcbb07801bb9de54e0e1839a", + "0x000110.merylData:md5,41f253dc8240dd26cd8bbe379968aa1f", + "0x000110.merylIndex:md5,64f1400897c3108d5bc4957bea80569c", + "0x000111.merylData:md5,0860dd1bb6ee8e99a315c976b0c6226a", + "0x000111.merylIndex:md5,794aadc07e62b0d872763f2b40615627", + "0x001000.merylData:md5,daee6b4d18a43ce3a6c46ee2e8105a93", + "0x001000.merylIndex:md5,5ec6234ffd7d0380db3adc5aa3a3bb85", + "0x001001.merylData:md5,7e9b6d3c6f116fe418c4a4b0529a795e", + "0x001001.merylIndex:md5,eb63cc438cac77169a527bd6607bd781", + "0x001010.merylData:md5,f93c20dbdd16be37cdcfa263fe3c4ca4", + "0x001010.merylIndex:md5,d00fe5bd25b49bc9084b705017ccf4b9", + "0x001011.merylData:md5,eb25d445533ba345ea4e315750dd878c", + "0x001011.merylIndex:md5,1cacb579a9991dc5ebeef884347b81f5", + "0x001100.merylData:md5,7c783f255d155c23218e14c390b4c505", + "0x001100.merylIndex:md5,41a4d42d07928f3a33fd6c2d4ff613d8", + "0x001101.merylData:md5,98f323f13f99a2c75ccf8db9179f4b7d", + "0x001101.merylIndex:md5,528f3cdc0cbde3f0c91f8e8acd00a3e1", + "0x001110.merylData:md5,12f1c899ed2878d60c3a7ee5eb599839", + "0x001110.merylIndex:md5,755fc26bb9c8fec041798958f83b37b8", + "0x001111.merylData:md5,594881e83a5ece0879e79e2be82847f9", + "0x001111.merylIndex:md5,62625db2836f07303c9e4d383574143f", + "0x010000.merylData:md5,537d1a60554bd68386509fc3edd5e609", + "0x010000.merylIndex:md5,2bf23b6a552306dab61d0da0ad0789e0", + "0x010001.merylData:md5,9baef5a2ea4ed43caf18cabcdccaa3eb", + "0x010001.merylIndex:md5,ff98a6e5d18ab52795c6af00f47fc355", + "0x010010.merylData:md5,3b37668e9f9e1fc220e1fed36ecb7f86", + "0x010010.merylIndex:md5,0724a75055d62586f95f8b5c58688dd3", + "0x010011.merylData:md5,b4a039219f34df414048a023beea583b", + "0x010011.merylIndex:md5,34b29bdb6676e172e80202d36a0551d7", + "0x010100.merylData:md5,a49dfdebd8c4b3ff5ed1f4f84128b7e7", + "0x010100.merylIndex:md5,7cf00a46160bcb04de47e8bd05e8696b", + "0x010101.merylData:md5,0065195381f0a8629426139f3ba97327", + "0x010101.merylIndex:md5,de73cfc31abb763a11e063711f4b86bd", + "0x010110.merylData:md5,b331a0a2a59e46741366b8f811eaafcb", + "0x010110.merylIndex:md5,1caca7c16ffcc8070fbb58f4c9936089", + "0x010111.merylData:md5,7a51306a008a7f7639d98b4d1f24be92", + "0x010111.merylIndex:md5,12572a822643689bbc77030acb395850", + "0x011000.merylData:md5,6cdc1ab34d47f23a298ed3fc1d80ab4a", + "0x011000.merylIndex:md5,8947c6d693556b2530aed1f9ba0f23ba", + "0x011001.merylData:md5,9901aed256e9790ee9fe4a797bdc2348", + "0x011001.merylIndex:md5,1538131168e32210c7ada2fe7379ca18", + "0x011010.merylData:md5,30a5df2f9d2b33bd76780c5e1a1dca39", + "0x011010.merylIndex:md5,61d929e6929922e3206d6338340a9f87", + "0x011011.merylData:md5,edf65fc218d2b867a7117d0cd20bb578", + "0x011011.merylIndex:md5,fd6c02e383ec73fe31051ab16c3dc590", + "0x011100.merylData:md5,c0cbe5856dab102fc6ecdc481739936e", + "0x011100.merylIndex:md5,2c938d6d5806169f5718e35308d5664e", + "0x011101.merylData:md5,135031f4ec8f4f9fee07a6cd980a8f4e", + "0x011101.merylIndex:md5,855f5b00dce3c1307db74935f34ff777", + "0x011110.merylData:md5,e9c9a04e6d1a8763ad22dbc810918c8e", + "0x011110.merylIndex:md5,4bf0e856bea5404c683f77a857c8be04", + "0x011111.merylData:md5,5f8032cedc4fe13e9eee3a1e7b58ffd9", + "0x011111.merylIndex:md5,c7ff331ae2cb2c9f63cd33a57e3f707a", + "0x100000.merylData:md5,100d73f6f495c20c52c12c2e12764c33", + "0x100000.merylIndex:md5,3e1715843526e9ad1908d1a6dd882364", + "0x100001.merylData:md5,f97f4b5624e8cc4d7899fe31898b75ba", + "0x100001.merylIndex:md5,f5b5337094755876ad5ddfe9471f17a7", + "0x100010.merylData:md5,d68cc8b0acd31a80b46dc59c682a9875", + "0x100010.merylIndex:md5,d3e62d9d487c8299dd4b2806309f2757", + "0x100011.merylData:md5,71b87c478dcfdd496dfaae98c532c551", + "0x100011.merylIndex:md5,5cbdcd1ebbbc5e0e4848aedfba8f4d7a", + "0x100100.merylData:md5,bfbd0b14ae7633f162c2eba5ebf429f2", + "0x100100.merylIndex:md5,327cdff7a43f60879b611c56fc689570", + "0x100101.merylData:md5,c9147b0a4adc493a15f4c79d39792956", + "0x100101.merylIndex:md5,93f5cb4c0a35c15fc45d88561627d6c8", + "0x100110.merylData:md5,4e05cbeec33b4085f460093e1a5905a7", + "0x100110.merylIndex:md5,b065c6aa4180b82bcc1d723513bd5d4b", + "0x100111.merylData:md5,68a6a2ca12adba1c57dad51d73d47339", + "0x100111.merylIndex:md5,f1344a178e0141497f404de76758cc27", + "0x101000.merylData:md5,15cefb92f8ba5ee54472b66b44fb6d9d", + "0x101000.merylIndex:md5,4c83229ee4be2fbd5732d6dae5aacb28", + "0x101001.merylData:md5,910c4abf7a925e2582b13d7e396c591b", + "0x101001.merylIndex:md5,8fc1b16e74ad2ccf7a5cf330df47735c", + "0x101010.merylData:md5,85bf310f1cd130f2201d81daca291ff7", + "0x101010.merylIndex:md5,72ea3767e2730d318c292d5d48deb63f", + "0x101011.merylData:md5,033989603839db494fdffadedca76a6c", + "0x101011.merylIndex:md5,8f3731e5cf80723f7bcf1f2b90d5667b", + "0x101100.merylData:md5,df342143a9c4c54f2e8e6496b6e4f708", + "0x101100.merylIndex:md5,c3421ce5e8b49548df91cd195315e139", + "0x101101.merylData:md5,42d25675e9d0bc06c8b34d75d07a4caf", + "0x101101.merylIndex:md5,5c2f10b939ec5d463c524af55cd25c24", + "0x101110.merylData:md5,2e43f76c1e826da6fb9757b4f812acd1", + "0x101110.merylIndex:md5,b6b3ba4282ca1417462c50c43c164a0c", + "0x101111.merylData:md5,45732e59a9113476954035ffe0e7b601", + "0x101111.merylIndex:md5,45a3da9ddd34c4b5651690ce421ee5f2", + "0x110000.merylData:md5,e10a6e9169bc8fbdbbbac680e58e9781", + "0x110000.merylIndex:md5,53b2dbff4c7598489dba7956f2accdda", + "0x110001.merylData:md5,3db19699cedecafea182e146ecf2b24d", + "0x110001.merylIndex:md5,3271f69d5830172dbab92cdae3a5b3a3", + "0x110010.merylData:md5,6c9ccb0ca19ec3dd0bcac3d4ac16c1bb", + "0x110010.merylIndex:md5,f9a3fcc0aa34271866a2730a487bcff0", + "0x110011.merylData:md5,03138380dd03d3ec08b6ceee3bb8ecdc", + "0x110011.merylIndex:md5,26a57f682f875ee3e920e28f9351e586", + "0x110100.merylData:md5,caa3b1d6f1a5ea7815511b729dcb4f5a", + "0x110100.merylIndex:md5,7d4f76e3dddb398de2f233bfb80f6161", + "0x110101.merylData:md5,1f3a72ccf2fdee4332f2b34d2368f585", + "0x110101.merylIndex:md5,317e723efbc4bb073cddaaae3bba0931", + "0x110110.merylData:md5,fe8eb93ed0cf30cac4678179b0d2daa7", + "0x110110.merylIndex:md5,66c33da6a8b65ad35d0e0717c9d134eb", + "0x110111.merylData:md5,b7aefc0873d30cde41d38c7f1b90efc3", + "0x110111.merylIndex:md5,08cc48d6a13aa4fdce144c3ff41f5be6", + "0x111000.merylData:md5,9504dab5d20741912da8f815912507b9", + "0x111000.merylIndex:md5,e677a2fb775336b8efda8e41e4bc2720", + "0x111001.merylData:md5,eabf6c9b053696a34f38136f4fa05ed8", + "0x111001.merylIndex:md5,55479260f69d1d3abab93d0e155d0f2f", + "0x111010.merylData:md5,0ea69feac704ed4bcd434c67a6e5a769", + "0x111010.merylIndex:md5,f60e31a49a6d097b44d0a244685747f9", + "0x111011.merylData:md5,20e7301ecc915e918d390fd45b8bb428", + "0x111011.merylIndex:md5,1d8a61f45b82db9caa8e4b5cb1dbfb30", + "0x111100.merylData:md5,95e6fe905b6c07e7e3537d1ee6a2dca9", + "0x111100.merylIndex:md5,231ddde97648162e313290f49ceab69b", + "0x111101.merylData:md5,79cdba511fae030098025de90472e21d", + "0x111101.merylIndex:md5,e93892161446762ac545e0399e362685", + "0x111110.merylData:md5,062ba875af75297889359bc39409ab99", + "0x111110.merylIndex:md5,0cd1b81c64fee3bf067ce5ca1755a2bc", + "0x111111.merylData:md5,68feb8f1bade7885a9a696bb0825a17f", + "0x111111.merylIndex:md5,fd631e33829939cd7f06581c80791dc4", + "merylIndex:md5,d9e794e14b1eeb0eaa4d98e10eb571cc" + ] + ] + ], + "versions": [ + "versions.yml:md5,a4a6baac7481f1d4595ba54622bdf33d" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-26T19:30:03.054214308" + }, + "bacteroides_fragilis - fastq - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "read.test1_1.meryldb:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,a4a6baac7481f1d4595ba54622bdf33d" + ], + "meryl_db": [ + [ + { + "id": "test", + "single_end": true + }, + "read.test1_1.meryldb:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,a4a6baac7481f1d4595ba54622bdf33d" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-26T19:30:13.745468405" + } +} \ No newline at end of file From 7229a12b2073dacffae2fc272b4c2bd765207274 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Tue, 26 Mar 2024 19:38:19 +0000 Subject: [PATCH 07/16] Lint --- modules/nf-core/meryl/count/meta.yml | 3 +++ modules/nf-core/meryl/count/tests/main.nf.test | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/meryl/count/meta.yml b/modules/nf-core/meryl/count/meta.yml index 0c9427e9ccf..c9347c0ca5d 100644 --- a/modules/nf-core/meryl/count/meta.yml +++ b/modules/nf-core/meryl/count/meta.yml @@ -22,6 +22,9 @@ input: description: | List of input FastQ files of size 1 and 2 for single-end and paired-end data, respectively. + - kvalue: + type: integer + description: An integer value of k to use as the k-mer value. output: - meta: type: map diff --git a/modules/nf-core/meryl/count/tests/main.nf.test b/modules/nf-core/meryl/count/tests/main.nf.test index a4d27789c1c..cce46c363e7 100644 --- a/modules/nf-core/meryl/count/tests/main.nf.test +++ b/modules/nf-core/meryl/count/tests/main.nf.test @@ -1,5 +1,3 @@ -// TODO nf-core: Once you have added the required tests, please run the following command to build this file: -// nf-core modules test meryl/count nextflow_process { name "Test Process MERYL_COUNT" From e712a258f298f56bc462676578eb2c0df6d14ad6 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Tue, 26 Mar 2024 19:49:56 +0000 Subject: [PATCH 08/16] Update GenomeScope2 module to reflect new mandatory parameter --- modules/nf-core/genomescope2/tests/main.nf.test | 1 + modules/nf-core/genomescope2/tests/nextflow.config | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/nf-core/genomescope2/tests/main.nf.test b/modules/nf-core/genomescope2/tests/main.nf.test index 677e4262a8a..c98a4e87dc3 100644 --- a/modules/nf-core/genomescope2/tests/main.nf.test +++ b/modules/nf-core/genomescope2/tests/main.nf.test @@ -20,6 +20,7 @@ nextflow_process { [ id: 'test', single_end: true ], // meta map file( params.modules_testdata_base_path + "/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_1.fastq.gz", checkIfExists: true ) ]) + input[1] = Channel.value(21) """ } } diff --git a/modules/nf-core/genomescope2/tests/nextflow.config b/modules/nf-core/genomescope2/tests/nextflow.config index 33340158d60..7f50eb30332 100644 --- a/modules/nf-core/genomescope2/tests/nextflow.config +++ b/modules/nf-core/genomescope2/tests/nextflow.config @@ -1,5 +1,5 @@ process { - withName: 'MERYL.*' { + withName: 'MERYL_HISTOGRAM' { ext.args = 'k=21' } withName: 'GENOMESCOPE2' { From 47a72be7b3bf1e5b91ce2436fd39a7525ed01fbb Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Tue, 26 Mar 2024 20:08:32 +0000 Subject: [PATCH 09/16] migrate meryl/histogram to nf-test --- .../meryl/histogram/tests/main.nf.test | 68 +++++++++++++++++++ .../meryl/histogram/tests/nextflow.config | 3 + .../nf-core/meryl/histogram/tests/tags.yml | 2 + tests/config/pytest_modules.yml | 3 - tests/modules/nf-core/meryl/histogram/main.nf | 17 ----- .../nf-core/meryl/histogram/nextflow.config | 6 -- .../modules/nf-core/meryl/histogram/test.yml | 10 --- 7 files changed, 73 insertions(+), 36 deletions(-) create mode 100644 modules/nf-core/meryl/histogram/tests/main.nf.test create mode 100644 modules/nf-core/meryl/histogram/tests/nextflow.config create mode 100644 modules/nf-core/meryl/histogram/tests/tags.yml delete mode 100644 tests/modules/nf-core/meryl/histogram/main.nf delete mode 100644 tests/modules/nf-core/meryl/histogram/nextflow.config delete mode 100644 tests/modules/nf-core/meryl/histogram/test.yml diff --git a/modules/nf-core/meryl/histogram/tests/main.nf.test b/modules/nf-core/meryl/histogram/tests/main.nf.test new file mode 100644 index 00000000000..b4d83a24b7f --- /dev/null +++ b/modules/nf-core/meryl/histogram/tests/main.nf.test @@ -0,0 +1,68 @@ +// TODO nf-core: Once you have added the required tests, please run the following command to build this file: +// nf-core modules test meryl/histogram +nextflow_process { + + name "Test Process MERYL_HISTOGRAM" + script "../main.nf" + process "MERYL_HISTOGRAM" + + tag "modules" + tag "modules_nfcore" + tag "meryl" + tag "meryl/histogram" + + // TODO nf-core: Change the test name preferably indicating the test-data and file-format used + test("sarscov2 - bam") { + + // TODO nf-core: If you are created a test for a chained module + // (the module requires running more than one process to generate the required output) + // add the 'setup' method here. + // You can find more information about how to use a 'setup' method in the docs (https://nf-co.re/docs/contributing/modules#steps-for-creating-nf-test-for-chained-modules). + + when { + process { + """ + // TODO nf-core: define inputs of the process here. Example: + + input[0] = file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + //TODO nf-core: Add all required assertions to verify the test output. + // See https://nf-co.re/docs/contributing/tutorials/nf-test_assertions for more information and examples. + ) + } + + } + + // TODO nf-core: Change the test name preferably indicating the test-data and file-format used but keep the " - stub" suffix. + test("sarscov2 - bam - stub") { + + options "-stub" + + when { + process { + """ + // TODO nf-core: define inputs of the process here. Example: + + input[0] = file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + //TODO nf-core: Add all required assertions to verify the test output. + ) + } + + } + +} diff --git a/modules/nf-core/meryl/histogram/tests/nextflow.config b/modules/nf-core/meryl/histogram/tests/nextflow.config new file mode 100644 index 00000000000..a657f33359d --- /dev/null +++ b/modules/nf-core/meryl/histogram/tests/nextflow.config @@ -0,0 +1,3 @@ +process { + ext.args = 'k=21' +} diff --git a/modules/nf-core/meryl/histogram/tests/tags.yml b/modules/nf-core/meryl/histogram/tests/tags.yml new file mode 100644 index 00000000000..39fbc344201 --- /dev/null +++ b/modules/nf-core/meryl/histogram/tests/tags.yml @@ -0,0 +1,2 @@ +meryl/histogram: + - "modules/nf-core/meryl/histogram/**" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 30f23ee4131..f4ff16b7156 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1234,9 +1234,6 @@ merquryfk/merquryfk: merquryfk/ploidyplot: - modules/nf-core/merquryfk/ploidyplot/** - tests/modules/nf-core/merquryfk/ploidyplot/** -meryl/histogram: - - modules/nf-core/meryl/histogram/** - - tests/modules/nf-core/meryl/histogram/** meryl/unionsum: - modules/nf-core/meryl/unionsum/** - tests/modules/nf-core/meryl/unionsum/** diff --git a/tests/modules/nf-core/meryl/histogram/main.nf b/tests/modules/nf-core/meryl/histogram/main.nf deleted file mode 100644 index 153a76d44bf..00000000000 --- a/tests/modules/nf-core/meryl/histogram/main.nf +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { MERYL_COUNT } from '../../../../../modules/nf-core/meryl/count/main.nf' -include { MERYL_HISTOGRAM } from '../../../../../modules/nf-core/meryl/histogram/main.nf' - -workflow test_meryl_histogram { - - input = [ - [ id:'test' ], // meta map - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) - ] - - MERYL_COUNT ( input ) - MERYL_HISTOGRAM ( MERYL_COUNT.out.meryl_db ) -} diff --git a/tests/modules/nf-core/meryl/histogram/nextflow.config b/tests/modules/nf-core/meryl/histogram/nextflow.config deleted file mode 100644 index 6d899c503af..00000000000 --- a/tests/modules/nf-core/meryl/histogram/nextflow.config +++ /dev/null @@ -1,6 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - ext.args = 'k=21' - -} diff --git a/tests/modules/nf-core/meryl/histogram/test.yml b/tests/modules/nf-core/meryl/histogram/test.yml deleted file mode 100644 index 7d794aa773b..00000000000 --- a/tests/modules/nf-core/meryl/histogram/test.yml +++ /dev/null @@ -1,10 +0,0 @@ -- name: meryl histogram test_meryl_histogram - command: nextflow run ./tests/modules/nf-core/meryl/histogram -entry test_meryl_histogram -c ./tests/config/nextflow.config - tags: - - meryl/histogram - - meryl - files: - - path: output/meryl/test.hist - md5sum: 4bfdc8b287ee0cfd9922bbfa8cd64650 - - path: output/meryl/versions.yml - md5sum: 050038f1b1df79977a393cce1b4b2ddb From 3fb2e7d8405ca1fc7965fcafe8453cd943793090 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Tue, 26 Mar 2024 20:10:08 +0000 Subject: [PATCH 10/16] Add mandatory kvalue to input --- modules/nf-core/meryl/histogram/main.nf | 2 ++ modules/nf-core/meryl/histogram/meta.yml | 3 +++ modules/nf-core/meryl/histogram/tests/nextflow.config | 3 --- 3 files changed, 5 insertions(+), 3 deletions(-) delete mode 100644 modules/nf-core/meryl/histogram/tests/nextflow.config diff --git a/modules/nf-core/meryl/histogram/main.nf b/modules/nf-core/meryl/histogram/main.nf index 32f1e9bbc54..c889d421595 100644 --- a/modules/nf-core/meryl/histogram/main.nf +++ b/modules/nf-core/meryl/histogram/main.nf @@ -9,6 +9,7 @@ process MERYL_HISTOGRAM { input: tuple val(meta), path(meryl_db) + val kvalue output: tuple val(meta), path("*.hist"), emit: hist @@ -22,6 +23,7 @@ process MERYL_HISTOGRAM { def prefix = task.ext.prefix ?: "${meta.id}" """ meryl histogram \\ + k=$kvalue \\ threads=$task.cpus \\ $args \\ $meryl_db > ${prefix}.hist diff --git a/modules/nf-core/meryl/histogram/meta.yml b/modules/nf-core/meryl/histogram/meta.yml index f8d2b43f9c0..0187b17fcad 100644 --- a/modules/nf-core/meryl/histogram/meta.yml +++ b/modules/nf-core/meryl/histogram/meta.yml @@ -19,6 +19,9 @@ input: - meryl_dbs: type: directory description: Meryl k-mer database + - kvalue: + type: integer + description: An integer value of k to use as the k-mer value. output: - meta: type: map diff --git a/modules/nf-core/meryl/histogram/tests/nextflow.config b/modules/nf-core/meryl/histogram/tests/nextflow.config deleted file mode 100644 index a657f33359d..00000000000 --- a/modules/nf-core/meryl/histogram/tests/nextflow.config +++ /dev/null @@ -1,3 +0,0 @@ -process { - ext.args = 'k=21' -} From 6c06460c454941940b99b32b171b1c58572625c7 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Tue, 26 Mar 2024 20:12:04 +0000 Subject: [PATCH 11/16] Lint Co-authored-by: rodtheo --- modules/nf-core/meryl/histogram/meta.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/nf-core/meryl/histogram/meta.yml b/modules/nf-core/meryl/histogram/meta.yml index 0187b17fcad..fb67f4ef05e 100644 --- a/modules/nf-core/meryl/histogram/meta.yml +++ b/modules/nf-core/meryl/histogram/meta.yml @@ -3,13 +3,14 @@ description: A genomic k-mer counter (and sequence utility) with nice features. keywords: - k-mer - histogram + - reference-free tools: - "meryl": description: "A genomic k-mer counter (and sequence utility) with nice features. " homepage: "https://github.com/marbl/meryl" documentation: "https://meryl.readthedocs.io/en/latest/quick-start.html" tool_dev_url: "https://github.com/marbl/meryl" - licence: "['GPL']" + licence: ["GPL"] input: - meta: type: map From c499d5f5e4df27ff1031fb37b09288fd008ba19f Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Tue, 26 Mar 2024 20:13:52 +0000 Subject: [PATCH 12/16] Add stub Co-authored-by: rodtheo --- modules/nf-core/meryl/histogram/main.nf | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/nf-core/meryl/histogram/main.nf b/modules/nf-core/meryl/histogram/main.nf index c889d421595..f37ae3efd64 100644 --- a/modules/nf-core/meryl/histogram/main.nf +++ b/modules/nf-core/meryl/histogram/main.nf @@ -33,4 +33,16 @@ process MERYL_HISTOGRAM { meryl: \$( meryl --version |& sed 's/meryl //' ) END_VERSIONS """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.hist + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + meryl: \$( meryl --version |& sed 's/meryl //' ) + END_VERSIONS + """ } From f3329effa7b97142f67e434f1e4707af557864b6 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Tue, 26 Mar 2024 20:18:51 +0000 Subject: [PATCH 13/16] Update test for meryl/histogram --- .../meryl/histogram/tests/main.nf.test | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/modules/nf-core/meryl/histogram/tests/main.nf.test b/modules/nf-core/meryl/histogram/tests/main.nf.test index b4d83a24b7f..9749621a828 100644 --- a/modules/nf-core/meryl/histogram/tests/main.nf.test +++ b/modules/nf-core/meryl/histogram/tests/main.nf.test @@ -1,5 +1,3 @@ -// TODO nf-core: Once you have added the required tests, please run the following command to build this file: -// nf-core modules test meryl/histogram nextflow_process { name "Test Process MERYL_HISTOGRAM" @@ -9,22 +7,31 @@ nextflow_process { tag "modules" tag "modules_nfcore" tag "meryl" + tag "meryl/count" tag "meryl/histogram" - // TODO nf-core: Change the test name preferably indicating the test-data and file-format used - test("sarscov2 - bam") { + setup { + run('MERYL_COUNT'){ + script "../../../../modules/nf-core/meryl/count/main.nf" + process { + """ + input[0] = Channel.value([ + [ id: 'test', single_end: true ], // meta map + file( params.modules_testdata_base_path + "/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_1.fastq.gz", checkIfExists: true ) + ]) + input[1] = Channel.value(21) + """ + } + } + } - // TODO nf-core: If you are created a test for a chained module - // (the module requires running more than one process to generate the required output) - // add the 'setup' method here. - // You can find more information about how to use a 'setup' method in the docs (https://nf-co.re/docs/contributing/modules#steps-for-creating-nf-test-for-chained-modules). + test("bacteroides_fragilis - fastq") { when { process { """ - // TODO nf-core: define inputs of the process here. Example: - - input[0] = file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true) + input[0] = MERYL_COUNT.out.meryl_db + input[1] = Channel.value(21) """ } } @@ -33,24 +40,20 @@ nextflow_process { assertAll( { assert process.success }, { assert snapshot(process.out).match() } - //TODO nf-core: Add all required assertions to verify the test output. - // See https://nf-co.re/docs/contributing/tutorials/nf-test_assertions for more information and examples. ) } } - // TODO nf-core: Change the test name preferably indicating the test-data and file-format used but keep the " - stub" suffix. - test("sarscov2 - bam - stub") { + test("bacteroides_fragilis - fastq - stub") { options "-stub" when { process { """ - // TODO nf-core: define inputs of the process here. Example: - - input[0] = file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true) + input[0] = MERYL_COUNT.out.meryl_db + input[1] = Channel.value(21) """ } } @@ -59,7 +62,6 @@ nextflow_process { assertAll( { assert process.success }, { assert snapshot(process.out).match() } - //TODO nf-core: Add all required assertions to verify the test output. ) } From d4dd8deceb25cdb7674fd94013f72e889e175110 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Tue, 26 Mar 2024 20:20:07 +0000 Subject: [PATCH 14/16] Update meryl version --- modules/nf-core/meryl/histogram/environment.yml | 2 +- modules/nf-core/meryl/histogram/main.nf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/meryl/histogram/environment.yml b/modules/nf-core/meryl/histogram/environment.yml index 4de66ee1a7c..09a324884da 100644 --- a/modules/nf-core/meryl/histogram/environment.yml +++ b/modules/nf-core/meryl/histogram/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::meryl=1.3 + - bioconda::meryl=1.4.1 diff --git a/modules/nf-core/meryl/histogram/main.nf b/modules/nf-core/meryl/histogram/main.nf index f37ae3efd64..622442cc671 100644 --- a/modules/nf-core/meryl/histogram/main.nf +++ b/modules/nf-core/meryl/histogram/main.nf @@ -4,8 +4,8 @@ process MERYL_HISTOGRAM { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/meryl:1.3--h87f3376_1': - 'biocontainers/meryl:1.3--h87f3376_1' }" + 'https://depot.galaxyproject.org/singularity/meryl:1.4.1--h4ac6f70_0': + 'biocontainers/meryl:1.4.1--h4ac6f70_0' }" input: tuple val(meta), path(meryl_db) From 362ce0883013aed96146554dfa8cb33fc053a0d5 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Tue, 26 Mar 2024 20:21:49 +0000 Subject: [PATCH 15/16] Remove meryl/histogram config and add input value to genomescope2 --- modules/nf-core/genomescope2/tests/main.nf.test | 1 + modules/nf-core/genomescope2/tests/nextflow.config | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/nf-core/genomescope2/tests/main.nf.test b/modules/nf-core/genomescope2/tests/main.nf.test index c98a4e87dc3..20c74b328ad 100644 --- a/modules/nf-core/genomescope2/tests/main.nf.test +++ b/modules/nf-core/genomescope2/tests/main.nf.test @@ -29,6 +29,7 @@ nextflow_process { process { """ input[0] = MERYL_COUNT.out.meryl_db + input[1] = Channel.value(21) """ } } diff --git a/modules/nf-core/genomescope2/tests/nextflow.config b/modules/nf-core/genomescope2/tests/nextflow.config index 7f50eb30332..6c6c2770e6e 100644 --- a/modules/nf-core/genomescope2/tests/nextflow.config +++ b/modules/nf-core/genomescope2/tests/nextflow.config @@ -1,7 +1,4 @@ process { - withName: 'MERYL_HISTOGRAM' { - ext.args = 'k=21' - } withName: 'GENOMESCOPE2' { ext.args = '-k 21 -p 1 --fitted_hist' } From 11994b3ccd733c04b8570e2f76eba18631a20257 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Tue, 26 Mar 2024 20:42:48 +0000 Subject: [PATCH 16/16] Fix module path --- .../meryl/histogram/tests/main.nf.test | 2 +- .../meryl/histogram/tests/main.nf.test.snap | 72 +++++++++++++++++++ 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 modules/nf-core/meryl/histogram/tests/main.nf.test.snap diff --git a/modules/nf-core/meryl/histogram/tests/main.nf.test b/modules/nf-core/meryl/histogram/tests/main.nf.test index 9749621a828..307fa39b4a5 100644 --- a/modules/nf-core/meryl/histogram/tests/main.nf.test +++ b/modules/nf-core/meryl/histogram/tests/main.nf.test @@ -12,7 +12,7 @@ nextflow_process { setup { run('MERYL_COUNT'){ - script "../../../../modules/nf-core/meryl/count/main.nf" + script "../../../../../modules/nf-core/meryl/count/main.nf" process { """ input[0] = Channel.value([ diff --git a/modules/nf-core/meryl/histogram/tests/main.nf.test.snap b/modules/nf-core/meryl/histogram/tests/main.nf.test.snap new file mode 100644 index 00000000000..7b2c239e5da --- /dev/null +++ b/modules/nf-core/meryl/histogram/tests/main.nf.test.snap @@ -0,0 +1,72 @@ +{ + "bacteroides_fragilis - fastq": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.hist:md5,f75362ab9cd70d96621b3690e952085f" + ] + ], + "1": [ + "versions.yml:md5,6f83b51cf2e3bc82d1a9823cacf220a5" + ], + "hist": [ + [ + { + "id": "test", + "single_end": true + }, + "test.hist:md5,f75362ab9cd70d96621b3690e952085f" + ] + ], + "versions": [ + "versions.yml:md5,6f83b51cf2e3bc82d1a9823cacf220a5" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-26T20:30:27.901802038" + }, + "bacteroides_fragilis - fastq - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.hist:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,6f83b51cf2e3bc82d1a9823cacf220a5" + ], + "hist": [ + [ + { + "id": "test", + "single_end": true + }, + "test.hist:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,6f83b51cf2e3bc82d1a9823cacf220a5" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-26T20:30:46.254942627" + } +} \ No newline at end of file