diff --git a/mergesvvcf/mergedfile.py b/mergesvvcf/mergedfile.py index 151b72a..c1975ba 100644 --- a/mergesvvcf/mergedfile.py +++ b/mergesvvcf/mergedfile.py @@ -197,9 +197,12 @@ def passed_variant(record): formats = [] for hformat in vcf_reader.header.formats.itervalues(): num = None - if hformat.name == "GT" or hformat.number == "G": - num = "G" - continue # Genotype is special cant do multiple + # if hformat.name == "GT" or hformat.number == "G": + # num = "G" + # continue # Genotype is special cant do multiple + if hformat.name == "PL": num = "G" + if hformat.number == "G": num = "G" + if hformat.name == "GL": num = "3" outvcf.header.formats.add( "{}_{}".format(program, hformat.name), num or hformat.number, diff --git a/mergesvvcf/vcftobreakpoints.pyx b/mergesvvcf/vcftobreakpoints.pyx index b1bafef..ab58ead 100644 --- a/mergesvvcf/vcftobreakpoints.pyx +++ b/mergesvvcf/vcftobreakpoints.pyx @@ -155,8 +155,10 @@ def breakpointsFromRecord(record): # defaults if chr2 is None: chr2 = chr1 - if pos2 is None and "<" in altstr: + if pos2 is None and "<" in altstr and ">" in altstr: pos2 = record.stop + elif pos2 is None and re.match(r'^[ATCG]+$', altstr.strip(".")): + pos2 = record.pos + len(altstr.strip(".")) # look for symbolic SVTYPE information in the alt field (eg, ) resultSym = re.match(__symbolicRE__, altstr) @@ -189,7 +191,7 @@ def breakpointsFromRecord(record): reflen = len(ref) if pos2 is None: - pos2 = pos1 + reflen + pos2 = pos1 + len(altstr.strip(".")) if svlen is None: svlen = len(altstr) - reflen if svtype is None: