Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pyard/pyard.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def __init__(self, dbversion: str='Latest',
locusbroad="*".join([locus,broad])
for split in dictbroad[(locus,broad)]:
locussplit="*".join([locus,split])
if locusbroad in self.xxcodes.keys():
if locusbroad in self.xxcodes:
self.xxcodes[locusbroad].extend(self.xxcodes[locussplit])
else:
self.xxcodes[locusbroad] = self.xxcodes[locussplit]
Expand Down Expand Up @@ -444,7 +444,8 @@ def redux_gl(self, glstring: str, redux_type: str) -> str:
loc_name, code = loc_allele[0], loc_allele[1]

# handle XX codes
if(ismac(glstring) and glstring.split(":")[1] == "XX"):
# test that they are valid
if(ismac(glstring) and glstring.split(":")[1] == "XX") and loc_name in self.xxcodes:
loc, n = loc_name.split("*")
return self.redux_gl("/".join(sorted(self.xxcodes[loc_name], key=functools.cmp_to_key(smart_sort_comparator))), redux_type)

Expand Down