Skip to content

Commit

Permalink
Added nf-test for gatk4/splitintervals (#6302)
Browse files Browse the repository at this point in the history
* Added nf-test for gatk4/splitintervals

* Added stub test
  • Loading branch information
GallVp authored Aug 27, 2024
1 parent a8d18aa commit c335ccf
Show file tree
Hide file tree
Showing 7 changed files with 233 additions and 90 deletions.
109 changes: 109 additions & 0 deletions modules/nf-core/gatk4/splitintervals/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@

nextflow_process {

name "Test Process GATK4_SPLITINTERVALS"
script "../main.nf"
process "GATK4_SPLITINTERVALS"
config "./nextflow.config"

tag "modules"
tag "modules_nfcore"
tag "gatk4"
tag "gatk4/splitintervals"

test("test-gatk4-splitintervals-bed") {

when {
process {
"""
input[0] = [
[ id:'test' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.multi_intervals.bed', checkIfExists: true)
]
input[1] = [ [ id:'genome' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)
]
input[2] = [ [ id:'genome' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true)
]
input[3] = [ [ id:'genome' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}

test("test-gatk4-splitintervals-intervals") {

when {
process {
"""
input[0] = [
[ id:'test' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.interval_list', checkIfExists: true)
]
input[1] = [ [ id:'genome' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)
]
input[2] = [ [ id:'genome' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true)
]
input[3] = [ [ id:'genome' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}

test("test-gatk4-splitintervals-intervals-stub") {

options '-stub'

when {
process {
"""
input[0] = [
[ id:'test' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.interval_list', checkIfExists: true)
]
input[1] = [ [ id:'genome' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)
]
input[2] = [ [ id:'genome' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true)
]
input[3] = [ [ id:'genome' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}

}
119 changes: 119 additions & 0 deletions modules/nf-core/gatk4/splitintervals/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
"test-gatk4-splitintervals-intervals": {
"content": [
{
"0": [
[
{
"id": "test"
},
[
"0000-scattered.interval_list:md5,ebd6b34a335efc6732ff541936c6d2d5",
"0001-scattered.interval_list:md5,9459b0e124fa84ec1e64ac4615bc9af7"
]
]
],
"1": [
"versions.yml:md5,384addd364fb36fdac7593eba22fcdb7"
],
"split_intervals": [
[
{
"id": "test"
},
[
"0000-scattered.interval_list:md5,ebd6b34a335efc6732ff541936c6d2d5",
"0001-scattered.interval_list:md5,9459b0e124fa84ec1e64ac4615bc9af7"
]
]
],
"versions": [
"versions.yml:md5,384addd364fb36fdac7593eba22fcdb7"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-26T11:06:41.633105"
},
"test-gatk4-splitintervals-bed": {
"content": [
{
"0": [
[
{
"id": "test"
},
[
"0000-scattered.interval_list:md5,c8d6b19e7a92535b6ce9608eae558faa",
"0001-scattered.interval_list:md5,b1877ad96aec308906594c50ebbe3ded"
]
]
],
"1": [
"versions.yml:md5,384addd364fb36fdac7593eba22fcdb7"
],
"split_intervals": [
[
{
"id": "test"
},
[
"0000-scattered.interval_list:md5,c8d6b19e7a92535b6ce9608eae558faa",
"0001-scattered.interval_list:md5,b1877ad96aec308906594c50ebbe3ded"
]
]
],
"versions": [
"versions.yml:md5,384addd364fb36fdac7593eba22fcdb7"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-26T11:06:28.504041"
},
"test-gatk4-splitintervals-intervals-stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
[
"0000-scattered.interval_list:md5,d41d8cd98f00b204e9800998ecf8427e",
"0001-scattered.interval_list:md5,d41d8cd98f00b204e9800998ecf8427e"
]
]
],
"1": [
"versions.yml:md5,384addd364fb36fdac7593eba22fcdb7"
],
"split_intervals": [
[
{
"id": "test"
},
[
"0000-scattered.interval_list:md5,d41d8cd98f00b204e9800998ecf8427e",
"0001-scattered.interval_list:md5,d41d8cd98f00b204e9800998ecf8427e"
]
]
],
"versions": [
"versions.yml:md5,384addd364fb36fdac7593eba22fcdb7"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-27T10:56:46.243594"
}
}
5 changes: 5 additions & 0 deletions modules/nf-core/gatk4/splitintervals/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: GATK4_SPLITINTERVALS {
ext.args = "--scatter-count 2"
}
}
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,6 @@ gatk4/sitedepthtobaf:
gatk4/splitcram:
- modules/nf-core/gatk4/splitcram/**
- tests/modules/nf-core/gatk4/splitcram/**
gatk4/splitintervals:
- modules/nf-core/gatk4/splitintervals/**
- tests/modules/nf-core/gatk4/splitintervals/**
gatk4/variantrecalibrator:
- modules/nf-core/gatk4/variantrecalibrator/**
- tests/modules/nf-core/gatk4/variantrecalibrator/**
Expand Down
45 changes: 0 additions & 45 deletions tests/modules/nf-core/gatk4/splitintervals/main.nf

This file was deleted.

9 changes: 0 additions & 9 deletions tests/modules/nf-core/gatk4/splitintervals/nextflow.config

This file was deleted.

33 changes: 0 additions & 33 deletions tests/modules/nf-core/gatk4/splitintervals/test.yml

This file was deleted.

0 comments on commit c335ccf

Please sign in to comment.