Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix key error #94

Merged
merged 2 commits into from
Feb 7, 2024
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
16 changes: 8 additions & 8 deletions scripts/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,25 +78,25 @@ def convert_allele(allele, resolution):

# Output: P-group allele
elif resolution == 'p-group':
if allele[:-1] in p_group[i]:
allele = p_group[i][allele[:-1]]
if allele[:-1] in p_group[str(i)]:
allele = p_group[str(i)][allele[:-1]]

elif process_allele(allele[:-1], i - 1) in p_group[i]:
allele = p_group[i][process_allele(allele[:-1], i -1)]
elif process_allele(allele[:-1], i - 1) in p_group[str(i)]:
allele = p_group[str(i)][process_allele(allele[:-1], i -1)]

# Input: ungrouped allele
# Output: G-group allele
elif resolution == 'g-group':
if allele in g_group[i]:
allele = g_group[i][allele]
if allele in g_group[str(i)]:
allele = g_group[str(i)][allele]
elif allele[-1] != 'N':
allele = process_allele(allele,3)

# Input: ungrouped allele
# Output: P-group allele
elif resolution == 'p-group':
if allele in p_group[i]:
allele = p_group[i][allele]
if allele in p_group[str(i)]:
allele = p_group[str(i)][allele]

# Input: ungrouped allele
# Output: reduced resolution, ungrouped allele
Expand Down
Loading