From d341db56c465c16b7a8f38cf155e32f5f5aec539 Mon Sep 17 00:00:00 2001 From: rodtheo Date: Tue, 2 Apr 2024 11:57:50 -0300 Subject: [PATCH] styling and removing unnecessary configs for meryl modules --- .../nf-core/merfin/hist/tests/main.nf.test | 106 ++++++++++-------- .../merfin/hist/tests/main.nf.test.snap | 12 +- .../nf-core/merfin/hist/tests/modules.config | 8 -- 3 files changed, 68 insertions(+), 58 deletions(-) diff --git a/modules/nf-core/merfin/hist/tests/main.nf.test b/modules/nf-core/merfin/hist/tests/main.nf.test index c97140b50d03..7b392f1c610b 100644 --- a/modules/nf-core/merfin/hist/tests/main.nf.test +++ b/modules/nf-core/merfin/hist/tests/main.nf.test @@ -23,9 +23,11 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - [file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), - file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)] + [ + file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) ] + ] """ } } @@ -51,7 +53,7 @@ nextflow_process { input[0] = [ [ id:'test', single_end:false ], // meta map file(params.modules_testdata_base_path + '/genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ] + ] input[1] = MERYL_COUNT.out.meryl_db input[2] = [] input[3] = [] @@ -85,9 +87,11 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - [file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), - file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)] + [ + file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) ] + ] """ } } @@ -113,7 +117,7 @@ nextflow_process { input[0] = [ [ id:'test', single_end:false ], // meta map file(params.modules_testdata_base_path + '/genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ] + ] input[1] = MERYL_COUNT.out.meryl_db input[2] = [] input[3] = [] @@ -144,9 +148,11 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - [file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), - file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)] + [ + file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) ] + ] """ } } @@ -170,8 +176,8 @@ nextflow_process { process { """ input[0] = [ - [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + '/genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + '/genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[1] = Channel.value(6) """ @@ -212,7 +218,7 @@ nextflow_process { input[0] = [ [ id:'test', single_end:false ], // meta map file(params.modules_testdata_base_path + '/genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ] + ] input[1] = MERYL_COUNT_READS.out.meryl_db input[2] = GENOMESCOPE2.out.lookup_table.map{ meta, lkp -> lkp} input[3] = MERYL_COUNT_ASM.out.meryl_db.map{ meta, meryl_db -> meryl_db } @@ -246,9 +252,11 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - [file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), - file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)] + [ + file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) ] + ] """ } } @@ -272,8 +280,8 @@ nextflow_process { process { """ input[0] = [ - [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + '/genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + '/genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[1] = Channel.value(6) """ @@ -314,7 +322,7 @@ nextflow_process { input[0] = [ [ id:'test', single_end:false ], // meta map file(params.modules_testdata_base_path + '/genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ] + ] input[1] = MERYL_COUNT_READS.out.meryl_db input[2] = GENOMESCOPE2.out.lookup_table.map{ meta, lkp -> lkp } input[3] = MERYL_COUNT_ASM.out.meryl_db.map{ meta, meryl_db -> meryl_db } @@ -342,15 +350,19 @@ nextflow_process { tag "seqtk/mergepe" process { """ - input[0] = Channel.from([[ id:'test_sars', single_end:false ], // meta map - [file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), - file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)] - ], + input[0] = Channel.from([ + [ id:'test_sars', single_end:false ], // meta map [ + file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) + ] + ], [ [ id:'test_fragilis', single_end:false ], // meta map - [file(params.modules_testdata_base_path + '/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_1.fastq.gz', checkIfExists: true), - file(params.modules_testdata_base_path + '/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_2.fastq.gz', checkIfExists: true)] - ]) + [ + file(params.modules_testdata_base_path + '/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + '/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_2.fastq.gz', checkIfExists: true) + ] + ]) """ } } @@ -374,11 +386,11 @@ nextflow_process { process { """ input[0] = Channel.from([ - [ id:'test_sars', single_end:false ], // meta map - file(params.modules_testdata_base_path + '/genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + [ id:'test_sars', single_end:false ], // meta map + file(params.modules_testdata_base_path + '/genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ],[ - [ id:'test_fragilis', single_end:false ], // meta map - file(params.modules_testdata_base_path + '/genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz', checkIfExists: true) + [ id:'test_fragilis', single_end:false ], // meta map + file(params.modules_testdata_base_path + '/genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz', checkIfExists: true) ]) input[1] = Channel.value(6) """ @@ -419,10 +431,11 @@ nextflow_process { Channel.from([ [ id:'test_sars', single_end:false ], // meta map file(params.modules_testdata_base_path + '/genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ],[ + ],[ [ id:'test_fragilis', single_end:false ], // meta map file(params.modules_testdata_base_path + '/genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz', checkIfExists: true) - ]).set{ input_zero_ch } + ]) + .set{ input_zero_ch } input_zero_ch.join( MERYL_COUNT_READS.out.meryl_db ) .join( MERYL_COUNT_ASM.out.meryl_db ) @@ -466,15 +479,19 @@ nextflow_process { tag "seqtk/mergepe" process { """ - input[0] = Channel.from([[ id:'test_sars', single_end:false ], // meta map - [file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), - file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)] - ], + input[0] = Channel.from([ + [ id:'test_sars', single_end:false ], // meta map [ + file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + '/genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) + ] + ], [ [ id:'test_fragilis', single_end:false ], // meta map - [file(params.modules_testdata_base_path + '/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_1.fastq.gz', checkIfExists: true), - file(params.modules_testdata_base_path + '/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_2.fastq.gz', checkIfExists: true)] - ]) + [ + file(params.modules_testdata_base_path + '/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + '/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_2.fastq.gz', checkIfExists: true) + ] + ]) """ } } @@ -498,11 +515,11 @@ nextflow_process { process { """ input[0] = Channel.from([ - [ id:'test_sars', single_end:false ], // meta map - file(params.modules_testdata_base_path + '/genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + [ id:'test_sars', single_end:false ], // meta map + file(params.modules_testdata_base_path + '/genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ],[ - [ id:'test_fragilis', single_end:false ], // meta map - file(params.modules_testdata_base_path + '/genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz', checkIfExists: true) + [ id:'test_fragilis', single_end:false ], // meta map + file(params.modules_testdata_base_path + '/genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz', checkIfExists: true) ]) input[1] = Channel.value(6) """ @@ -543,10 +560,12 @@ nextflow_process { Channel.from([ [ id:'test_sars', single_end:false ], // meta map file(params.modules_testdata_base_path + '/genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ],[ + ],[ [ id:'test_fragilis', single_end:false ], // meta map file(params.modules_testdata_base_path + '/genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz', checkIfExists: true) - ]).set{ input_zero_ch } + ]) + .set{ input_zero_ch } + input_zero_ch.join( MERYL_COUNT_READS.out.meryl_db ) .join( MERYL_COUNT_ASM.out.meryl_db ) @@ -570,8 +589,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.get(0), process.out.get(2)).match() }, - // The following asserts that the output stdout_log generated by the module is complete + { assert snapshot(process.out.get(0), process.out.get(2)).match() } ) } diff --git a/modules/nf-core/merfin/hist/tests/main.nf.test.snap b/modules/nf-core/merfin/hist/tests/main.nf.test.snap index 0eecdc9a95cc..2d1f4e9da8f5 100644 --- a/modules/nf-core/merfin/hist/tests/main.nf.test.snap +++ b/modules/nf-core/merfin/hist/tests/main.nf.test.snap @@ -26,7 +26,7 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T14:26:50.991851" + "timestamp": "2024-04-02T11:05:51.416187" }, "sarscov2 - paired-end illumina reads - stub": { "content": [ @@ -67,7 +67,7 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-21T16:53:19.833365" + "timestamp": "2024-04-02T11:04:28.744584" }, "sarscov2 - paired-end illumina reads plus inputs lookup_table and seqmers - stub": { "content": [ @@ -108,7 +108,7 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-28T16:19:03.305" + "timestamp": "2024-04-02T11:04:51.831185" }, "sarscov2 - paired-end illumina reads plus optional inputs lookup_table and seqmers": { "content": [ @@ -129,7 +129,7 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-28T15:57:20.211837" + "timestamp": "2024-04-02T11:04:41.739829" }, "Multiple samples - sarscov2 + bacteroides_fragilis - paired-end illumina reads - stub": { "content": [ @@ -158,7 +158,7 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-28T16:20:17.220724" + "timestamp": "2024-04-02T11:06:03.566853" }, "sarscov2 - paired-end illumina reads": { "content": [ @@ -179,6 +179,6 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T14:25:00.482159" + "timestamp": "2024-04-02T11:04:20.733553" } } \ No newline at end of file diff --git a/modules/nf-core/merfin/hist/tests/modules.config b/modules/nf-core/merfin/hist/tests/modules.config index eca5fbf9321d..034f147826cb 100644 --- a/modules/nf-core/merfin/hist/tests/modules.config +++ b/modules/nf-core/merfin/hist/tests/modules.config @@ -1,12 +1,4 @@ process { - withName: MERYL_COUNT { - ext.args = { "k=6" } - } - - withName: MERYL_HISTOGRAM { - ext.args = { "k=6" } - } - withName: GENOMESCOPE2 { ext.args = { "--ploidy 1 --kmer_length 6 --fitted_hist" } }