Skip to content

Commit

Permalink
get_all_kegg starts with distance of 1
Browse files Browse the repository at this point in the history
  • Loading branch information
lzy7071 committed Mar 12, 2020
1 parent 48b58f1 commit 856433c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions datanator_query_python/query/query_protein.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ def get_all_kegg(self, ko, anchor, max_distance):

result = []
for i in range(max_distance):
result.append({'distance': i , 'documents': []})
result.append({'distance': i + 1, 'documents': []})

projection = {
'ko_number': 1,
Expand All @@ -850,5 +850,5 @@ def get_all_kegg(self, ko, anchor, max_distance):
if distance != -1 and distance <= max_distance:
species_canon_ancestor = obj[species+'_canon_ancestors']
doc['canon_ancestors'] = species_canon_ancestor
result[distance-1]['documents'].append(doc)
result[distance]['documents'].append(doc)
return result
2 changes: 1 addition & 1 deletion datanator_query_python/query/query_taxon_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def get_canon_common_ancestor(self, org1, org2, org_format='tax_id'):
(:obj:`Obj`)
'''
if org1 is None or org2 is None:
return {str(org1): -1, str(org2): -1, 'reason': 'Needs two organisms.'}
return {'reason': 'Needs two organisms.'}

# if org1 == org2:
# return (org1, [0, 0])
Expand Down

0 comments on commit 856433c

Please sign in to comment.