Changeset 1735:50499d1dc55a in orange-bioinformatics for _bioinformatics/obiKEGG/api.py


Ignore:
Timestamp:
04/05/13 19:43:32 (13 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Changed the Organism.gene_aliases method.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _bioinformatics/obiKEGG/api.py

    r1734 r1735  
    109109        return self.service.get(ids).get() 
    110110 
    111     def conv(self, ids): 
    112         raise NotImplementedError() 
     111    def conv(self, target_db, source): 
     112        """ 
     113        Return a mapping from source to target_db ids as a list of two 
     114        tuples [(source_id, target_id), ...]. 
     115 
     116        """ 
     117        if not isinstance(source, basestring): 
     118            source = "+".join(source) 
     119 
     120        res = self.service.conv(target_db)(source).get() 
     121        return [tuple(line.split("\t")) for line in res.splitlines()] 
    113122 
    114123    def link(self, target_db, source_db=None, ids=None): 
     
    431440 
    432441    @cached_method 
    433     def conv(self, ids): 
    434         return KeggApi.conv(self, ids) 
     442    def conv(self, target_db, source): 
     443        return KeggApi.conv(self, target_db, source) 
    435444 
    436445    ######## 
Note: See TracChangeset for help on using the changeset viewer.