-
Notifications
You must be signed in to change notification settings - Fork 741
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
port
gatk4/calculatecontamination
to nf-test (#5603)
* port to nf-test update stub * prettier * prettier * add assertion for segmentation
- Loading branch information
Showing
9 changed files
with
252 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 106 additions & 0 deletions
106
modules/nf-core/gatk4/calculatecontamination/tests/main.nf.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
nextflow_process { | ||
|
||
name "Test Process GATK4_CALCULATECONTAMINATION" | ||
script "../main.nf" | ||
process "GATK4_CALCULATECONTAMINATION" | ||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "gatk4" | ||
tag "gatk4/calculatecontamination" | ||
|
||
test("human - pileup-table") { | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ [ id:'test' ], // meta map | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test2.pileups.table', checkIfExists: true), | ||
[] ] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out.versions).match("versions") }, | ||
{ assert snapshot(file(process.out.contamination.get(0).get(1)).readLines()[0]).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
test("human - pileup-table - matched-pair") { | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ [ id:'test' ], // meta map | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test2.pileups.table', checkIfExists: true), | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test.pileups.table', checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out.versions).match("versions_pair") }, | ||
{ assert snapshot(file(process.out.contamination.get(0).get(1)).readLines()[0]).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
test("human - pileup-table - segmentation") { | ||
|
||
config "./nextflow.config" | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ [ id:'test' ], // meta map | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test2.pileups.table', checkIfExists: true), | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test.pileups.table', checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out.versions).match("versions_segmentation") }, | ||
{ assert snapshot(file(process.out.contamination.get(0).get(1)).readLines()[0]).match("contamination") }, | ||
{ assert snapshot(file(process.out.segmentation.get(0).get(1)).readLines()[0]).match("segmentation") } | ||
) | ||
} | ||
|
||
} | ||
|
||
test("human - pileup-table - stub") { | ||
|
||
options "-stub" | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ [ id:'test' ], // meta map | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test2.pileups.table', checkIfExists: true), | ||
[] ] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
} |
127 changes: 127 additions & 0 deletions
127
modules/nf-core/gatk4/calculatecontamination/tests/main.nf.test.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
{ | ||
"versions_pair": { | ||
"content": [ | ||
[ | ||
"versions.yml:md5,4a72b1da18f7045d470225881e7266a6" | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.0" | ||
}, | ||
"timestamp": "2024-05-15T11:08:17.057861" | ||
}, | ||
"versions": { | ||
"content": [ | ||
[ | ||
"versions.yml:md5,4a72b1da18f7045d470225881e7266a6" | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.0" | ||
}, | ||
"timestamp": "2024-05-15T11:08:07.193762" | ||
}, | ||
"versions_segmentation": { | ||
"content": [ | ||
[ | ||
"versions.yml:md5,4a72b1da18f7045d470225881e7266a6" | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.0" | ||
}, | ||
"timestamp": "2024-05-15T11:08:26.99069" | ||
}, | ||
"segmentation": { | ||
"content": [ | ||
"#<METADATA>SAMPLE=tumour" | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.0" | ||
}, | ||
"timestamp": "2024-05-15T12:57:38.845287" | ||
}, | ||
"human - pileup-table": { | ||
"content": [ | ||
"sample\tcontamination\terror" | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.0" | ||
}, | ||
"timestamp": "2024-05-15T11:09:16.292509" | ||
}, | ||
"human - pileup-table - stub": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.contamination.table:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"1": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.segmentation.table:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"2": [ | ||
"versions.yml:md5,4a72b1da18f7045d470225881e7266a6" | ||
], | ||
"contamination": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.contamination.table:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"segmentation": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"test.segmentation.table:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,4a72b1da18f7045d470225881e7266a6" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.0" | ||
}, | ||
"timestamp": "2024-05-15T12:56:14.817045" | ||
}, | ||
"human - pileup-table - matched-pair": { | ||
"content": [ | ||
"sample\tcontamination\terror" | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.0" | ||
}, | ||
"timestamp": "2024-05-15T11:09:26.408848" | ||
}, | ||
"contamination": { | ||
"content": [ | ||
"sample\tcontamination\terror" | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.0" | ||
}, | ||
"timestamp": "2024-05-15T12:57:38.840651" | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
modules/nf-core/gatk4/calculatecontamination/tests/nextflow.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
process { | ||
withName: GATK4_CALCULATECONTAMINATION { | ||
ext.args = { "--tumor-segmentation ${meta.id}.segmentation.table" } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
gatk4/calculatecontamination: | ||
- "modules/nf-core/gatk4/calculatecontamination/**" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
tests/modules/nf-core/gatk4/calculatecontamination/main.nf
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
tests/modules/nf-core/gatk4/calculatecontamination/nextflow.config
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
tests/modules/nf-core/gatk4/calculatecontamination/test.yml
This file was deleted.
Oops, something went wrong.