Skip to content

Commit

Permalink
Update interface_cameo.py
Browse files Browse the repository at this point in the history
# address error - somehow some mutation string got changed from AAA,0,0 to ('AAA', 0, 0)
  • Loading branch information
mauriceling committed Nov 11, 2021
1 parent 8f9abd4 commit 9884bed
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ASExternalTools/interface_cameo.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,23 @@ def _parse_mutation(mutation):
@return: Dictionary to represent mutation(s)
'''
mutation = str(mutation)
# print(mutation)
if mutation.startswith("(") and mutation.endswith(")"):
mutation = mutation[1:-1]
mutation = mutation.replace("'", "")
# print(mutation)
mutation = [pair.strip() for pair in mutation.split(';')]
# print(mutation)
mutation = [[pair.split(',')[0],
pair.split(',')[1],
pair.split(',')[2]]
for pair in mutation]
# print(mutation)
mutation = [[pair[0].strip(),
pair[1].strip(),
pair[2].strip()]
for pair in mutation]
print(mutation)
ndict = {}
for k in mutation:
ndict[str(k[0])] = (int(k[1]), int(k[2]))
Expand Down

0 comments on commit 9884bed

Please sign in to comment.