Skip to content

Commit

Permalink
dont break down orthodb_id string
Browse files Browse the repository at this point in the history
  • Loading branch information
lzy7071 committed Sep 14, 2020
1 parent 311731d commit 6ba6094
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions datanator_query_python/query/full_text_search.py
Expand Up @@ -420,10 +420,10 @@ def get_genes_orthodb_count(self, q, num, agg_field="orthodb_id", **kwargs):
for s in r['aggregations']['top_kos']['buckets']:
ko_str = s['top_ko']['hits']['hits'][0]['_source'][agg_field] # ko_str can be "K01234,K12345"
# if ko_str in intersects and ko_str != 'nan':
if ko_str != None:
# s['top_ko']['hits']['hits'][0]['_source']['abundances'] = True
s['top_ko']['hits']['hits'][0]['_source'][agg_field] = [ko_str[i:i+6] for i in range(0, len(ko_str), 6)]
else:
if ko_str is None:
# # s['top_ko']['hits']['hits'][0]['_source']['abundances'] = True
# s['top_ko']['hits']['hits'][0]['_source'][agg_field] = [ko_str[i:i+6] for i in range(0, len(ko_str), 6)]
# else:
# s['top_ko']['hits']['hits'][0]['_source']['abundances'] = False
s['top_ko']['hits']['hits'][0]['_source'][agg_field] = ["N/A"]
return r['aggregations']

0 comments on commit 6ba6094

Please sign in to comment.