Changeset 1632:9cf919d0f343 in orange-bioinformatics for Orange/bioinformatics/obiKEGG.py


Ignore:
Timestamp:
04/16/12 19:53:28 (2 years ago)
Author:
mitar
Branch:
default
Message:

Fixing imports.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/bioinformatics/obiKEGG.py

    r1625 r1632  
    1212    >>> genes 
    1313""" 
     14 
     15from __future__ import absolute_import 
     16 
    1417try: 
    1518    import Image, ImageDraw, ImageMath 
     
    2326import re 
    2427 
    25 import obiData 
    26 import obiProb 
    27 import orngServerFiles 
    28  
    2928from cPickle import load, loads, dump 
    3029from collections import defaultdict 
    3130 
    32  
    3331import xml.dom.minidom as minidom 
    3432 
    3533from functools import partial, wraps 
    36 import obiTaxonomy 
    37 import orngEnviron 
    3834import urllib2 
    3935import cPickle 
     36 
     37from Orange.orng import orngEnviron, orngServerFiles 
     38 
     39from . import obiData, obiProb, obiTaxonomy 
    4040 
    4141DEFAULT_DATABASE_PATH = orngServerFiles.localpath("KEGG") 
     
    207207    return wrapper 
    208208 
    209 from orngMisc import with_gc_disabled 
    210      
    211              
     209from Orange.orng.orngMisc import with_gc_disabled 
     210 
    212211SLINE, MLINE, LINELIST = range(1, 4) 
    213212 
     
    691690        """Return a dictionary with enriched pathways ids as keys and (list_of_genes, p_value, num_of_reference_genes) tuples as items.""" 
    692691        allPathways = defaultdict(lambda :[[], 1.0, []]) 
    693         import orngMisc 
     692        from Orange.orng import orngMisc 
    694693        milestones = orngMisc.progressBarMilestones(len(genes), 100) 
    695694        for i, gene in enumerate(genes): 
     
    774773    def _get_genematcher(self): 
    775774        if getattr(self, "_genematcher", None) == None: 
    776             import obiGene 
     775            from . import obiGene 
    777776            if self.org_code == "ddi": 
    778777                self._genematcher = obiGene.matcher([obiGene.GMKEGG(self.org_code), obiGene.GMDicty(), 
     
    793792            ids = genome.search(name) 
    794793            if not ids: 
    795                 import obiTaxonomy 
     794                from . import obiTaxonomy 
    796795                ids = obiTaxonomy.search(name) 
    797796                ids = [id for id in ids if genome.search(id)] 
     
    10261025        data = urllib2.urlopen("ftp://ftp.genome.jp/pub/kegg/" + png_path + org + ".list").read() 
    10271026        pathways = sorted(set([line.split()[0][5:] for line in data.splitlines() if line])) 
    1028         from obiData import FtpDownloader 
     1027        from .obiData import FtpDownloader 
    10291028        ftp = FtpDownloader("ftp.genome.jp", _join(), "pub/kegg/", numOfThreads=15) 
    10301029        ftp.massRetrieve([png_path + pathway + ".png" for pathway in pathways]) 
Note: See TracChangeset for help on using the changeset viewer.