Skip to content

Commit

Permalink
Glimpse ligate nftest (nf-core#4048)
Browse files Browse the repository at this point in the history
* Restart as new

* Delete pytest from config

* Update main.nf.test
  • Loading branch information
LouisLeNezet authored and laramiellindsey committed Oct 18, 2023
1 parent dc1f2a7 commit 6aa347e
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 4 deletions.
73 changes: 73 additions & 0 deletions modules/nf-core/glimpse/ligate/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
nextflow_process {

name "Test Process GLIMPSE_LIGATE"
script "modules/nf-core/glimpse/ligate/main.nf"
process "GLIMPSE_LIGATE"
tag "glimpse"
tag "glimpse_ligate"
tag "modules_nfcore"
tag "modules"

test("test_glimpse_ligate") {
setup {
run("GLIMPSE_PHASE") {
script "../../phase/main.nf"
process {
"""
ch_sample = Channel.of('NA12878 2').collectFile(name: 'sampleinfos.txt')
region = Channel.fromList([
["chr21:16600000-16750000","chr21:16650000-16700000"],
["chr21:16650000-16800000","chr21:16700000-16750000"]
])
input_vcf = Channel.of([
[ id:'input'], // meta map
file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz", checkIfExists: true),
file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz.csi", checkIfExists: true)
])
ref_panel = Channel.of([
file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf", checkIfExists: true),
file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf.csi", checkIfExists: true)
])
ch_map = Channel.of([
file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/chr21.b38.gmap.gz", checkIfExists: true),
])
input[0] = input_vcf
| combine(ch_sample)
| combine(region)
| combine(ref_panel)
| combine(ch_map)
"""
}
}
run("BCFTOOLS_INDEX") {
script "../../../bcftools/index/main.nf"
process {
"""
input[0] = GLIMPSE_PHASE.out.phased_variant
"""
}
}
}

when {
process {
"""
input[0] = GLIMPSE_PHASE.out.phased_variant
| groupTuple()
| join (BCFTOOLS_INDEX.out.csi.groupTuple())
"""
}
}

then {
def lines = path(process.out.merged_variants.get(0).get(1)).linesGzip.last()
assertAll(
{ assert process.success },
{ assert snapshot(process.out.versions).match("versions") },
{ assert snapshot(lines).match("ligate") }
)
}

}
}
16 changes: 16 additions & 0 deletions modules/nf-core/glimpse/ligate/tests/main.nf.test.snap

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

2 changes: 2 additions & 0 deletions modules/nf-core/glimpse/ligate/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
glimpse_ligate:
- modules/nf-core/glimpse/ligate/**
4 changes: 0 additions & 4 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1705,10 +1705,6 @@ glimpse/concordance:
- modules/nf-core/glimpse/concordance/**
- tests/modules/nf-core/glimpse/concordance/**

glimpse/ligate:
- modules/nf-core/glimpse/ligate/**
- tests/modules/nf-core/glimpse/ligate/**

glimpse/phase:
- modules/nf-core/glimpse/phase/**
- tests/modules/nf-core/glimpse/phase/**
Expand Down

0 comments on commit 6aa347e

Please sign in to comment.