From 72454909f98fb51a3e6b43fd0a1ad66e099cdf7a Mon Sep 17 00:00:00 2001 From: Jaime Huerta-Cepas Date: Mon, 24 Apr 2017 09:30:37 +0200 Subject: [PATCH] fixes bug in annota.py when using target_taxa --- eggnogmapper/annota.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eggnogmapper/annota.py b/eggnogmapper/annota.py index 0f82f0ad..c13ba861 100644 --- a/eggnogmapper/annota.py +++ b/eggnogmapper/annota.py @@ -247,6 +247,7 @@ def get_member_ogs(name): return ogs def get_member_orthologs(member, target_taxa=None, target_levels=None): + query_taxa = member.split('.', 1)[0] target_members = set([member]) cmd = 'SELECT orthoindex FROM member WHERE name = "%s"' % member.strip() db.execute(cmd) @@ -264,7 +265,7 @@ def get_member_orthologs(member, target_taxa=None, target_levels=None): for _sp, _side in [(by_sp1, side1), (by_sp2, side2)]: for t, s in _side: - if not target_taxa or t in target_taxa or t in query_taxa: + if not target_taxa or t in target_taxa or t == query_taxa: mid = "%s.%s" % (t, s) _sp.setdefault(t, set()).add(mid)