@@ -83,6 +83,10 @@ def main():
83
83
84
84
# control preprocessing
85
85
pre .updateArgs (parser )
86
+ parser .add_argument ('--convert-gvcf-truth' , dest = 'convert_gvcf_truth' , action = "store_true" , default = False ,
87
+ help = 'Convert the truth set from genome VCF format to a VCF before processing.' )
88
+ parser .add_argument ('--convert-gvcf-query' , dest = 'convert_gvcf_query' , action = "store_true" , default = False ,
89
+ help = 'Convert the query set from genome VCF format to a VCF before processing.' )
86
90
parser .add_argument ("--preprocess-truth" , dest = "preprocessing_truth" , action = "store_true" , default = False ,
87
91
help = "Preprocess truth file with same settings as query (default is to accept truth in original format)." )
88
92
parser .add_argument ("--usefiltered-truth" , dest = "usefiltered_truth" , action = "store_true" , default = False ,
@@ -282,10 +286,13 @@ def main():
282
286
if args .preprocessing_truth :
283
287
if args .filter_nonref :
284
288
logging .info ("Filtering out any variants genotyped as <NON_REF>" )
285
-
286
- if args .convert_gvcf_to_vcf :
289
+
290
+ ## Only converting truth gvcf to vcf if both arguments are true
291
+ convert_gvcf_truth = False
292
+ if args .convert_gvcf_truth or args .convert_gvcf_to_vcf :
287
293
logging .info ("Converting genome VCF to VCF" )
288
-
294
+ convert_gvcf_truth = True
295
+
289
296
tempfiles .append (ttf .name )
290
297
tempfiles .append (ttf .name + ".csi" )
291
298
tempfiles .append (ttf .name + ".tbi" )
@@ -306,7 +313,7 @@ def main():
306
313
args .somatic_allele_conversion ,
307
314
"TRUTH" ,
308
315
filter_nonref = args .filter_nonref if args .preprocessing_truth else False ,
309
- convert_gvcf_to_vcf = args . convert_gvcf_to_vcf )
316
+ convert_gvcf_to_vcf = convert_gvcf_truth )
310
317
311
318
args .vcf1 = ttf .name
312
319
@@ -337,8 +344,12 @@ def main():
337
344
logging .info ("Preprocessing query: %s" % args .vcf2 )
338
345
if args .filter_nonref :
339
346
logging .info ("Filtering out any variants genotyped as <NON_REF>" )
340
- if args .convert_gvcf_to_vcf :
341
- logging .info ("Converting genome VCF to VCF" )
347
+
348
+ ## Only converting truth gvcf to vcf if both arguments are true
349
+ convert_gvcf_query = False
350
+ if args .convert_gvcf_query or args .convert_gvcf_to_vcf :
351
+ logging .info ("Converting genome VCF to VCF" )
352
+ convert_gvcf_query = True
342
353
343
354
starttime = time .time ()
344
355
@@ -380,7 +391,7 @@ def main():
380
391
args .somatic_allele_conversion ,
381
392
"QUERY" ,
382
393
filter_nonref = args .filter_nonref ,
383
- convert_gvcf_to_vcf = args . convert_gvcf_to_vcf )
394
+ convert_gvcf_to_vcf = convert_gvcf_query )
384
395
385
396
args .vcf2 = qtf .name
386
397
h2 = vcfextract .extractHeadersJSON (args .vcf2 )
0 commit comments