Erva Ulusoy commited on
Commit
99e9041
·
1 Parent(s): ae61728

sort domain locations type error fix 1

Browse files
Files changed (1) hide show
  1. run_domain2go_app.py +3 -2
run_domain2go_app.py CHANGED
@@ -53,7 +53,7 @@ def find_domains(email, sequence, name):
53
  for elem in json_output['matches']:
54
  entry = elem['signature']['entry']
55
 
56
- location_list = [(int(i['start']), int(i['end'])) for i in elem['locations']]
57
 
58
  if type(entry) == dict and entry['type'] == 'DOMAIN':
59
  if entry['accession'] not in entries:
@@ -72,7 +72,8 @@ def find_domains(email, sequence, name):
72
  entries[entry['accession']]['locations'].extend(location_list)
73
 
74
  entries[entry['accession']]['locations'] = list(set(entries[entry['accession']]['locations']))
75
- entries[entry['accession']]['locations'] = sorted(entries[entry['accession']]['locations'], key=lambda x: int(x[0]))
 
76
  entries[entry['accession']]['locations'] = [f'{i[0]}-{i[1]}' for i in entries[entry['accession']]['locations']]
77
  entries[entry['accession']]['locations'] = ';'.join(entries[entry['accession']]['locations'])
78
 
 
53
  for elem in json_output['matches']:
54
  entry = elem['signature']['entry']
55
 
56
+ location_list = [(i['start'], i['end']) for i in elem['locations']]
57
 
58
  if type(entry) == dict and entry['type'] == 'DOMAIN':
59
  if entry['accession'] not in entries:
 
72
  entries[entry['accession']]['locations'].extend(location_list)
73
 
74
  entries[entry['accession']]['locations'] = list(set(entries[entry['accession']]['locations']))
75
+ entries[entry['accession']]['locations'] = [(int(i[0]), int(i[1])) for i in entries[entry['accession']]['locations']]
76
+ entries[entry['accession']]['locations'] = sorted(entries[entry['accession']]['locations'], key=lambda x: x[0])
77
  entries[entry['accession']]['locations'] = [f'{i[0]}-{i[1]}' for i in entries[entry['accession']]['locations']]
78
  entries[entry['accession']]['locations'] = ';'.join(entries[entry['accession']]['locations'])
79