@@ -95,6 +95,7 @@ nextflow_process {
9595 path(process.out.vcf.get(0).get(1)).vcf.variantsMD5,
9696 path(process.out.vcf.get(0).get(1)).vcf.summary,
9797 path(process.out.vcf.get(0).get(1)).vcf.sampleCount,
98+ process.out.index,
9899 process.out.findAll { key, val -> key.startsWith("versions")}
99100 ).match() }
100101 )
@@ -120,6 +121,7 @@ nextflow_process {
120121 path(process.out.vcf.get(0).get(1)).vcf.variantsMD5,
121122 path(process.out.vcf.get(0).get(1)).vcf.summary,
122123 path(process.out.vcf.get(0).get(1)).vcf.sampleCount,
124+ process.out.index,
123125 process.out.findAll { key, val -> key.startsWith("versions")}
124126 ).match() }
125127 )
@@ -132,6 +134,7 @@ nextflow_process {
132134 input[0] = BCFTOOLS_SORT.out.vcf
133135 .join(BCFTOOLS_SORT.out.tbi)
134136 .first()
137+ .map { meta, vcf, tbi -> [ [ id : 'test' ], vcf, tbi ] }
135138 input[1] = GUNZIP.out.gunzip
136139 input[2] = SAMTOOLS_FAIDX.out.fai
137140 """
@@ -143,16 +146,17 @@ nextflow_process {
143146 )
144147 }
145148 }
146- test("homo sapiens - 1 VCF - --force-single") {
149+ test("homo sapiens - 1 VCF - --force-single --output-type z --write-index ") {
147150 when {
148151 params {
149- trgt_merge_args = "--force-single"
152+ trgt_merge_args = "--force-single --output-type z --write-index "
150153 }
151154 process {
152155 """
153156 input[0] = BCFTOOLS_SORT.out.vcf
154157 .join(BCFTOOLS_SORT.out.tbi)
155158 .first()
159+ .map { meta, vcf, tbi -> [ [ id : 'test' ], vcf, tbi ] }
156160 input[1] = GUNZIP.out.gunzip
157161 input[2] = SAMTOOLS_FAIDX.out.fai
158162 """
@@ -165,11 +169,87 @@ nextflow_process {
165169 path(process.out.vcf.get(0).get(1)).vcf.variantsMD5,
166170 path(process.out.vcf.get(0).get(1)).vcf.summary,
167171 path(process.out.vcf.get(0).get(1)).vcf.sampleCount,
172+ process.out.index,
168173 process.out.findAll { key, val -> key.startsWith("versions")}
169174 ).match() }
170175 )
171176 }
172177 }
178+ test("homo sapiens - 1 VCF - --force-single --output-type b --write-index") {
179+ when {
180+ params {
181+ trgt_merge_args = "--force-single --output-type b --write-index"
182+ }
183+ process {
184+ """
185+ input[0] = BCFTOOLS_SORT.out.vcf
186+ .join(BCFTOOLS_SORT.out.tbi)
187+ .first()
188+ .map { meta, vcf, tbi -> [ [ id : 'test' ], vcf, tbi ] }
189+ input[1] = GUNZIP.out.gunzip
190+ input[2] = SAMTOOLS_FAIDX.out.fai
191+ """
192+ }
193+ }
194+ then {
195+ assertAll(
196+ { assert process.success },
197+ { assert snapshot(
198+ file(process.out.vcf.get(0).get(1)).name,
199+ process.out.index,
200+ process.out.findAll { key, val -> key.startsWith("versions")}
201+ ).match() }
202+ )
203+ }
204+ }
205+ test("homo sapiens - 2 VCFs - tbi index - stub") {
206+ options "-stub"
207+ when {
208+ params {
209+ trgt_merge_args = "--output-type z --write-index"
210+ }
211+ process {
212+ """
213+ input[0] = BCFTOOLS_SORT.out.vcf
214+ .join(BCFTOOLS_SORT.out.tbi)
215+ .map { meta, vcf, tbi -> [ [ id : 'test' ], vcf, tbi ] }
216+ .groupTuple()
217+ input[1] = [[],[]]
218+ input[2] = [[],[]]
219+ """
220+ }
221+ }
222+ then {
223+ assertAll(
224+ { assert process.success },
225+ { assert snapshot(process.out).match() }
226+ )
227+ }
228+ }
229+ test("homo sapiens - 2 VCFs - csi index - stub") {
230+ options "-stub"
231+ when {
232+ params {
233+ trgt_merge_args = "--output-type b --write-index"
234+ }
235+ process {
236+ """
237+ input[0] = BCFTOOLS_SORT.out.vcf
238+ .join(BCFTOOLS_SORT.out.tbi)
239+ .map { meta, vcf, tbi -> [ [ id : 'test' ], vcf, tbi ] }
240+ .groupTuple()
241+ input[1] = [[],[]]
242+ input[2] = [[],[]]
243+ """
244+ }
245+ }
246+ then {
247+ assertAll(
248+ { assert process.success },
249+ { assert snapshot(process.out).match() }
250+ )
251+ }
252+ }
173253 test("homo sapiens - 2 VCFs - stub") {
174254 options "-stub"
175255 when {
@@ -187,10 +267,7 @@ nextflow_process {
187267 then {
188268 assertAll(
189269 { assert process.success },
190- { assert snapshot(
191- process.out,
192- process.out.findAll { key, val -> key.startsWith("versions")}
193- ).match() }
270+ { assert snapshot(process.out).match() }
194271 )
195272 }
196273 }
0 commit comments