Skip to content

Commit c8ead6f

Browse files
committed
Update solutions
1 parent c24dad3 commit c8ead6f

File tree

14 files changed

+5027
-0
lines changed

14 files changed

+5027
-0
lines changed
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
nextflow_process {
2+
3+
name "Test Process GATK_HAPLOTYPECALLER"
4+
script "../main.nf"
5+
process "GATK_HAPLOTYPECALLER"
6+
7+
test("Should call son's halotype correctly") {
8+
9+
setup {
10+
run("SAMTOOLS_INDEX") {
11+
script "../../../samtools/index/main.nf"
12+
process {
13+
"""
14+
input[0] = file("${projectDir}/data/bam/reads_son.bam")
15+
"""
16+
}
17+
}
18+
}
19+
when {
20+
params {
21+
outdir = "tests/results"
22+
}
23+
process {
24+
"""
25+
input[0] = SAMTOOLS_INDEX.out
26+
input[1] = file("${projectDir}/data/ref/ref.fasta")
27+
input[2] = file("${projectDir}/data/ref/ref.fasta.fai")
28+
input[3] = file("${projectDir}/data/ref/ref.dict")
29+
input[4] = file("${projectDir}/data/ref/intervals.bed")
30+
"""
31+
}
32+
}
33+
34+
then {
35+
assert process.success
36+
assert path(process.out[0][0]).readLines().contains('#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT reads_son')
37+
assert path(process.out[0][0]).readLines().contains('20_10037292_10066351 3277 . G <NON_REF> . . END=3282 GT:DP:GQ:MIN_DP:PL 0/0:25:72:24:0,72,719')
38+
}
39+
40+
}
41+
42+
test("Should call mother's halotype correctly") {
43+
44+
setup {
45+
run("SAMTOOLS_INDEX") {
46+
script "../../../samtools/index/main.nf"
47+
process {
48+
"""
49+
input[0] = file("${projectDir}/data/bam/reads_mother.bam")
50+
"""
51+
}
52+
}
53+
}
54+
55+
when {
56+
params {
57+
outdir = "tests/results"
58+
}
59+
process {
60+
"""
61+
input[0] = SAMTOOLS_INDEX.out
62+
input[1] = file("${projectDir}/data/ref/ref.fasta")
63+
input[2] = file("${projectDir}/data/ref/ref.fasta.fai")
64+
input[3] = file("${projectDir}/data/ref/ref.dict")
65+
input[4] = file("${projectDir}/data/ref/intervals.bed")
66+
"""
67+
}
68+
}
69+
70+
then {
71+
assert process.success
72+
assert path(process.out[0][0]).readLines().contains('#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT reads_mother')
73+
assert path(process.out[0][0]).readLines().contains('20_10037292_10066351 3277 . G <NON_REF> . . END=3278 GT:DP:GQ:MIN_DP:PL 0/0:38:99:37:0,102,1530')
74+
}
75+
}
76+
77+
test("Should call father's halotype correctly") {
78+
79+
setup {
80+
run("SAMTOOLS_INDEX") {
81+
script "../../../samtools/index/main.nf"
82+
process {
83+
"""
84+
input[0] = file("${projectDir}/data/bam/reads_father.bam")
85+
"""
86+
}
87+
}
88+
}
89+
90+
when {
91+
params {
92+
outdir = "tests/results"
93+
}
94+
process {
95+
"""
96+
input[0] = SAMTOOLS_INDEX.out
97+
input[1] = file("${projectDir}/data/ref/ref.fasta")
98+
input[2] = file("${projectDir}/data/ref/ref.fasta.fai")
99+
input[3] = file("${projectDir}/data/ref/ref.dict")
100+
input[4] = file("${projectDir}/data/ref/intervals.bed")
101+
"""
102+
}
103+
}
104+
105+
then {
106+
assert process.success
107+
assert path(process.out[0][0]).readLines().contains('#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT reads_father')
108+
assert path(process.out[0][0]).readLines().contains('20_10037292_10066351 3277 . G <NON_REF> . . END=3281 GT:DP:GQ:MIN_DP:PL 0/0:44:99:42:0,120,1800')
109+
}
110+
}
111+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"Should call son's halotype correctly": {
3+
"content": [
4+
{
5+
"0": [
6+
"reads_son.bam.g.vcf:md5,069316cdd4328542ffc6ae247b1dac39"
7+
],
8+
"1": [
9+
"reads_son.bam.g.vcf.idx:md5,dc36c18f2afdc546f41e68b2687e9334"
10+
],
11+
"idx": [
12+
"reads_son.bam.g.vcf.idx:md5,dc36c18f2afdc546f41e68b2687e9334"
13+
],
14+
"vcf": [
15+
"reads_son.bam.g.vcf:md5,069316cdd4328542ffc6ae247b1dac39"
16+
]
17+
}
18+
],
19+
"meta": {
20+
"nf-test": "0.9.2",
21+
"nextflow": "24.10.0"
22+
},
23+
"timestamp": "2025-03-04T09:26:58.537420116"
24+
}
25+
}

0 commit comments

Comments
 (0)