From 1e8aff231883a2c6fd2a6b6c4efcda247ceefa12 Mon Sep 17 00:00:00 2001 From: Sateesh Date: Sun, 8 Sep 2024 12:40:22 +0000 Subject: [PATCH] mv fasta_index to bwameth scope and update tests --- subworkflows/local/prepare_genome/main.nf | 2 +- .../local/prepare_genome/tests/main.nf.test | 125 +----------------- .../prepare_genome/tests/main.nf.test.snap | 100 +------------- 3 files changed, 9 insertions(+), 218 deletions(-) diff --git a/subworkflows/local/prepare_genome/main.nf b/subworkflows/local/prepare_genome/main.nf index 9ed83f89..4834d2aa 100644 --- a/subworkflows/local/prepare_genome/main.nf +++ b/subworkflows/local/prepare_genome/main.nf @@ -68,7 +68,6 @@ workflow PREPARE_GENOME { ch_bwameth_index = BWAMETH_INDEX.out.index ch_versions = ch_versions.mix(BWAMETH_INDEX.out.versions) } - } /* * Generate fasta index if not supplied @@ -83,6 +82,7 @@ workflow PREPARE_GENOME { ch_fasta_index = SAMTOOLS_FAIDX.out.fai.map{ return(it[1])} ch_versions = ch_versions.mix(SAMTOOLS_FAIDX.out.versions) } + } emit: fasta = ch_fasta // channel: path(genome.fasta) diff --git a/subworkflows/local/prepare_genome/tests/main.nf.test b/subworkflows/local/prepare_genome/tests/main.nf.test index 147e6ca2..93066a75 100644 --- a/subworkflows/local/prepare_genome/tests/main.nf.test +++ b/subworkflows/local/prepare_genome/tests/main.nf.test @@ -4,67 +4,7 @@ nextflow_workflow { script "../main.nf" workflow "PREPARE_GENOME" - test("BISMARK - All Indexes supplied") { - - when { - params { - aligner = "bismark" - } - workflow { - """ - input[0] = file(params.pipelines_testdata_base_path + 'reference/genome.fa', checkIfExists: true) // fasta - input[1] = file(params.pipelines_testdata_base_path + 'reference/genome.fa.fai', checkIfExists: true) // fasta_index - input[2] = file(params.pipelines_testdata_base_path + 'reference/Bowtie2_Index.tar.gz', checkIfExists: true) // bismark_index - input[3] = [] // bwameth_index - """ - } - } - - then { - assertAll( - { assert workflow.success }, - { assert snapshot( - workflow.out.fasta, - workflow.out.fasta_index, - workflow.out.bismark_index, - workflow.out.versions - ).match() } - ) - } - - } - - test("BISMARK - Generate Fasta Index") { - - when { - params { - aligner = "bismark" - } - workflow { - """ - input[0] = file(params.pipelines_testdata_base_path + 'reference/genome.fa', checkIfExists: true) // fasta - input[1] = [] // fasta_index - input[2] = file(params.pipelines_testdata_base_path + 'reference/Bowtie2_Index.tar.gz', checkIfExists: true) // bismark_index - input[3] = [] // bwameth_index - """ - } - } - - then { - assertAll( - { assert workflow.success }, - { assert snapshot( - workflow.out.fasta, - workflow.out.fasta_index, - workflow.out.bismark_index, - workflow.out.versions - ).match() } - ) - } - - } - - test("BISMARK - Generate Fasta Index & Bowtie Index") { + test("BISMARK - Generate Index") { when { params { @@ -85,7 +25,6 @@ nextflow_workflow { { assert workflow.success }, { assert snapshot( workflow.out.fasta, - workflow.out.fasta_index, workflow.out.bismark_index, workflow.out.versions ).match() } @@ -94,67 +33,7 @@ nextflow_workflow { } - test("BWAMETH - All Indexes supplied") { - - when { - params { - aligner = "bwameth" - } - workflow { - """ - input[0] = file(params.pipelines_testdata_base_path + 'reference/genome.fa', checkIfExists: true) // fasta - input[1] = file(params.pipelines_testdata_base_path + 'reference/genome.fa.fai', checkIfExists: true) // fasta_index - input[2] = [] // bismark_index - input[3] = file(params.pipelines_testdata_base_path + 'reference/Bwameth_Index.tar.gz', checkIfExists: true) // bwameth_index - """ - } - } - - then { - assertAll( - { assert workflow.success }, - { assert snapshot( - workflow.out.fasta, - workflow.out.fasta_index, - workflow.out.bwameth_index, - workflow.out.versions - ).match() } - ) - } - - } - - test("BWAMETH - Generate Fasta Index") { - - when { - params { - aligner = "bwameth" - } - workflow { - """ - input[0] = file(params.pipelines_testdata_base_path + 'reference/genome.fa', checkIfExists: true) // fasta - input[1] = [] // fasta_index - input[2] = [] // bismark_index - input[3] = file(params.pipelines_testdata_base_path + 'reference/Bwameth_Index.tar.gz', checkIfExists: true) // bwameth_index - """ - } - } - - then { - assertAll( - { assert workflow.success }, - { assert snapshot( - workflow.out.fasta, - workflow.out.fasta_index, - workflow.out.bwameth_index, - workflow.out.versions - ).match() } - ) - } - - } - - test("BWAMETH - Generate Fasta Index & bwameth Index") { + test("BWAMETH - Generate Index") { when { params { diff --git a/subworkflows/local/prepare_genome/tests/main.nf.test.snap b/subworkflows/local/prepare_genome/tests/main.nf.test.snap index 9f58495c..71af1f7e 100644 --- a/subworkflows/local/prepare_genome/tests/main.nf.test.snap +++ b/subworkflows/local/prepare_genome/tests/main.nf.test.snap @@ -1,47 +1,5 @@ { - "BWAMETH - All Indexes supplied": { - "content": [ - [ - "/nf-core/test-datasets/raw/methylseq/reference/genome.fa" - ], - [ - "/nf-core/test-datasets/raw/methylseq/reference/genome.fa.fai" - ], - [ - "/nf-core/test-datasets/raw/methylseq/reference/Bwameth_Index.tar.gz" - ], - [ - - ] - ], - "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" - }, - "timestamp": "2024-09-08T07:11:39.601007949" - }, - "BISMARK - Generate Fasta Index": { - "content": [ - [ - "/nf-core/test-datasets/raw/methylseq/reference/genome.fa" - ], - [ - "genome.fa.fai:md5,84f5b44c25877ac58b154706cc8bc451" - ], - [ - "/nf-core/test-datasets/raw/methylseq/reference/Bowtie2_Index.tar.gz" - ], - [ - "versions.yml:md5,67124f8c3356bccd688e07c65a52e48a" - ] - ], - "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" - }, - "timestamp": "2024-09-08T07:13:17.406358667" - }, - "BWAMETH - Generate Fasta Index & bwameth Index": { + "BWAMETH - Generate Index": { "content": [ [ "/nf-core/test-datasets/raw/methylseq/reference/genome.fa" @@ -69,58 +27,13 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-09-08T07:12:28.477635099" + "timestamp": "2024-09-08T12:38:36.730702552" }, - "BWAMETH - Generate Fasta Index": { + "BISMARK - Generate Index": { "content": [ [ "/nf-core/test-datasets/raw/methylseq/reference/genome.fa" ], - [ - "genome.fa.fai:md5,84f5b44c25877ac58b154706cc8bc451" - ], - [ - "/nf-core/test-datasets/raw/methylseq/reference/Bwameth_Index.tar.gz" - ], - [ - "versions.yml:md5,67124f8c3356bccd688e07c65a52e48a" - ] - ], - "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" - }, - "timestamp": "2024-09-08T07:11:57.30233052" - }, - "BISMARK - All Indexes supplied": { - "content": [ - [ - "/nf-core/test-datasets/raw/methylseq/reference/genome.fa" - ], - [ - "/nf-core/test-datasets/raw/methylseq/reference/genome.fa.fai" - ], - [ - "/nf-core/test-datasets/raw/methylseq/reference/Bowtie2_Index.tar.gz" - ], - [ - - ] - ], - "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" - }, - "timestamp": "2024-09-08T07:12:48.994204422" - }, - "BISMARK - Generate Fasta Index & Bowtie Index": { - "content": [ - [ - "/nf-core/test-datasets/raw/methylseq/reference/genome.fa" - ], - [ - "genome.fa.fai:md5,84f5b44c25877ac58b154706cc8bc451" - ], [ [ [ @@ -147,14 +60,13 @@ ] ], [ - "versions.yml:md5,48a4baa99421c3dd839946dd1af8d7aa", - "versions.yml:md5,67124f8c3356bccd688e07c65a52e48a" + "versions.yml:md5,48a4baa99421c3dd839946dd1af8d7aa" ] ], "meta": { "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-09-08T07:13:52.673839987" + "timestamp": "2024-09-08T12:38:22.021170374" } -} \ No newline at end of file +}