Skip to content

Commit

Permalink
Glimpse2 splitreference: Change python test to nf-test (nf-core#5076)
Browse files Browse the repository at this point in the history
* Glimpse2 splitreference: Change python test to nf-test

* Update modules/nf-core/glimpse2/splitreference/tests/main.nf.test

Co-authored-by: Maxime U Garcia <[email protected]>

* Update modules/nf-core/glimpse2/splitreference/tests/main.nf.test

Co-authored-by: Maxime U Garcia <[email protected]>

* Update modules/nf-core/glimpse2/splitreference/tests/main.nf.test

Co-authored-by: Maxime U Garcia <[email protected]>

* Update main.nf.test

* Update modules/nf-core/glimpse2/splitreference/tests/nextflow.config

Co-authored-by: Maxime U Garcia <[email protected]>

* Update modules/nf-core/glimpse2/splitreference/tests/main.nf.test

Co-authored-by: Maxime U Garcia <[email protected]>

* Update modules/nf-core/glimpse2/splitreference/tests/main.nf.test

Co-authored-by: Maxime U Garcia <[email protected]>

* Update modules/nf-core/glimpse2/splitreference/meta.yml

Co-authored-by: Matthias Hörtenhuber <[email protected]>

* Update snapshot with version file

---------

Co-authored-by: LouisLeNezet <[email protected]>
Co-authored-by: Maxime U Garcia <[email protected]>
Co-authored-by: Matthias Hörtenhuber <[email protected]>
  • Loading branch information
4 people authored Mar 13, 2024
1 parent 5154596 commit fa12139
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 49 deletions.
8 changes: 7 additions & 1 deletion modules/nf-core/glimpse2/splitreference/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ keywords:
- split
- reference
- phasing
- imputation
tools:
- "glimpse2":
description: "GLIMPSE2 is a phasing and imputation method for large-scale low-coverage sequencing studies."
homepage: "https://odelaneau.github.io/GLIMPSE"
documentation: "https://odelaneau.github.io/GLIMPSE/commands.html"
tool_dev_url: "https://github.com/odelaneau/GLIMPSE"
doi: "10.1038/s41588-020-00756-0"
licence: "['MIT']"
licence: ["MIT"]
requirements:
- AVX2
input:
Expand All @@ -36,6 +37,11 @@ input:
type: string
description: Target imputed region, excluding left and right buffers (e.g. chr20:1000000-2000000).
pattern: "chrXX:leftBufferPosition-rightBufferPosition"
- meta2:
type: map
description: |
Groovy Map containing genomic map information
e.g. `[ map:'GRCh38' ]`
- map:
type: file
description: File containing the genetic map.
Expand Down
70 changes: 70 additions & 0 deletions modules/nf-core/glimpse2/splitreference/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
nextflow_process {

name "Test Process GLIMPSE2_SPLITREFERENCE"
script "../main.nf"
config "./nextflow.config"

process "GLIMPSE2_SPLITREFERENCE"

tag "modules_nfcore"
tag "modules"
tag "glimpse2"
tag "glimpse2/splitreference"

test("Should run without map") {

when {
process {
"""
input[0] = [
[ id:'ref1000GP', single_end:false ], // meta map
file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf", checkIfExists: true),
file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf.csi", checkIfExists: true),
"chr21:16600000-16800000",
"chr21:16600000-16800000"
]
input[1]= [[ id:'map'],[]]
"""
}
}

then {
assertAll(
{ assert process.success },
// File has a timestamp in it and is in binary format, so we can only check the name
{ assert file(process.out.bin_ref[0][1]).name == "ref1000GP_chr21_16600000_16800000.bin" },
{ assert snapshot(process.out.version).match()}
)
}

}

test("Should run with map") {

when {
process {
"""
input[0] = [
[ id:'ref1000GP', single_end:false ], // meta map
file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf", checkIfExists: true),
file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf.csi", checkIfExists: true),
"chr21:16600000-16800000",
"chr21:16600000-16800000"
]
input[1]= [[ id:'map'], file(params.modules_testdata_base_path + "delete_me/glimpse/chr21.b38.gmap.gz", checkIfExists: true)]
"""
}
}

then {
assertAll(
{ assert process.success },
// File has a timestamp in it and is in binary format, so we can only check the name
{ assert file(process.out.bin_ref[0][1]).name == "ref1000GP_chr21_16600000_16800000.bin" },
{ assert snapshot(process.out.version).match()}
)
}

}

}
18 changes: 18 additions & 0 deletions modules/nf-core/glimpse2/splitreference/tests/main.nf.test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ process {
].join(' ')
ext.prefix = { "${meta.id}" }
}
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }

}
2 changes: 2 additions & 0 deletions modules/nf-core/glimpse2/splitreference/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
glimpse2/splitreference:
- modules/nf-core/glimpse2/splitreference/**
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -914,9 +914,6 @@ glimpse2/concordance:
glimpse2/ligate:
- modules/nf-core/glimpse2/ligate/**
- tests/modules/nf-core/glimpse2/ligate/**
glimpse2/splitreference:
- modules/nf-core/glimpse2/splitreference/**
- tests/modules/nf-core/glimpse2/splitreference/**
glnexus:
- modules/nf-core/glnexus/**
- tests/modules/nf-core/glnexus/**
Expand Down
26 changes: 0 additions & 26 deletions tests/modules/nf-core/glimpse2/splitreference/main.nf

This file was deleted.

17 changes: 0 additions & 17 deletions tests/modules/nf-core/glimpse2/splitreference/test.yml

This file was deleted.

0 comments on commit fa12139

Please sign in to comment.