Skip to content

Commit

Permalink
Added nf-test for gatk4/collectreadcounts (#6320)
Browse files Browse the repository at this point in the history
  • Loading branch information
GallVp authored Aug 26, 2024
1 parent dbbabc3 commit 6fd3f66
Show file tree
Hide file tree
Showing 9 changed files with 216 additions and 128 deletions.
104 changes: 104 additions & 0 deletions modules/nf-core/gatk4/collectreadcounts/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@

nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "gatk4"
tag "gatk4/collectreadcounts"

test("test-gatk4-collectreadcounts-hdf5") {

config "./nextflow.hdf5.config"

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

then {
assertAll(
{ assert process.success },
{ assert snapshot(
file(process.out.hdf5[0][1]).name,
process.out.tsv,
).match()
}
)
}
}

test("test-gatk4-collectreadcounts-tsv") {

config "./nextflow.tsv.config"

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

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

test("test-gatk4-collectreadcounts-cram") {

config "./nextflow.cram.config"

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

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

}
97 changes: 97 additions & 0 deletions modules/nf-core/gatk4/collectreadcounts/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{
"test-gatk4-collectreadcounts-cram": {
"content": [
{
"0": [

],
"1": [
[
{
"id": "test",
"single_end": false
},
"test.tsv:md5,d9a32039b7a84f5bb74e8382e5427670"
]
],
"2": [
"versions.yml:md5,ebf23f4ab63948ba97df07035f8d2659"
],
"hdf5": [

],
"tsv": [
[
{
"id": "test",
"single_end": false
},
"test.tsv:md5,d9a32039b7a84f5bb74e8382e5427670"
]
],
"versions": [
"versions.yml:md5,ebf23f4ab63948ba97df07035f8d2659"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-26T12:58:19.610687"
},
"test-gatk4-collectreadcounts-hdf5": {
"content": [
"test.hdf5",
[

]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-26T13:02:48.607644"
},
"test-gatk4-collectreadcounts-tsv": {
"content": [
{
"0": [

],
"1": [
[
{
"id": "test",
"single_end": false
},
"test.tsv:md5,8e45a6164916c303387f39f02ce45841"
]
],
"2": [
"versions.yml:md5,ebf23f4ab63948ba97df07035f8d2659"
],
"hdf5": [

],
"tsv": [
[
{
"id": "test",
"single_end": false
},
"test.tsv:md5,8e45a6164916c303387f39f02ce45841"
]
],
"versions": [
"versions.yml:md5,ebf23f4ab63948ba97df07035f8d2659"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-26T12:58:07.500024"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: 'GATK4_COLLECTREADCOUNTS' {
ext.args = "--format TSV --interval-merging-rule OVERLAPPING_ONLY"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: 'GATK4_COLLECTREADCOUNTS'{
ext.args = "--interval-merging-rule OVERLAPPING_ONLY"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: 'GATK4_COLLECTREADCOUNTS' {
ext.args = "--format TSV --interval-merging-rule OVERLAPPING_ONLY"
}
}
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,6 @@ gatk4/calibratedragstrmodel:
gatk4/cnnscorevariants:
- modules/nf-core/gatk4/cnnscorevariants/**
- tests/modules/nf-core/gatk4/cnnscorevariants/**
gatk4/collectreadcounts:
- modules/nf-core/gatk4/collectreadcounts/**
- tests/modules/nf-core/gatk4/collectreadcounts/**
gatk4/collectsvevidence:
- modules/nf-core/gatk4/collectsvevidence/**
- tests/modules/nf-core/gatk4/collectsvevidence/**
Expand Down
54 changes: 0 additions & 54 deletions tests/modules/nf-core/gatk4/collectreadcounts/main.nf

This file was deleted.

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

This file was deleted.

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

This file was deleted.

0 comments on commit 6fd3f66

Please sign in to comment.