Skip to content

Commit

Permalink
Added nf-test for picard/collectwgsmetrics
Browse files Browse the repository at this point in the history
  • Loading branch information
GallVp committed Aug 22, 2024
1 parent fe9614c commit 0848b95
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 64 deletions.
83 changes: 83 additions & 0 deletions modules/nf-core/picard/collectwgsmetrics/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@

nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "picard"
tag "picard/collectwgsmetrics"

test("test-picard-collectwgsmetrics") {

when {
process {
"""
input[0] = [ [ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true),
]
input[1] = [
[id:'genome'],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
input[2] = [
[id:'genome'],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true)
]
input[3] = []
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
file(process.out.metrics[0][1]).text.contains('coverage high_quality_coverage_count'),
process.out.versions
).match()
}
)
}
}

test("test-picard-collectwgsmetrics-with-interval") {

when {
process {
"""
input[0] = [ [ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true),
[]
]
input[1] = [
[id:'genome'],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
input[2] = [
[id:'genome'],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true)
]
input[3] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/picard/baits.interval_list', checkIfExists: true)
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
file(process.out.metrics[0][1]).text.contains('coverage high_quality_coverage_count'),
process.out.versions
).match()
}
)
}
}

}
28 changes: 28 additions & 0 deletions modules/nf-core/picard/collectwgsmetrics/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"test-picard-collectwgsmetrics-with-interval": {
"content": [
true,
[
"versions.yml:md5,06b5898fb06823b736c90e1dcebe75fe"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-23T11:02:46.301176"
},
"test-picard-collectwgsmetrics": {
"content": [
true,
[
"versions.yml:md5,06b5898fb06823b736c90e1dcebe75fe"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-23T11:02:25.132069"
}
}
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1097,9 +1097,6 @@ picard/collectmultiplemetrics:
picard/collectrnaseqmetrics:
- modules/nf-core/picard/collectrnaseqmetrics/**
- tests/modules/nf-core/picard/collectrnaseqmetrics/**
picard/collectwgsmetrics:
- modules/nf-core/picard/collectwgsmetrics/**
- tests/modules/nf-core/picard/collectwgsmetrics/**
picard/fastqtosam:
- modules/nf-core/picard/fastqtosam/**
- tests/modules/nf-core/picard/fastqtosam/**
Expand Down
41 changes: 0 additions & 41 deletions tests/modules/nf-core/picard/collectwgsmetrics/main.nf

This file was deleted.

This file was deleted.

15 changes: 0 additions & 15 deletions tests/modules/nf-core/picard/collectwgsmetrics/test.yml

This file was deleted.

0 comments on commit 0848b95

Please sign in to comment.