Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nf test local modules #223

Open
wants to merge 5 commits into
base: new-output-dir
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
},
"rtgtools/format": {
"branch": "master",
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",
"git_sha": "167a20a2e267261af397e9ea5bf58426e6345ce7",
"installed_by": ["modules"]
},
"rtgtools/pedfilter": {
Expand Down
95 changes: 95 additions & 0 deletions modules/local/automap/automap/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
nextflow_process {

name "Test Process AUTOMAP_AUTOMAP"
script "../main.nf"
process "AUTOMAP_AUTOMAP"

tag "modules"
tag "modules_local"
tag "automap"
tag "automap/automap"

setup {
run("AUTOMAP_REPEATS") {
script "../../repeats/main.nf"
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
"hg38"
]
"""
}
}
}

test("homo_sapiens - vcf, tbi, repeats, [], hg38") {

config "./nextflow.config"

when {
process {
"""
input[0] = [
[ id:'test', family_samples:"NA24143,NA24149,NA24385", caller:"haplotypecaller" ], // meta map
file(params.famvcf, checkIfExists: true),
file(params.famtbi, checkIfExists: true)
]
input[1] = AUTOMAP_REPEATS.out.repeats
input[2] = [[],[]]
input[3] = "hg38"
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.automap.collect { meta, out ->
[
meta,
path(out).list().collect {
it.list().collect {
"${file(it.toString()).name},variantsMD5:${it.vcf.variantsMD5}"
}
}
]
},
process.out.versions
).match() }
)
}

}

test("homo_sapiens - vcf, tbi, repeats, [], hg38 - stub") {

options "-stub"
config "./nextflow.config"

when {
process {
"""
input[0] = [
[ id:'test', family_samples:"NA24143,NA24149,NA24385", caller:"haplotypecaller" ], // meta map
file(params.famvcf, checkIfExists: true),
file(params.famtbi, checkIfExists: true)
]
input[1] = AUTOMAP_REPEATS.out.repeats
input[2] = [[],[]]
input[3] = "hg38"
"""
}
}

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

}

}
109 changes: 109 additions & 0 deletions modules/local/automap/automap/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"homo_sapiens - vcf, tbi, repeats, [], hg38": {
"content": [
[
[
{
"id": "test",
"family_samples": "NA24143,NA24149,NA24385",
"caller": "haplotypecaller"
},
[
[
"NA24143.individual.vcf,variantsMD5:d87c6d5aea196c746312a8a383eede4b"
],
[
"NA24149.individual.vcf,variantsMD5:24eacd6958a767b7768b4282caea52cc"
],
[
"NA24385.individual.vcf,variantsMD5:f7f27a20139824e3e49cf17a2867489b"
]
]
]
],
[
"versions.yml:md5,8d88bdf05fc6f578d81fee3716f8b562"
]
],
"meta": {
"nf-test": "0.9.1",
"nextflow": "24.10.0"
},
"timestamp": "2024-11-13T17:03:29.44273724"
},
"homo_sapiens - vcf, tbi, repeats, [], hg38 - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"family_samples": "NA24143,NA24149,NA24385",
"caller": "haplotypecaller"
},
[
[
"sample1.HomRegions.cmgg_bio.tsv:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample1.HomRegions.pdf:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample1.HomRegions.strict.cmgg_bio.tsv:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample1.HomRegions.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
],
[
"sample2.HomRegions.cmgg_bio.tsv:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample2.HomRegions.pdf:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample2.HomRegions.strict.cmgg_bio.tsv:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample2.HomRegions.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
],
[
"sample3.HomRegions.cmgg_bio.tsv:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample3.HomRegions.pdf:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample3.HomRegions.strict.cmgg_bio.tsv:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample3.HomRegions.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
]
]
],
"1": [
"versions.yml:md5,8d88bdf05fc6f578d81fee3716f8b562"
],
"automap": [
[
{
"id": "test",
"family_samples": "NA24143,NA24149,NA24385",
"caller": "haplotypecaller"
},
[
[
"sample1.HomRegions.cmgg_bio.tsv:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample1.HomRegions.pdf:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample1.HomRegions.strict.cmgg_bio.tsv:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample1.HomRegions.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
],
[
"sample2.HomRegions.cmgg_bio.tsv:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample2.HomRegions.pdf:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample2.HomRegions.strict.cmgg_bio.tsv:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample2.HomRegions.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
],
[
"sample3.HomRegions.cmgg_bio.tsv:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample3.HomRegions.pdf:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample3.HomRegions.strict.cmgg_bio.tsv:md5,d41d8cd98f00b204e9800998ecf8427e",
"sample3.HomRegions.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
]
]
],
"versions": [
"versions.yml:md5,8d88bdf05fc6f578d81fee3716f8b562"
]
}
],
"meta": {
"nf-test": "0.9.1",
"nextflow": "24.10.0"
},
"timestamp": "2024-11-13T17:00:28.503010269"
}
}
5 changes: 5 additions & 0 deletions modules/local/automap/automap/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: "AUTOMAP_AUTOMAP" {
ext.args = "--panelname cmgg_bio --multivcf"
}
}
58 changes: 58 additions & 0 deletions modules/local/automap/repeats/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
nextflow_process {

name "Test Process AUTOMAP_REPEATS"
script "../main.nf"
process "AUTOMAP_REPEATS"

tag "modules"
tag "modules_local"
tag "automap"
tag "automap/repeats"

test("homo_sapiens - hg38") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
"hg38"
]
"""
}
}

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

}

test("homo_sapiens - hg38 - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
"hg38"
]
"""
}
}

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

}

}
72 changes: 72 additions & 0 deletions modules/local/automap/repeats/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"homo_sapiens - hg38": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.bed:md5,74190e74851226329342a3fcae133cdb"
]
],
"1": [
"versions.yml:md5,b5fc7b6bfce18165907357d8966f09d4"
],
"repeats": [
[
{
"id": "test",
"single_end": false
},
"test.bed:md5,74190e74851226329342a3fcae133cdb"
]
],
"versions": [
"versions.yml:md5,b5fc7b6bfce18165907357d8966f09d4"
]
}
],
"meta": {
"nf-test": "0.9.1",
"nextflow": "24.10.0"
},
"timestamp": "2024-11-13T16:31:33.522485317"
},
"homo_sapiens - hg38 - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.bed:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,b5fc7b6bfce18165907357d8966f09d4"
],
"repeats": [
[
{
"id": "test",
"single_end": false
},
"test.bed:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,b5fc7b6bfce18165907357d8966f09d4"
]
}
],
"meta": {
"nf-test": "0.9.1",
"nextflow": "24.10.0"
},
"timestamp": "2024-11-13T16:31:43.895708133"
}
}
Loading
Loading