Skip to content

Commit

Permalink
mv fasta_index to bwameth scope and update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sateeshperi committed Sep 8, 2024
1 parent 725d0ea commit 1e8aff2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 218 deletions.
2 changes: 1 addition & 1 deletion subworkflows/local/prepare_genome/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
125 changes: 2 additions & 123 deletions subworkflows/local/prepare_genome/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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() }
Expand All @@ -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 {
Expand Down
100 changes: 6 additions & 94 deletions subworkflows/local/prepare_genome/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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"
],
[
[
[
Expand All @@ -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"
}
}
}

0 comments on commit 1e8aff2

Please sign in to comment.