Commits

Marko Toplak committed fee3c71

KEGG organism name finding fixes.

  • Participants
  • Parent commits 54b84bf

Comments (0)

Files changed (2)

File _bioinformatics/obiKEGG/__init__.py

 
         if name not in genome:
             ids = genome.search(name)
-            if not ids:
-                from .. import obiTaxonomy
-                ids = obiTaxonomy.search(name)
-                ids = [id for id in ids if genome.search(id)]
-            name = ids.pop(0) if ids else name
+            if ids:
+                name = ids.pop(0) if ids else name
+            else:
+                raise OrganismNotFoundError(name)
 
         try:
             return genome[name].organism_code

File _bioinformatics/obiKEGG/databases.py

         if string in self.TAXID_MAP:
             string = self.TAXID_MAP[string]
 
-        res = self.api.find(self.DB, string)
+        res = self.api.find(self.DB, string).strip()
         if not res:
             return []