Skip to content

Commit 5f5b042

Browse files
author
nolson
committed
fixing convert_gvcf_truth missing from namespace.
1 parent 3c1e7ba commit 5f5b042

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

src/python/hap.py

+18-7
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ def main():
8383

8484
# control preprocessing
8585
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.')
8690
parser.add_argument("--preprocess-truth", dest="preprocessing_truth", action="store_true", default=False,
8791
help="Preprocess truth file with same settings as query (default is to accept truth in original format).")
8892
parser.add_argument("--usefiltered-truth", dest="usefiltered_truth", action="store_true", default=False,
@@ -282,10 +286,13 @@ def main():
282286
if args.preprocessing_truth:
283287
if args.filter_nonref:
284288
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:
287293
logging.info("Converting genome VCF to VCF")
288-
294+
convert_gvcf_truth=True
295+
289296
tempfiles.append(ttf.name)
290297
tempfiles.append(ttf.name + ".csi")
291298
tempfiles.append(ttf.name + ".tbi")
@@ -306,7 +313,7 @@ def main():
306313
args.somatic_allele_conversion,
307314
"TRUTH",
308315
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)
310317

311318
args.vcf1 = ttf.name
312319

@@ -337,8 +344,12 @@ def main():
337344
logging.info("Preprocessing query: %s" % args.vcf2)
338345
if args.filter_nonref:
339346
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
342353

343354
starttime = time.time()
344355

@@ -380,7 +391,7 @@ def main():
380391
args.somatic_allele_conversion,
381392
"QUERY",
382393
filter_nonref=args.filter_nonref,
383-
convert_gvcf_to_vcf=args.convert_gvcf_to_vcf)
394+
convert_gvcf_to_vcf=convert_gvcf_query)
384395

385396
args.vcf2 = qtf.name
386397
h2 = vcfextract.extractHeadersJSON(args.vcf2)

0 commit comments

Comments
 (0)