Skip to content

Commit

Permalink
Bump genmod and add stub tests (nf-core#6846)
Browse files Browse the repository at this point in the history
Co-authored-by: Sateesh_Peri <[email protected]>
  • Loading branch information
fellen31 and sateeshperi authored Oct 28, 2024
1 parent cc64e71 commit 91a84f9
Show file tree
Hide file tree
Showing 16 changed files with 335 additions and 24 deletions.
2 changes: 1 addition & 1 deletion modules/nf-core/genmod/annotate/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ channels:
- conda-forge
- bioconda
dependencies:
- bioconda::genmod=3.8.3
- bioconda::genmod=3.9
6 changes: 3 additions & 3 deletions modules/nf-core/genmod/annotate/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ process GENMOD_ANNOTATE {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/genmod:3.8.3--pyhdfd78af_0':
'biocontainers/genmod:3.8.3--pyhdfd78af_0' }"
'https://depot.galaxyproject.org/singularity/genmod:3.9--pyhdfd78af_0':
'biocontainers/genmod:3.9--pyhdfd78af_0' }"

input:
tuple val(meta), path(input_vcf)

output:
tuple val(meta), path("*_annotate.vcf"), emit: vcf
path "versions.yml" , emit: versions
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when
Expand Down
31 changes: 29 additions & 2 deletions modules/nf-core/genmod/annotate/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,35 @@ nextflow_process {

then {
assertAll(
{assert process.success},
{assert path(process.out.vcf.get(0).get(1)).readLines().contains("##fileformat=VCFv4.2")}
{ assert process.success },
{ assert snapshot(
process.out.versions,
path(process.out.vcf.get(0).get(1)).vcf.summary,
).match() }
)
}

}

test("genmod_annotate - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/genmod.vcf.gz', checkIfExists: true)
]
"""
}
}

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

Expand Down
50 changes: 50 additions & 0 deletions modules/nf-core/genmod/annotate/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"genmod_annotate": {
"content": [
[
"versions.yml:md5,6ce3597967a536ab027d02f75d02056c"
],
"VcfFile [chromosomes=[1], sampleCount=3, variantCount=57, phased=false, phasedAutodetect=false]"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-25T11:44:57.176895794"
},
"genmod_annotate - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test_annotate.vcf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,6ce3597967a536ab027d02f75d02056c"
],
"vcf": [
[
{
"id": "test",
"single_end": false
},
"test_annotate.vcf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,6ce3597967a536ab027d02f75d02056c"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-25T11:49:16.409331019"
}
}
2 changes: 1 addition & 1 deletion modules/nf-core/genmod/compound/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ channels:
- conda-forge
- bioconda
dependencies:
- bioconda::genmod=3.8.3
- bioconda::genmod=3.9
6 changes: 3 additions & 3 deletions modules/nf-core/genmod/compound/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ process GENMOD_COMPOUND {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/genmod:3.8.3--pyhdfd78af_0':
'biocontainers/genmod:3.8.3--pyhdfd78af_0' }"
'https://depot.galaxyproject.org/singularity/genmod:3.9--pyhdfd78af_0':
'biocontainers/genmod:3.9--pyhdfd78af_0' }"

input:
tuple val(meta), path(input_vcf)

output:
tuple val(meta), path("*_compound.vcf"), emit: vcf
path "versions.yml" , emit: versions
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when
Expand Down
31 changes: 29 additions & 2 deletions modules/nf-core/genmod/compound/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,35 @@ nextflow_process {

then {
assertAll(
{assert process.success},
{assert path(process.out.vcf.get(0).get(1)).readLines().contains("##fileformat=VCFv4.2")}
{ assert process.success },
{ assert snapshot(
process.out.versions,
path(process.out.vcf.get(0).get(1)).vcf.summary,
).match() }
)
}

}

test("genmod_compound - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/genmod_compound.vcf', checkIfExists: true)
]
"""
}
}

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

Expand Down
50 changes: 50 additions & 0 deletions modules/nf-core/genmod/compound/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"genmod_compound": {
"content": [
[
"versions.yml:md5,822fb501a48a6f8c28ba8f678d27ba2e"
],
"VcfFile [chromosomes=[MT], sampleCount=3, variantCount=22, phased=false, phasedAutodetect=false]"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-25T11:49:41.417545149"
},
"genmod_compound - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test_compound.vcf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,822fb501a48a6f8c28ba8f678d27ba2e"
],
"vcf": [
[
{
"id": "test",
"single_end": false
},
"test_compound.vcf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,822fb501a48a6f8c28ba8f678d27ba2e"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-25T11:49:48.678803012"
}
}
2 changes: 1 addition & 1 deletion modules/nf-core/genmod/models/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ channels:
- conda-forge
- bioconda
dependencies:
- bioconda::genmod=3.8.3
- bioconda::genmod=3.9
6 changes: 3 additions & 3 deletions modules/nf-core/genmod/models/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ process GENMOD_MODELS {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/genmod:3.8.3--pyhdfd78af_0':
'biocontainers/genmod:3.8.3--pyhdfd78af_0' }"
'https://depot.galaxyproject.org/singularity/genmod:3.9--pyhdfd78af_0':
'biocontainers/genmod:3.9--pyhdfd78af_0' }"

input:
tuple val(meta), path(input_vcf)
Expand All @@ -14,7 +14,7 @@ process GENMOD_MODELS {

output:
tuple val(meta), path("*_models.vcf"), emit: vcf
path "versions.yml" , emit: versions
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when
Expand Down
32 changes: 30 additions & 2 deletions modules/nf-core/genmod/models/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,39 @@ nextflow_process {

then {
assertAll(
{assert process.success},
{assert path(process.out.vcf.get(0).get(1)).readLines().contains("##fileformat=VCFv4.2")}
{ assert process.success },
{ assert snapshot(
process.out.versions,
path(process.out.vcf.get(0).get(1)).vcf.summary,
).match() }
)
}

}

test("genmod_models - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test_annotate.vcf.gz', checkIfExists: true)
]
input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/ped/justhusky.ped', checkIfExists: true)
input[2] = []
"""
}
}

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

}
}
50 changes: 50 additions & 0 deletions modules/nf-core/genmod/models/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"genmod_models - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test_models.vcf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,10442b1602069000967f51837d7b5b63"
],
"vcf": [
[
{
"id": "test",
"single_end": false
},
"test_models.vcf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,10442b1602069000967f51837d7b5b63"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-25T11:51:04.841425679"
},
"genmod_models": {
"content": [
[
"versions.yml:md5,10442b1602069000967f51837d7b5b63"
],
"VcfFile [chromosomes=[1], sampleCount=3, variantCount=57, phased=false, phasedAutodetect=false]"
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-25T11:49:56.642318737"
}
}
2 changes: 1 addition & 1 deletion modules/nf-core/genmod/score/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ channels:
- conda-forge
- bioconda
dependencies:
- bioconda::genmod=3.8.3
- bioconda::genmod=3.9
6 changes: 3 additions & 3 deletions modules/nf-core/genmod/score/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ process GENMOD_SCORE {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/genmod:3.8.3--pyhdfd78af_0':
'biocontainers/genmod:3.8.3--pyhdfd78af_0' }"
'https://depot.galaxyproject.org/singularity/genmod:3.9--pyhdfd78af_0':
'biocontainers/genmod:3.9--pyhdfd78af_0' }"

input:
tuple val(meta), path(input_vcf)
Expand All @@ -14,7 +14,7 @@ process GENMOD_SCORE {

output:
tuple val(meta), path("*_score.vcf"), emit: vcf
path "versions.yml" , emit: versions
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when
Expand Down
Loading

0 comments on commit 91a84f9

Please sign in to comment.