Skip to content

Commit 6512c02

Browse files
author
felix.vandermeeren@chu-montpellier.fr
committed
Turn '2 samples' into '3'
Pass PED file in one of them, to test new 'whatshap pedigree phasing modifié : subworkflows/local/whatshap/tests/main.nf.test modifié : subworkflows/local/whatshap/tests/main.nf.test.snap
1 parent 3f35d8a commit 6512c02

File tree

2 files changed

+123
-58
lines changed

2 files changed

+123
-58
lines changed

subworkflows/local/whatshap/tests/main.nf.test

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@ nextflow_workflow {
3636
[ id: 'FAM'],
3737
[
3838
file(params.pipelines_testdata_base_path + 'testdata/HG002_deepvariant_norm.vcf.gz', checkIfExists: true),
39-
file(params.pipelines_testdata_base_path + 'testdata/HG003_deepvariant_norm.vcf.gz', checkIfExists: true)
39+
file(params.pipelines_testdata_base_path + 'testdata/HG003_deepvariant_norm.vcf.gz', checkIfExists: true),
40+
file(params.pipelines_testdata_base_path + 'testdata/HG004_deepvariant_norm.vcf.gz', checkIfExists: true)
4041
],
4142
[
4243
file(params.pipelines_testdata_base_path + 'testdata/HG002_deepvariant_norm.vcf.gz.tbi', checkIfExists: true),
43-
file(params.pipelines_testdata_base_path + 'testdata/HG003_deepvariant_norm.vcf.gz.tbi', checkIfExists: true)
44+
file(params.pipelines_testdata_base_path + 'testdata/HG003_deepvariant_norm.vcf.gz.tbi', checkIfExists: true),
45+
file(params.pipelines_testdata_base_path + 'testdata/HG004_deepvariant_norm.vcf.gz.tbi', checkIfExists: true)
4446
]
4547
]
4648
input[1] = [[],[]]
@@ -49,6 +51,22 @@ nextflow_workflow {
4951
"""
5052
}
5153
}
54+
run("CREATE_PEDIGREE_FILE") {
55+
script "../../../../modules/local/create_pedigree_file/main.nf"
56+
process {
57+
"""
58+
input[0] = channel.of(
59+
[ [ 'id': 'FAM' ],
60+
[
61+
[id:'HG002', family_id:'FAM', paternal_id:'HG003', maternal_id:'HG004', sex:1, phenotype:2, project:'test', n_files:2, single_end:true],
62+
[id:'HG003', family_id:'FAM', paternal_id:0, maternal_id:0, sex:1, phenotype:1, project:'test', n_files:1, single_end:true],
63+
[id:'HG004', family_id:'FAM', paternal_id:0, maternal_id:0, sex:2, phenotype:1, project:'test', n_files:2, single_end:true]
64+
]
65+
]
66+
)
67+
"""
68+
}
69+
}
5270
}
5371

5472
test ("1 sample") {
@@ -72,7 +90,7 @@ nextflow_workflow {
7290
input[3] = GUNZIP.out.gunzip
7391
input[4] = SAMTOOLS_FAIDX.out.fai
7492
input[5] = channel.of([
75-
[ id:'FAM' ], // meta map
93+
[ id:'FAM' ], // Empty ch_pedigree
7694
[]
7795
])
7896
"""
@@ -86,7 +104,8 @@ nextflow_workflow {
86104
}
87105
}
88106

89-
test ("2 samples") {
107+
test ("3 samples - With corresponding pedigree file") {
108+
tag "TODO"
90109
when {
91110

92111
workflow {
@@ -103,14 +122,18 @@ nextflow_workflow {
103122
[ id : 'HG003', family_id: 'FAM' ],
104123
file(params.pipelines_testdata_base_path + 'testdata/HG003_PacBio_Revio.bam', checkIfExists: true),
105124
file(params.pipelines_testdata_base_path + 'testdata/HG003_PacBio_Revio.bam.bai', checkIfExists: true)
125+
],
126+
[
127+
[ id : 'HG004', family_id: 'FAM' ],
128+
file(params.pipelines_testdata_base_path + 'testdata/HG004_PacBio_Revio.bam', checkIfExists: true),
129+
file(params.pipelines_testdata_base_path + 'testdata/HG004_PacBio_Revio.bam.bai', checkIfExists: true)
106130
]
131+
107132
)
108133
input[3] = GUNZIP.out.gunzip
109134
input[4] = SAMTOOLS_FAIDX.out.fai
110-
input[5] = channel.of([
111-
[ id:'FAM' ], // meta map
112-
[]
113-
])
135+
input[5] = CREATE_PEDIGREE_FILE.out.ped
136+
//.map { meta, ped_file -> [ [family_id: meta.id], ped_file ] }
114137
"""
115138
}
116139
}
@@ -122,7 +145,7 @@ nextflow_workflow {
122145
}
123146
}
124147

125-
test ("2 samples - family ID equal to sample ID") {
148+
test ("3 samples - family ID equal to sample ID") {
126149
when {
127150

128151
workflow {
@@ -139,12 +162,18 @@ nextflow_workflow {
139162
[ id : 'HG003', family_id: 'HG002' ],
140163
file(params.pipelines_testdata_base_path + 'testdata/HG003_PacBio_Revio.bam', checkIfExists: true),
141164
file(params.pipelines_testdata_base_path + 'testdata/HG003_PacBio_Revio.bam.bai', checkIfExists: true)
165+
],
166+
[
167+
[ id : 'HG004', family_id: 'HG002' ],
168+
file(params.pipelines_testdata_base_path + 'testdata/HG004_PacBio_Revio.bam', checkIfExists: true),
169+
file(params.pipelines_testdata_base_path + 'testdata/HG004_PacBio_Revio.bam.bai', checkIfExists: true)
142170
]
171+
143172
)
144173
input[3] = GUNZIP.out.gunzip
145174
input[4] = SAMTOOLS_FAIDX.out.fai
146175
input[5] = channel.of([
147-
[ id:'HG002' ], // meta map
176+
[ id:'HG002' ], // Empty ch_pedigree
148177
[]
149178
])
150179
"""

subworkflows/local/whatshap/tests/main.nf.test.snap

Lines changed: 84 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -62,184 +62,220 @@
6262
]
6363
}
6464
],
65-
"timestamp": "2026-02-24T13:46:30.672872826",
65+
"timestamp": "2026-03-27T15:22:25.701447208",
6666
"meta": {
6767
"nf-test": "0.9.4",
68-
"nextflow": "25.10.4"
68+
"nextflow": "26.03.0"
6969
}
7070
},
71-
"2 samples": {
71+
"3 samples - family ID equal to sample ID": {
7272
"content": [
7373
{
7474
"0": [
7575
[
7676
{
77-
"id": "FAM"
77+
"id": "HG002"
7878
},
79-
"FAM_phased.vcf.gz:md5,51e4c24e2ec9d083482e182306ff517d"
79+
"HG002_phased.vcf.gz:md5,b8c3ac207225d8a10a60781a90881587"
8080
]
8181
],
8282
"1": [
8383
[
8484
{
85-
"id": "FAM"
85+
"id": "HG002"
8686
},
87-
"FAM_phased.vcf.gz.tbi:md5,b9559256caa667507167ce10d0a4a14a"
87+
"HG002_phased.vcf.gz.tbi:md5,8836998e54d5c996162b8d5c37e834e4"
8888
]
8989
],
9090
"2": [
9191
[
9292
{
9393
"id": "HG002",
94-
"family_id": "FAM"
94+
"family_id": "HG002"
9595
},
96-
"HG002_haplotagged.bam:md5,b31dda50002d0accf196d50872acfb34",
97-
"HG002_haplotagged.bam.bai:md5,5d4cfffafc4dbf1411997efc324e652b"
96+
"HG002_haplotagged.bam:md5,055f28859180b095df142d438872deda",
97+
"HG002_haplotagged.bam.bai:md5,4357013b0be9f437af93cb2a887a1bb8"
9898
],
9999
[
100100
{
101101
"id": "HG003",
102-
"family_id": "FAM"
102+
"family_id": "HG002"
103103
},
104-
"HG003_haplotagged.bam:md5,e558c491198ac46d63abbeaca49cfaea",
105-
"HG003_haplotagged.bam.bai:md5,4920464eb19ea6ec74997c2351649782"
104+
"HG003_haplotagged.bam:md5,9d02816fc804c5d5d2aaa7e1e03a2fdf",
105+
"HG003_haplotagged.bam.bai:md5,e5f8b91e0b377207e00f32a5260f4ed7"
106+
],
107+
[
108+
{
109+
"id": "HG004",
110+
"family_id": "HG002"
111+
},
112+
"HG004_haplotagged.bam:md5,cb9e0c3bd080ed18f1808311c8d159d9",
113+
"HG004_haplotagged.bam.bai:md5,4cea8eb8b093474ed1d771dbc3df2bfe"
106114
]
107115
],
108116
"3": [
117+
"versions.yml:md5,2eb95b0ff2fe985a87f6dcdc8fc5f1b7",
109118
"versions.yml:md5,2eb95b0ff2fe985a87f6dcdc8fc5f1b7",
110119
"versions.yml:md5,2eb95b0ff2fe985a87f6dcdc8fc5f1b7"
111120
],
112121
"haplotagged_bam_bai": [
113122
[
114123
{
115124
"id": "HG002",
116-
"family_id": "FAM"
125+
"family_id": "HG002"
117126
},
118-
"HG002_haplotagged.bam:md5,b31dda50002d0accf196d50872acfb34",
119-
"HG002_haplotagged.bam.bai:md5,5d4cfffafc4dbf1411997efc324e652b"
127+
"HG002_haplotagged.bam:md5,055f28859180b095df142d438872deda",
128+
"HG002_haplotagged.bam.bai:md5,4357013b0be9f437af93cb2a887a1bb8"
120129
],
121130
[
122131
{
123132
"id": "HG003",
124-
"family_id": "FAM"
133+
"family_id": "HG002"
134+
},
135+
"HG003_haplotagged.bam:md5,9d02816fc804c5d5d2aaa7e1e03a2fdf",
136+
"HG003_haplotagged.bam.bai:md5,e5f8b91e0b377207e00f32a5260f4ed7"
137+
],
138+
[
139+
{
140+
"id": "HG004",
141+
"family_id": "HG002"
125142
},
126-
"HG003_haplotagged.bam:md5,e558c491198ac46d63abbeaca49cfaea",
127-
"HG003_haplotagged.bam.bai:md5,4920464eb19ea6ec74997c2351649782"
143+
"HG004_haplotagged.bam:md5,cb9e0c3bd080ed18f1808311c8d159d9",
144+
"HG004_haplotagged.bam.bai:md5,4cea8eb8b093474ed1d771dbc3df2bfe"
128145
]
129146
],
130147
"phased_family_snvs": [
131148
[
132149
{
133-
"id": "FAM"
150+
"id": "HG002"
134151
},
135-
"FAM_phased.vcf.gz:md5,51e4c24e2ec9d083482e182306ff517d"
152+
"HG002_phased.vcf.gz:md5,b8c3ac207225d8a10a60781a90881587"
136153
]
137154
],
138155
"phased_family_snvs_tbi": [
139156
[
140157
{
141-
"id": "FAM"
158+
"id": "HG002"
142159
},
143-
"FAM_phased.vcf.gz.tbi:md5,b9559256caa667507167ce10d0a4a14a"
160+
"HG002_phased.vcf.gz.tbi:md5,8836998e54d5c996162b8d5c37e834e4"
144161
]
145162
],
146163
"versions": [
164+
"versions.yml:md5,2eb95b0ff2fe985a87f6dcdc8fc5f1b7",
147165
"versions.yml:md5,2eb95b0ff2fe985a87f6dcdc8fc5f1b7",
148166
"versions.yml:md5,2eb95b0ff2fe985a87f6dcdc8fc5f1b7"
149167
]
150168
}
151169
],
152-
"timestamp": "2026-02-24T13:46:41.359141062",
170+
"timestamp": "2026-03-27T15:24:06.188477233",
153171
"meta": {
154172
"nf-test": "0.9.4",
155-
"nextflow": "25.10.4"
173+
"nextflow": "26.03.0"
156174
}
157175
},
158-
"2 samples - family ID equal to sample ID": {
176+
"3 samples - With corresponding pedigree file": {
159177
"content": [
160178
{
161179
"0": [
162180
[
163181
{
164-
"id": "HG002"
182+
"id": "FAM"
165183
},
166-
"HG002_phased.vcf.gz:md5,35a014a59bc20b07a0ccc5e5d52898cb"
184+
"FAM_phased.vcf.gz:md5,3fe1a46fe48aa0421bbd9aad9993a5e9"
167185
]
168186
],
169187
"1": [
170188
[
171189
{
172-
"id": "HG002"
190+
"id": "FAM"
173191
},
174-
"HG002_phased.vcf.gz.tbi:md5,d6f55569f0b5b8aceaeac5097345e7cc"
192+
"FAM_phased.vcf.gz.tbi:md5,056ed37d675337df03238c0cf8ac46fa"
175193
]
176194
],
177195
"2": [
178196
[
179197
{
180198
"id": "HG002",
181-
"family_id": "HG002"
199+
"family_id": "FAM"
182200
},
183-
"HG002_haplotagged.bam:md5,048beddf13fecf316ce9dbc5b18c8ca0",
184-
"HG002_haplotagged.bam.bai:md5,b2e6bb0eb5d03fcc87e7e3293b3ba490"
201+
"HG002_haplotagged.bam:md5,6f558f581f5bc1b3edb19f80b087db93",
202+
"HG002_haplotagged.bam.bai:md5,5b8abacadae96af3f899fd3f9ee115a1"
185203
],
186204
[
187205
{
188206
"id": "HG003",
189-
"family_id": "HG002"
207+
"family_id": "FAM"
190208
},
191-
"HG003_haplotagged.bam:md5,a57880865e4032185b64daa69d88b17c",
192-
"HG003_haplotagged.bam.bai:md5,f6e50be1a86ad2633b94c84b492f598c"
209+
"HG003_haplotagged.bam:md5,78dfdf46461b0f2df1dfff5724202345",
210+
"HG003_haplotagged.bam.bai:md5,a551ba19466e709540ca1c3e5a6fb8a3"
211+
],
212+
[
213+
{
214+
"id": "HG004",
215+
"family_id": "FAM"
216+
},
217+
"HG004_haplotagged.bam:md5,0ce5c0606f0c12a69e7f5ead21114d72",
218+
"HG004_haplotagged.bam.bai:md5,420e9b06bcae7de11bf8b17ee6db58b7"
193219
]
194220
],
195221
"3": [
222+
"versions.yml:md5,2eb95b0ff2fe985a87f6dcdc8fc5f1b7",
196223
"versions.yml:md5,2eb95b0ff2fe985a87f6dcdc8fc5f1b7",
197224
"versions.yml:md5,2eb95b0ff2fe985a87f6dcdc8fc5f1b7"
198225
],
199226
"haplotagged_bam_bai": [
200227
[
201228
{
202229
"id": "HG002",
203-
"family_id": "HG002"
230+
"family_id": "FAM"
204231
},
205-
"HG002_haplotagged.bam:md5,048beddf13fecf316ce9dbc5b18c8ca0",
206-
"HG002_haplotagged.bam.bai:md5,b2e6bb0eb5d03fcc87e7e3293b3ba490"
232+
"HG002_haplotagged.bam:md5,6f558f581f5bc1b3edb19f80b087db93",
233+
"HG002_haplotagged.bam.bai:md5,5b8abacadae96af3f899fd3f9ee115a1"
207234
],
208235
[
209236
{
210237
"id": "HG003",
211-
"family_id": "HG002"
238+
"family_id": "FAM"
239+
},
240+
"HG003_haplotagged.bam:md5,78dfdf46461b0f2df1dfff5724202345",
241+
"HG003_haplotagged.bam.bai:md5,a551ba19466e709540ca1c3e5a6fb8a3"
242+
],
243+
[
244+
{
245+
"id": "HG004",
246+
"family_id": "FAM"
212247
},
213-
"HG003_haplotagged.bam:md5,a57880865e4032185b64daa69d88b17c",
214-
"HG003_haplotagged.bam.bai:md5,f6e50be1a86ad2633b94c84b492f598c"
248+
"HG004_haplotagged.bam:md5,0ce5c0606f0c12a69e7f5ead21114d72",
249+
"HG004_haplotagged.bam.bai:md5,420e9b06bcae7de11bf8b17ee6db58b7"
215250
]
216251
],
217252
"phased_family_snvs": [
218253
[
219254
{
220-
"id": "HG002"
255+
"id": "FAM"
221256
},
222-
"HG002_phased.vcf.gz:md5,35a014a59bc20b07a0ccc5e5d52898cb"
257+
"FAM_phased.vcf.gz:md5,3fe1a46fe48aa0421bbd9aad9993a5e9"
223258
]
224259
],
225260
"phased_family_snvs_tbi": [
226261
[
227262
{
228-
"id": "HG002"
263+
"id": "FAM"
229264
},
230-
"HG002_phased.vcf.gz.tbi:md5,d6f55569f0b5b8aceaeac5097345e7cc"
265+
"FAM_phased.vcf.gz.tbi:md5,056ed37d675337df03238c0cf8ac46fa"
231266
]
232267
],
233268
"versions": [
269+
"versions.yml:md5,2eb95b0ff2fe985a87f6dcdc8fc5f1b7",
234270
"versions.yml:md5,2eb95b0ff2fe985a87f6dcdc8fc5f1b7",
235271
"versions.yml:md5,2eb95b0ff2fe985a87f6dcdc8fc5f1b7"
236272
]
237273
}
238274
],
239-
"timestamp": "2026-02-24T13:46:52.46718662",
275+
"timestamp": "2026-03-27T15:23:15.349012614",
240276
"meta": {
241277
"nf-test": "0.9.4",
242-
"nextflow": "25.10.4"
278+
"nextflow": "26.03.0"
243279
}
244280
}
245281
}

0 commit comments

Comments
 (0)