From f9c881142f7619c73b127732ed4843e43b760e6a Mon Sep 17 00:00:00 2001 From: Don Freed Date: Thu, 9 Oct 2025 15:33:12 -0700 Subject: [PATCH 1/2] Update `vcf_mod.py` to skip annotations with incorrect lengths --- sentieon_cli/scripts/vcf_mod.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sentieon_cli/scripts/vcf_mod.py b/sentieon_cli/scripts/vcf_mod.py index 2ecc89c..af0c4f2 100644 --- a/sentieon_cli/scripts/vcf_mod.py +++ b/sentieon_cli/scripts/vcf_mod.py @@ -636,7 +636,7 @@ def join2(f0, f1, f2, v0, v1, v2, pos, bed): d = [max(e) for e in zip(d0,d1,d2)] if min(d) > 0: v.info[k] = d - continue + continue else: if k in ('STR', 'RU'): d = None @@ -645,8 +645,8 @@ def join2(f0, f1, f2, v0, v1, v2, pos, bed): d = d and d or v0 and v0.info.get(k) if d: v.info[k] = d - continue - if k == 'DP': + continue + elif k == 'DP': d = -1 if d < 0 and v0: d = v0.info.get(k, -1) @@ -656,15 +656,15 @@ def join2(f0, f1, f2, v0, v1, v2, pos, bed): d += v2 and v2.info.get(k, 0) or 0 if d >= 0: v.info[k] = d - continue - if k == 'ML_PROB': + continue + elif k == 'ML_PROB': d = (u.info.get(k) for u in (v1,v2) if u) d = [e for e in d if e is not None] if d: d = functools.reduce(operator.mul, d, 1) v.info[k] = round(d, 2) - continue - if k not in ('QD',): + continue + elif k not in ('QD',): continue v.info.pop(k, None) From fdc25563c07502691145f3a8a8e75a2c85b7584e Mon Sep 17 00:00:00 2001 From: Don Freed Date: Fri, 28 Nov 2025 08:20:59 -0800 Subject: [PATCH 2/2] Updates to vcf_mod.py --- sentieon_cli/scripts/vcf_mod.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/sentieon_cli/scripts/vcf_mod.py b/sentieon_cli/scripts/vcf_mod.py index af0c4f2..148a99a 100644 --- a/sentieon_cli/scripts/vcf_mod.py +++ b/sentieon_cli/scripts/vcf_mod.py @@ -623,27 +623,28 @@ def join2(f0, f1, f2, v0, v1, v2, pos, bed): continue elif t == 'R': if k == 'RPA': - d0 = d1 = d2 = [-1] * (len(v.alt)+1) - if v0 and v0.info.get(k): - s = v0.info.get(k) - d0 = [i >= 0 and s[i] or -1 for i in m0] - if v1 and v1.info.get(k): + d1 = d2 = [-1] * (len(v.alt)+1) + if i1 > 0 and v1.info.get(k): s = v1.info.get(k) d1 = [i >= 0 and s[i] or -1 for i in m1] - if v2 and v2.info.get(k): + if i2 > 0 and v2.info.get(k): s = v2.info.get(k) d2 = [i >= 0 and s[i] or -1 for i in m2] - d = [max(e) for e in zip(d0,d1,d2)] + d = [max(e) for e in zip(d1,d2)] if min(d) > 0: v.info[k] = d continue else: if k in ('STR', 'RU'): - d = None - d = d and d or v1 and v1.info.get(k) - d = d and d or v2 and v2.info.get(k) - d = d and d or v0 and v0.info.get(k) - if d: + if i1 > 0 and i2 > 0 and v1.info.get(k) == v2.info.get(k): + d = v1.info.get(k) + elif i1 > 0: + d = v1.info.get(k) + elif i2 > 0: + d = v2.info.get(k) + else: + d = None + if d is not None: v.info[k] = d continue elif k == 'DP':