Changeset 1741:1c2feb7cd8d2 in orange-bioinformatics


Ignore:
Timestamp:
04/10/13 10:25:41 (13 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Added 'prefix' parameter for KEGG Pathway database interface.

Location:
_bioinformatics/obiKEGG
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • _bioinformatics/obiKEGG/__init__.py

    r1738 r1741  
    408408 
    409409 
    410 def create_gene_sets(): 
    411     pass 
    412  
    413  
    414410def main(): 
    415411    KEGGGenome() 
  • _bioinformatics/obiKEGG/databases.py

    r1737 r1741  
    397397    Interface to the KEGG Genes database. 
    398398 
    399     :param org_code: KEGG organism code (e.g. 'hsa'). 
    400     :type org_code: str 
     399    :param str org_code: KEGG organism code (e.g. 'hsa'). 
    401400 
    402401    """ 
     
    576575 
    577576class Pathway(DBDataBase): 
     577    """ 
     578    KEGG Pathway database 
     579 
     580    :param str prefix: 
     581        KEGG Organism code ('hsa', ...) or 'map', 'ko', 'ec' or 'rn' 
     582 
     583    """ 
    578584    DB = "path" 
    579585    ENTRY_TYPE = PathwayEntry 
    580586 
    581     def __init__(self): 
    582         DBDataBase.__init__(self) 
    583         self._keys = [d.entry_id for d in self.api.list("path")] 
     587    def __init__(self, prefix="map"): 
     588        DBDataBase.__init__(self) 
     589        self.prefix = prefix 
     590        valid = [d.org_code for d in self.api.list_organisms()] + \ 
     591                ["map", "ko", "ec", "rn"] 
     592 
     593        if prefix not in valid: 
     594            raise ValueError("Invalid prefix %r" % prefix) 
     595 
     596        self._keys = [d.entry_id for d in self.api.list("pathway/" + prefix)] 
Note: See TracChangeset for help on using the changeset viewer.