Skip to content

Commit

Permalink
read synonyms table in get_descendant_taxa() if taxid deprecated #436
Browse files Browse the repository at this point in the history
  • Loading branch information
dengzq1234 committed Mar 29, 2020
1 parent 5e290f5 commit 1324f66
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ete3/ncbi_taxonomy/ncbiquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,11 @@ def get_descendant_taxa(self, parent, intermediate_nodes=False, rank_limit=None,
except KeyError:
raise ValueError('%s not found!' %parent)

# checks if taxid is a deprecated one, and converts into the right one.
_, conversion = self._translate_merged([taxid]) #try to find taxid in synonyms table
if conversion:
taxid = conversion[taxid]

with open(self.dbfile+".traverse.pkl", "rb") as CACHED_TRAVERSE:
prepostorder = pickle.load(CACHED_TRAVERSE)
descendants = {}
Expand Down

0 comments on commit 1324f66

Please sign in to comment.