From 1e63d3e6b1bf236a81e453f367fbdb76390c3f3d Mon Sep 17 00:00:00 2001 From: Nils Koelling Date: Wed, 14 Aug 2019 15:52:35 +0100 Subject: [PATCH] fix crash when ALT allele is missing in VCF --- bin/CrossMap.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/CrossMap.py b/bin/CrossMap.py index b655258..6f84a94 100755 --- a/bin/CrossMap.py +++ b/bin/CrossMap.py @@ -644,7 +644,9 @@ def crossmap_vcf_file(mapping, infile, outfile, liftoverfile, refgenome): print(line, file=UNMAP) if a[1][3] == '-': - fields[4] = revcomp_DNA(fields[4], True) + # reverse complement ALT allele, but only if it's not missing + if fields[4] != '.': + fields[4] = revcomp_DNA(fields[4], True) if fields[3] != fields[4]: print('\t'.join(map(str, fields)), file=FILE_OUT)