Skip to content

Commit

Permalink
skip multi-allelic ambiguity codes instead of failing
Browse files Browse the repository at this point in the history
  • Loading branch information
jts committed Dec 8, 2022
1 parent 4a73f6e commit 2332b92
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion workflow/scripts/mixture_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ def calculate(sample_a, sample_b, variants, counts):
# if A is an IUPAC code, resolve to the non-B allele
allele_a = resolve_iupac(allele_a, allele_b)

if allele_a == None:
continue

# skip non-informative positions
if allele_a == allele_b:
continue
Expand Down Expand Up @@ -180,7 +183,6 @@ def resolve_iupac(code, fixed_base):
elif b == fixed_base:
return a
else:
assert(False)
return None
else:
return None
Expand All @@ -204,6 +206,9 @@ def load_msa_alleles(alleles_fn):
continue
aa = resolve_iupac(ca, ra)

if aa == None:
continue

v = Variant("contig", int(row['pos']), ra, aa)
out[sample][v] = ca
return out
Expand Down

0 comments on commit 2332b92

Please sign in to comment.