Skip to content

Commit

Permalink
fix #469
Browse files Browse the repository at this point in the history
  • Loading branch information
jhcepas committed May 1, 2023
1 parent 5e49e9d commit b5fbc27
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ete3/ncbi_taxonomy/ncbiquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def get_descendant_taxa(self, parent, intermediate_nodes=False, rank_limit=None,
elif intermediate_nodes:
return list(map(int, [n.name for n in tree.get_descendants()]))
else:
return map(int, [n.name for n in tree])
return list(map(int, [n.name for n in tree]))

elif intermediate_nodes:
return [tid for tid, count in six.iteritems(descendants)]
Expand Down Expand Up @@ -410,11 +410,11 @@ def get_topology(self, taxids, intermediate_nodes=False, rank_limit=None, collap
visited = set()
start = prepostorder.index(root_taxid)
try:
end = prepostorder.index(root_taxid, start+1)
subtree = prepostorder[start:end+1]
end = prepostorder.index(root_taxid, start+1)
subtree = prepostorder[start:end+1]
except ValueError:
# If root taxid is not found in postorder, must be a tip node
subtree = [root_taxid]
subtree = [root_taxid]
leaves = set([v for v, count in Counter(subtree).items() if count == 1])
nodes[root_taxid] = PhyloTree(name=str(root_taxid))
current_parent = nodes[root_taxid]
Expand Down

0 comments on commit b5fbc27

Please sign in to comment.