Commits

mitar committed 9cf919d

Fixing imports.

  • Participants
  • Parent commits 45bbfc8

Comments (0)

Files changed (53)

Orange/bioinformatics/obiArrayExpress.py

 
 Low level Array Express query using REST services::
 
-    >>> import obiArrayExpress
+    >>> from Orange.bioinformatics import obiArrayExpress
     >>> obiArrayExpress.query_experiments(accession='E-MEXP-31')
     {u'experiments': ...
     
 
 """
 
+from __future__ import absolute_import
+
 import os, sys
 import urllib2
 
-import orngServerFiles
+from Orange.orng import orngServerFiles
 import warnings
 import posixpath
 import shelve
 def ef_ontology():
     """ Return the `EF <http://www.ebi.ac.uk/efo/>`_ (Experimental Factor) ontology
     """
-    import obiOntology
+    from . import obiOntology
 #    return obiOntology.OBOOntology(urllib2.urlopen("http://efo.svn.sourceforge.net/svnroot/efo/trunk/src/efoinobo/efo.obo"))
-    import orngServerFiles
+    from Orange.orng import orngServerFiles
     # Should this be in the OBOFoundry (Ontology) domain
     try:
         file = open(orngServerFiles.localpath_download("ArrayExpress", "efo.obo"), "rb")

Orange/bioinformatics/obiAssess.py

 dictionary of { name: score } for that example.
 """
 
-import obiGsea
-import obiGeneSets
-import orange
-import Orange
-import stats
-import statc
+from __future__ import absolute_import
+
+from collections import defaultdict
+import math
+
 import numpy
-import math
-import obiExpression
-import obiGene
-from collections import defaultdict
+
+import orange, Orange, statc
+
+from . import obiExpression, obiGene, obiGsea, obiGeneSets, stats
 
 def normcdf(x, mi, st):
     return 0.5*(2. - stats.erfcc((x - mi)/(st*math.sqrt(2))))
             return 0.0 #middle value
         #return first class probablity
 
-        import math
-
         def saveplog(a,b):
             try:
                 return math.log(a/b)
     data = orange.ExampleTable(dom2, data)
 
     #impute
-    import orngTree 
+    from Orange.orng import orngTree 
     imputer = orange.ImputerConstructor_model() 
     imputer.learnerContinuous = imputer.learnerDiscrete = orange.MajorityLearner()
     imputer = imputer(data)

Orange/bioinformatics/obiBioMart.py

 
 from functools import partial
 
-import orngEnviron
+from Orange.orng import orngEnviron
 
 class BioMartError(Exception):
     pass

Orange/bioinformatics/obiChem.py

         count.sort(lambda a,b:cmp(a[1], b[1]))
         return count[-1][0]
             
-import orngSVM
+from Orange.orng import orngSVM
 class FragmentBasedLearner(orange.Learner):
     """A learner wrapper class that first runs the molecular fragmentation on the data.
     Attributes:

Orange/bioinformatics/obiData.py

-from __future__ import with_statement
+from __future__ import absolute_import, with_statement
+
 import ftplib
 import urllib, urllib2
 import threading
 from StringIO import StringIO
 from datetime import datetime
 from threading import RLock
-from obiGenomicsUpdate import synchronized
+
+from .obiGenomicsUpdate import synchronized
 
 class FileNotFoundError(IOError):
     pass
         """ List the contents of the remote ftp dir (similar to os.listdir)
         """
         return self.ftpWorker.listdir(self.ftpDir + ftp_dir)
-    
+    

Orange/bioinformatics/obiDicty.py

 from itertools import *
 import urllib
 import urllib2
-import orange
 import socket
 import os
 from collections import defaultdict
-import orngServerFiles
 import pickle
 
+import orange
+from Orange.orng import orngServerFiles
+
 defaddress = "http://bcm.fri.uni-lj.si/microarray/api/index.php?"
 #defaddresspipa = "https://pipa.fri.uni-lj.si/pipa/script/api/orange.py?action="
 defaddresspipa = "https://pipa.fri.uni-lj.si/PIPA/PIPAapi/PIPAorange.py"

Orange/bioinformatics/obiDifscale.py

+from __future__ import absolute_import
+
 import random
 from math import log
 from operator import itemgetter
 import numpy
 
 import Orange
-import obiGEO
-from obiExpression import ExpressionSignificance_Test
 
+from . import obiGEO
+from .obiExpression import ExpressionSignificance_Test
 
 # Utility functiions
 
 ############
 
 if False and __name__ == '__main__':
-    import obiGEO
+    from . import obiGEO
     # Data set 1
     data1 = obiGEO.GDS('GDS2666').getdata(report_genes=True, transpose=False)
     labels1 = list(a.attributes['time'] for a in data1.domain.attributes)

Orange/bioinformatics/obiExpression.py

-import stats, orange, numpy, statc
+from __future__ import absolute_import
+
+import numpy
+
+import orange, statc
+
+from . import stats
 
 def mean(l):
     return float(sum(l))/len(l)
     
 """
 
-import orngMisc
+from Orange.orng import orngMisc
 from numpy import median
 def lowess(x, y, f=2./3., iter=3, progressCallback=None):
     """ Lowess taken from Bio.Statistics.lowess, modified to compute pairwise 

Orange/bioinformatics/obiGEO.py

+from __future__ import absolute_import
+
+import cPickle, gzip, os.path, re
+
 import orange
-import re
-import gzip
-import os.path
-import orngServerFiles
-import obiData
-import orngMisc
-import obiTaxonomy
-import cPickle
+from Orange.orng import orngMisc, orngServerFiles
+
+from . import obiData, obiTaxonomy
 
 def spots_mean(x):
     vs = [v for v in x if v and v<>"?"]

Orange/bioinformatics/obiGO.py

 
 """
 
+from __future__ import absolute_import
+
 from urllib import urlretrieve
 from gzip import GzipFile
 import tarfile
 from datetime import datetime
 from collections import defaultdict
 
-import obiProb, obiGene
-import orngEnviron
+from Orange.orng import orngEnviron
+
+from . import obiProb, obiGene
 
 try:
-    import orngServerFiles
+    from Orange.orng import orngServerFiles
     default_database_path = os.path.join(orngServerFiles.localpath(), "GO")
 except Exception:
     default_database_path = os.curdir
         """
         filename = os.path.join(default_database_path, "gene_ontology_edit.obo.tar.gz")
         if not os.path.isfile(filename) and not os.path.isdir(filename):
-            import orngServerFiles
+            from Orange.orng import orngServerFiles
             orngServerFiles.download("GO", "gene_ontology_edit.obo.tar.gz")
         try:
             return cls(filename, progressCallback=progressCallback)
         c=re.compile("\[.+?\].*?\n\n", re.DOTALL)
         data=c.findall(data)
 
-        import orngMisc
+        from Orange.orng import orngMisc
         milestones = orngMisc.progressBarMilestones(len(data), 90)
         for i, block in enumerate(builtinOBOObjects + data):
             if block.startswith("[Term]"):
                 self.__dict__ = a.__dict__
                 self.taxid = to_taxid(organism_name_search(file)).pop()
         if not self.genematcher and self.taxid:
-            import obiGene
+            from . import obiGene
             self.genematcher = obiGene.matcher([obiGene.GMGO(self.taxid)] + \
                                                ([obiGene.GMDicty(), [obiGene.GMGO(self.taxid),
                                                                      obiGene.GMDicty()]] \
     @classmethod
     def organism_name_search(cls, org):
         ids = to_taxid(org) 
-        import obiTaxonomy as tax
+        from . import obiTaxonomy as tax
         if not ids:
             ids = [org] if org in Taxonomy().common_org_map.keys() + Taxonomy().code_map.keys() else []
         if not ids:
         """A class method that tries to load the association file for the
         given organism from default_database_path.
         """
-        import orngServerFiles
+        from Orange.orng import orngServerFiles
         code = organism_name_search(org)
         
         file = "gene_association.%s.tar.gz" % code
         else:
             f = file
         lines = [line for line in f.read().split("\n") if line.strip()]
-        import orngMisc
+        from Orange.orng import orngMisc
         milestones = orngMisc.progressBarMilestones(len(lines), 100)
         for i,line in enumerate(lines):
             if line.startswith("!"):
             
         terms = self.ontology.ExtractSuperGraph(annotationsDict.keys())
         res = {}
-        import orngMisc
+        from Orange.orng import orngMisc
         milestones = orngMisc.progressBarMilestones(len(terms), 100)
         for i, term in enumerate(terms):
             if slimsOnly and term not in self.ontology.slimsSubset:
         
         os.rename(filename + ".part", filename)
 
-from obiTaxonomy import pickled_cache
+from . from obiTaxonomy import pickled_cache
 
 @pickled_cache(None, [("GO", "taxonomy.pickle"), ("Taxonomy", "ncbi_taxonomy.tar.gz")])
 def organism_name_search(name):
             plt.plot([connectAt.get(parent)]*2, [len(termsList) - i, len(termsList) - parent], color="black")
         cellText.append((str(n), str(m), p_val, fdr_val, name, genes))
 
-##    from orngClustering import TableTextLayout
+##    from Orange.orng.orngClustering import TableTextLayout
 ##    text = TableTextLayout((maxFoldEnrichment*1.1, len(termsList)), cellText)
-    from orngClustering import TablePlot
+    from Orange.orng.orngClustering import TablePlot
     if True:
         axes2 = plt.axes([0.3, 0.1, 0.6, 0.8], sharey=axes1)
         axes2.set_axis_off()
     def __init__(self):
         self.__dict__ = self.__shared_state
         if not self.tax:
-            import orngServerFiles
+            from Orange.orng import orngServerFiles
             path = orngServerFiles.localpath_download("GO", "taxonomy.pickle")
             if os.path.isfile(path):
                 self.tax = cPickle.load(open(path, "rb"))
         fSize = 10000000 if fSize == -1 else fSize
         self.callback(100*bCount*bSize/fSize)
         
-from obiGenomicsUpdate import Update as UpdateBase
+from .obiGenomicsUpdate import Update as UpdateBase
 
 import urllib2
 

Orange/bioinformatics/obiGene.py

-import os
-import obiTaxonomy
-import orngServerFiles
+from __future__ import absolute_import
 
-import time
+import os, time
+
+from Orange.orng . import orngServerFiles
+
+from . import obiTaxonomy
 
 default_database_path = orngServerFiles.localpath("NCBI_geneinfo")
 
         return "ensembl_" + self.organism
     
     def create_info(self):
-        import obiBioMart
+        from . import obiBioMart
         if self.organism in self.BIOMART_CONF:
             dset_name, attrs = self.BIOMART_CONF[self.organism]
         else:
     """ Returns buffer path from Orange's setting folder if not 
     defined differently (in gene_matcher_path). """
     if  gene_matcher_path == None:
-        import orngEnviron
+        from Orange.orng import orngEnviron
         pth = os.path.join(orngEnviron.directoryNames["bufferDir"], 
             "gene_matcher")
         try:
 class MatcherAliasesKEGG(MatcherAliasesPickled):
 
     def _organism_name(self, organism):
-        import obiKEGG 
+        from . import obiKEGG 
         return obiKEGG.organism_name_search(organism)
 
     def create_aliases(self):
         organism = self._organism_name(self.organism)
-        import obiKEGG
+        from . import obiKEGG
         org = obiKEGG.KEGGOrganism(self.organism, genematcher=GMDirect())
         genes = org.genes
         osets = [ set([name]) | set(b.alt_names) for 
         return osets
 
     def create_aliases_version(self):
-        import obiKEGG
+        from . import obiKEGG
         return obiKEGG.KEGGOrganism.organism_version(self.organism) + ".1"
 
     def filename(self):
 
     def _organism_name(self, organism):
         """ Returns internal GO organism name. Used to define file name. """
-        import obiGO
+        from . import obiGO
         return obiGO.organism_name_search(self.organism)
 
     def create_aliases(self):
-        import obiGO
+        from . import obiGO
         annotations = obiGO.Annotations(self.organism, genematcher=GMDirect())
         names = annotations.geneNamesDict
         return map(set, list(set([ \
         return "go_" + self._organism_name(self.organism)
 
     def create_aliases_version(self):
-        import obiGO
+        from . import obiGO
         return "v2." + obiGO.Annotations.organism_version(self.organism)
 
     def __init__(self, organism, ignore_case=True):
 class MatcherAliasesDictyBase(MatcherAliasesPickled):
 
     def create_aliases(self):
-        import obiDicty
+        from . import obiDicty
         db = obiDicty.DictyBase()
         #db.info, db.mappings
         infoa = [ set([id,name]) | set(aliases) for id,(name,aliases,_) in db.info.items() ]
         return joineda
 
     def create_aliases_version(self):
-        import obiDicty
+        from . import obiDicty
         return "v1." + obiDicty.DictyBase.version()
 
     def filename(self):
         return "v1"
     
     def create_aliases(self):
-        import obiBioMart
+        from . import obiBioMart
         if self.organism in self.BIOMART_CONF:
             dset_name, attrs = self.BIOMART_CONF[self.organism]
         else:
     #dobim z joinom prave stvari?
 
     import time
-    import obiGeneSets
+    from . import obiGeneSets
 
     def testsets():
         return obiGeneSets.collections([":kegg:hsa", ":go:hsa"])

Orange/bioinformatics/obiGeneAtlas.py

 
 """
 
-import os, sys
+from __future__ import absolute_import
+
+import os, shelve, sys
 from collections import defaultdict, namedtuple
+from contextlib import closing
 
+from Orange.orng import orngServerFiles
 from Orange.utils import serverfiles
 
+from . import obiGene
+
 GeneResults = namedtuple("GeneResults", "id name synonyms expressions")
 ExpressionResults = namedtuple("ExpressionResults", "ef efv up down experiments")
 ExperimentExpression = namedtuple("ExperimentExpression", "accession expression pvalue")
 AtlasExpressions = ExpressionResults
 AtlasExperiment = ExperimentExpression
 ##
-import shelve
-import orngServerFiles
-import obiGene
-from contextlib import closing
 
 def _cache(name="AtlasGeneResult.shelve"):
     """ Return a open cache instance (a shelve object).
                 sets[exp.ef, exp.efv].append(res.id)
 
     organism = "+".join(organism.lower().split())
-    from obiGeneSets import GeneSets, GeneSet
+    from .obiGeneSets import GeneSets, GeneSet
     
     def display_string(name):
         return name.capitalize().replace("_", " ")
     if name in dd:
         return dd[name]
     else:
-        import obiTaxonomy as tax
+        import .obiTaxonomy as tax
         ids = tax.to_taxid(name, mapTo=TAXID_TO_ORG.keys())
         if ids:
             return ids.pop()
 def ef_ontology():
     """ Return the `EF <http://www.ebi.ac.uk/efo/>`_ (Experimental Factor) ontology
     """
-    import obiOntology
-    import orngServerFiles
+    from . import obiOntology
+    from . import orngServerFiles
     # Should this be in the OBOFoundry (Ontology) domain
     try:
         file = open(orngServerFiles.localpath_download("ArrayExpress", "efo.obo"), "rb")

Orange/bioinformatics/obiGeneMania.py

     >>> net.save("graph.net")
     >>> net.retrieve(org="3702", genes=["CIP1"], m="bp", r=100).save("CIP1.net")
 
-    
+"""
 
-"""
+from __future__ import absolute_import
 
 import urllib2
 import urllib
         copyfileobj(stream, dst_obj, buffer=2**10, content_len=length,
                     progress=progress)
     
-import obiPPI
-import orngServerFiles
+from . import obiPPI
+from Orange.orng import orngServerFiles
 
-import obiTaxonomy
+from . import obiTaxonomy
 from collections import namedtuple
 from operator import itemgetter
 from Orange.utils import lru_cache

Orange/bioinformatics/obiGeneSetSig.py

-import Orange
-import obiGsea
-import Orange.utils
-import obiGeneSets
-import obiGene
+from __future__ import absolute_import
+
+import math
+from collections import defaultdict
+
+import scipy.stats
+
 import numpy
-from collections import defaultdict
-import stats
-from obiGsea import takeClasses
-from obiAssess import pca, PLSCall, corgs_activity_score
-import obiExpression
-import scipy.stats
-import math
-import statc
+
+import Orange, Orange.utils, statc
+
+from .obiGsea import takeClasses
+from .obiAssess import pca, PLSCall, corgs_activity_score
+from . import obiExpression, obiGene, obiGeneSets, obiGsea, stats
 
 class GeneSetTrans(object):
 

Orange/bioinformatics/obiGeneSets.py

 
 Maintainer: Marko Toplak
 """
-from __future__ import with_statement
 
-import obiKEGG, orange
-import os
-import obiGO
-import cPickle as pickle
-#import pickle
-import orngServerFiles
-import obiTaxonomy
-import tempfile
-import obiGeneSets
-import sys
+from __future__ import absolute_import, with_statement
+
+import cPickle as pickle, os, tempfile, sys
 from collections import defaultdict
 
+import orange
+from Orange.orng import orngServerFiles
+
+from . import obiGeneSets, obiGO, obiKEGG, obiTaxonomy
+
 sfdomain = "gene_sets"
 
 def nth(l,n):
     """
     Returns gene sets from KEGG pathways.
     """
-    import obiKEGG2 as obiKEGG
+    from . import obiKEGG2 as obiKEGG
     
     kegg = obiKEGG.KEGGOrganism(org)
 
     """
     Return gene sets from OMIM (Online Mendelian Inheritance in Man) diseses
     """
-    import obiOMIM
+    from . import obiOMIM
     genesets = [GeneSet(id=disease.id, name=disease.name, genes=obiOMIM.disease_genes(disease), hierarchy=("OMIM",), organism="9606",
                     link=("http://www.ncbi.nlm.nih.gov/entrez/dispomim.cgi?id=" % disease.id if disease.id else None)) \
                     for disease in obiOMIM.diseases()]
     """
     Return gene sets from miRNA targets
     """
-    import obimiRNA, obiKEGG
+    from . import obimiRNA, obiKEGG
     org_code = obiKEGG.from_taxid(org)
     link_fmt = "http://www.mirbase.org/cgi-bin/mirna_entry.pl?acc=%s"
     mirnas = [(id, obimiRNA.get_info(id)) for id in obimiRNA.ids(org_code)]
     return GeneSets(genesets)
 
 def go_miRNASets(org, ontology=None, enrichment=True, pval=0.05, treshold=0.04):
-    import obimiRNA, obiGO
+    from . import obimiRNA, obiGO
     mirnas = obimiRNA.ids(int(org))
     if ontology is None:
         ontology = obiGO.Ontology()
     
     go_sets = obimiRNA.filter_GO(go_sets, annotations, treshold=treshold)
     
-    import obiGeneSets as gs
+    from . import obiGeneSets as gs
     link_fmt = "http://amigo.geneontology.org/cgi-bin/amigo/term-details.cgi?term=%s"
     gsets = [gs.GeneSet(id=key, name=ontology[key].name, genes=value, hierarchy=("miRNA", "go_sets",),
                         organism=org, link=link_fmt % key) for key, value in go_sets.items()]
 def local_path():
     """ Returns local path for gene sets. Creates it if it does not exists
     yet. """
-    import orngEnviron
+    from Orange.orng import orngEnviron
     pth = os.path.join(orngEnviron.directoryNames["bufferDir"], "gene_sets_local")
     omakedirs(pth)
     return pth

Orange/bioinformatics/obiGenomicsUpdate.py

-from __future__ import with_statement
+from __future__ import absolute_import, with_statement
+
 import os
 import shelve
 import datetime
 import tarfile
 import pickle
-import orngServerFiles
 from UserDict import DictMixin
 
+from Orange.orng import orngServerFiles
+
 class UpdateShelve(DictMixin):
     def __init__(self, path):
         self.__shelve = shelve.open(path)
         self.shelve[callable, args] = date if date else datetime.now()
         self.shelve.sync()
 
-import orngServerFiles
+from Orange.orng import orngServerFiles
 
 class PKGUpdate(Update):
     def __init__(self, domain, wrappedUpdater, *args, **kwargs):
             raise AttributeError(name)
 
 def firstUpdateConsole():
-    import obiKEGG, obiGO, obiGenomicsUpdate
+    from . import obiKEGG, obiGO, obiGenomicsUpdate
 
     pkgUpdate = obiGenomicsUpdate.PKGUpdate("go", obiGO.Update())
 

Orange/bioinformatics/obiGsea.py

-import orange
-import numpy
+from __future__ import absolute_import
+
+from collections import defaultdict
 import random
 import time
-from obiExpression import *
-import obiGeneSets
-from collections import defaultdict
+
+import numpy
+
+import orange
+
+from . import obiGeneSets
+from .obiExpression import *
 
 """
 Gene set enrichment analysis.
 
     return zip(enrichmentScores, nEnrichmentScores, enrichmentPVals, fdrs)
 
-import obiGene
+from . import obiGene
 
 def nth(l,n): return [ a[n] for a in l ]
 

Orange/bioinformatics/obiHomoloGene.py

-import orngServerFiles
 import sys, os
 import urllib2
 
 from collections import defaultdict
 
+from Orange.orng import orngServerFiles
+
 class _homolog(object):
     __slots__ = ["group_id", "taxonomy_id", "gene_id", "gene_symbol"]
     def __init__(self, homolog_line):

Orange/bioinformatics/obiKEGG.py

     >>> genes = KEGGOrganism("human")
     >>> genes
 """
+
+from __future__ import absolute_import
+
 try:
     import Image, ImageDraw, ImageMath
 except:
 import os, sys, tarfile
 import re
 
-import obiData
-import obiProb
-import orngServerFiles
-
 from cPickle import load, loads, dump
 from collections import defaultdict
 
-
 import xml.dom.minidom as minidom
 
 from functools import partial, wraps
-import obiTaxonomy
-import orngEnviron
 import urllib2
 import cPickle
 
+from Orange.orng import orngEnviron, orngServerFiles
+
+from . import obiData, obiProb, obiTaxonomy
+
 DEFAULT_DATABASE_PATH = orngServerFiles.localpath("KEGG")
 KEGG_FTP_PATH = "ftp://ftp.genome.jp/pub/kegg/"
 
             download(src, dst)
     return wrapper
 
-from orngMisc import with_gc_disabled
-    
-            
+from Orange.orng.orngMisc import with_gc_disabled
+
 SLINE, MLINE, LINELIST = range(1, 4)
 
 class _field_mutators(object):
     def get_enriched_pathways(self, genes, reference=None, prob=obiProb.Binomial(), callback=None):
         """Return a dictionary with enriched pathways ids as keys and (list_of_genes, p_value, num_of_reference_genes) tuples as items."""
         allPathways = defaultdict(lambda :[[], 1.0, []])
-        import orngMisc
+        from Orange.orng import orngMisc
         milestones = orngMisc.progressBarMilestones(len(genes), 100)
         for i, gene in enumerate(genes):
             pathways = self.pathways([gene])
         
     def _get_genematcher(self):
         if getattr(self, "_genematcher", None) == None:
-            import obiGene
+            from . import obiGene
             if self.org_code == "ddi":
                 self._genematcher = obiGene.matcher([obiGene.GMKEGG(self.org_code), obiGene.GMDicty(),
                                                      [obiGene.GMKEGG(self.org_code), obiGene.GMDicty()]])
         if name not in genome:
             ids = genome.search(name)
             if not ids:
-                import obiTaxonomy
+                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
         xml_path = cls.directory_kgml(org, path=None).replace("%(path)s/", "")
         data = urllib2.urlopen("ftp://ftp.genome.jp/pub/kegg/" + png_path + org + ".list").read()
         pathways = sorted(set([line.split()[0][5:] for line in data.splitlines() if line]))
-        from obiData import FtpDownloader
+        from .obiData import FtpDownloader
         ftp = FtpDownloader("ftp.genome.jp", _join(), "pub/kegg/", numOfThreads=15)
         ftp.massRetrieve([png_path + pathway + ".png" for pathway in pathways])
             

Orange/bioinformatics/obiKEGG2/__init__.py

 DEFAULT_CACHE_DIR = conf.params["cache.path"]
 
 
-import obiProb
+from .. import obiProb
 from Orange.utils import deprecated_keywords, deprecated_attribute
 
 class Organism(object):
         
         """
         allPathways = defaultdict(lambda :[[], 1.0, []])
-        import orngMisc
+        from Orange.orng import orngMisc
         milestones = orngMisc.progressBarMilestones(len(genes), 100)
         pathways_db = KEGGPathways()
         
         if name not in genome:
             ids = genome.search(name)
             if not ids:
-                import obiTaxonomy
+                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
         
     def _get_genematcher(self):
         if getattr(self, "_genematcher", None) == None:
-            import obiGene
+            from .. import obiGene
             if self.org_code == "ddi":
                 self._genematcher = obiGene.matcher([obiGene.GMKEGG(self.org_code), obiGene.GMDicty(),
                                                      [obiGene.GMKEGG(self.org_code), obiGene.GMDicty()]])
 def create_gene_sets():
     pass
 
-import obiGene
+from .. import obiGene
 from Orange.utils import ConsoleProgressBar
 
 class MatcherAliasesKEGG(obiGene.MatcherAliasesPickled):

Orange/bioinformatics/obiMeSH.py

 """
 Module for browsing any analyzing sets annotated with MeSH ontology.
 """
-import orange
-import orngServerFiles
 
 from xml.sax import make_parser
 from xml.dom import minidom
 from sgmllib import SGMLParser
 import os.path
 
+import orange
+from Orange.orng import orngServerFiles
+
 FUZZYMETAID = -12
 
 class obiMeSH(object):

Orange/bioinformatics/obiOMIM.py

-import orngServerFiles
 import sys, os
 import urllib2
 import shutil
 
 from collections import defaultdict
 
+from Orange.orng import orngServerFiles
+
 class disease(object):
     """ A class representing a disease in the OMIM database
     """

Orange/bioinformatics/obiOntology.py

         """
         edge_types = self.edge_types()
         terms = self.terms()
-        import orngNetwork, orange
+        from Orange.orng import orngNetwork
+        import orange
         
         network = orngNetwork.Network(len(terms), True, len(edge_types))
         network.objects = dict([(term.id, i) for i, term in enumerate(terms)])
     print seinfeld.child_edges("001")
     
     doctest.testmod(extraglobs={"stanza": stanza, "term": term}, optionflags=doctest.ELLIPSIS)
-        
+        

Orange/bioinformatics/obiPPI.py

 This is python module for accessing PPI data.  
 """
 
-import os, sys
-import xml.dom.minidom as minidom
-import warnings
-import collections
+from __future__ import absolute_import
 
-import orngServerFiles
-
-from obiKEGG import downloader
-
+import collections, gzip, posixpath, os, shutil, sqlite3, sys, urllib2, warnings, xml.dom.minidom as minidom
 from collections import defaultdict
 from operator import itemgetter
 
-import obiTaxonomy
-from obiTaxonomy import pickled_cache
+from Orange.orng import orngServerFiles
+from Orange.utils import ConsoleProgressBar, lru_cache
 
-from Orange.utils import lru_cache
-from Orange.utils import ConsoleProgressBar
-
-import sqlite3
-import urllib2
-import posixpath
-import shutil
-import gzip
+from . import obiTaxonomy
+from .obiKEGG import downloader
+from .obiTaxonomy import pickled_cache
 
 class PPIDatabase(object):
     """ A general interface for protein-protein interaction database access.
 from collections import namedtuple
 from functools import partial
 
-from obiGeneMania import wget, copyfileobj
+from .obiGeneMania import wget, copyfileobj
 
 def chainiter(iterable):
     for sub_iter in iterable:

Orange/bioinformatics/obiTaxonomy.py

-import urllib2
-import os, sys, shutil
-import cPickle
-import tarfile
-import StringIO
-import obiGenomicsUpdate
-import obiData
-import orngEnviron
-import orngServerFiles
+from __future__ import absolute_import, division
 
-from urllib2 import urlopen
 from collections import defaultdict
+import cPickle, os, shutil, sys, StringIO, tarfile, urllib2
+
+from Orange.orng import orngEnviron, orngServerFiles
+
+from . import obiData, obiGenomicsUpdate
 
 # list of common organisms from http://www.ncbi.nlm.nih.gov/Taxonomy
 def common_taxids():
         except Exception, ex:
             pass
         try:
-            import orngServerFiles as sf
+            from . import orngServerFiles as sf
             sf.download("Taxonomy", "ncbi_taxonomy.tar.gz")
             self._text = TextDB(os.path.join(default_database_path, "ncbi_taxonomy.tar.gz", "ncbi_taxonomy.db"))
             self._info = TextDB(os.path.join(default_database_path, "ncbi_taxonomy.tar.gz", "ncbi_taxonomy_inf.db"))
     def ParseTaxdumpFile(file=None, outputdir=None, callback=None):
         from cStringIO import StringIO
         if file == None:
-            file = tarfile.open(None, "r:gz", StringIO(urlopen("ftp://ftp.ncbi.nih.gov/pub/taxonomy/taxdump.tar.gz").read()))
+            file = tarfile.open(None, "r:gz", StringIO(urllib2.urlopen("ftp://ftp.ncbi.nih.gov/pub/taxonomy/taxdump.tar.gz").read()))
         if type(file) == str:
             file = tarfile.open(file)
         names = file.extractfile("names.dmp").readlines()
 def to_taxid(code, mapTo=None):
     """ See if the code is a valid code in any database and return a set of its taxids.
     """
-    import obiKEGG, obiGO
+    from . import obiKEGG, obiGO
     results = set()
     for test in [obiKEGG.to_taxid, obiGO.to_taxid]:
         try:
 def taxids():
     return Taxonomy().taxids()
 
-import obiGenomicsUpdate
+from . import obiGenomicsUpdate
 
 class Update(obiGenomicsUpdate.Update):
     def GetDownloadable(self):
     
     def IsUpdatable(self, func, args):
         from datetime import datetime
-        import obiData
+        from . import obiData
         if func == Update.UpdateTaxonomy:
 ##            stream = urllib2.urlopen("ftp://ftp.ncbi.nih.gov/pub/taxonomy/taxdump.tar.gz")
 ##            date = datetime.strptime(stream.headers.get("Last-Modified"), "%a, %d %b %Y %H:%M:%S %Z")

Orange/bioinformatics/obimiRNA.py

-from __future__ import division
-import urllib
-import re
-#import pylab
-import random
-import os
-import math
-#import locale
-import statc
-#import numpy as np
-import math
-
-import obiTaxonomy
-import obiGO as go
-import obiProb as op
-import orngServerFiles as osf
-import obiGene as ge
-import obiKEGG as kg
+from __future__ import absolute_import, division
 
 from collections import defaultdict
+import math, os, random, re, urllib
 
+from Orange.orng import orngServerFiles as osf
+import statc
+
+from . import obiGene as ge, obiGO as go, obiKEGG as kg, obiProb as op, obiTaxonomy
 
 mirnafile = osf.localpath_download('miRNA','miRNA.txt')
 premirnafile = osf.localpath_download('miRNA','premiRNA.txt')
     in the other case it returns a dictionary with GO IDs as keys and miRNAs as values.
     """
     
-    import obiGene
+    from . import obiGene
     genematcher = obiGene.matcher([obiGene.GMGO(annotations.taxid)] + \
         ([obiGene.GMDicty()] if annotations.taxid == "352472"  else []))
     genematcher.set_targets(annotations.geneNames)

Orange/bioinformatics/pstat.py

 ##
 ## 11/08/98 ... fixed aput to output large arrays correctly
 
-import stats  # required 3rd party module
+from __future__ import absolute_import
+
 import string, copy
 from types import *
 

Orange/bioinformatics/stats.py

 ##              changed name of skewness and askewness to skew and askew
 ##              fixed (a)histogram (which sometimes counted points <lowerlimit)
 
-import pstat               # required 3rd party module
+from __future__ import absolute_import
+
 import math, string, copy  # required python modules
 from types import *
 
+from . import pstat               # required 3rd party module
+
 __version__ = 0.5
 
 ############# DISPATCH CODE ##############

Orange/bioinformatics/widgets/Anova.py

 ## Automatically adapted for numpy.oldnumeric Oct 03, 2007 by 
 
+from __future__ import absolute_import
+
 import math
+
 import numpy.oldnumeric as Numeric, numpy.oldnumeric.ma as MA
 import numpy.oldnumeric.linear_algebra as LinearAlgebra
+
 import scipy.stats
-import numpyExtn
 
+from . import numpyExtn
 
 #######################################################################################
 ## ANOVA based on Multivariate Linear Regression
 #######################################################################################
 
-
 class AnovaLRBase:
     """Base class for all ANOVA types based on multivariate linear regression: manipulation with dummy variables.
     """

Orange/bioinformatics/widgets/OWBioMart.py

 <icon>icons/BioMart.png</icon>
 """
 
-from OWWidget import *
-import obiBioMart
-
-from obiBioMart import *
+from __future__ import absolute_import
 
 import sys, os
 import traceback
 import warnings
-
 import socket
-socket.setdefaulttimeout(60)
-
 from collections import defaultdict
 import itertools
-    
-import OWConcurrent
 
+from Orange.OrangeWidgets import OWConcurrent
+from Orange.OrangeWidgets.OWWidget import *
+
+from .. import obiBioMart
+from ..obiBioMart import *
+
+socket.setdefaulttimeout(60)
                 
 def is_hidden(tree):
     return getattr(tree, "hidden", "false") != "false" or getattr(tree, "hideDisplay", "false") != "false"
 
-
 class Control(object):
     """ Base mixin class for query GUI widgets 
     """

Orange/bioinformatics/widgets/OWDicty.py

 <priority>40</priority>
 """
 
-from OWWidget import *
-import obiDicty
-import OWGUI
-import orngEnviron
+from __future__ import absolute_import
+
+from collections import defaultdict
 import sys
 
-from collections import defaultdict
+from Orange.orng import orngEnviron
+from Orange.OrangeWidgets import OWGUI
+from Orange.OrangeWidgets.OWWidget import *
 
+from .. import obiDicty
 
 class MyTreeWidgetItem(QTreeWidgetItem):
     def __contains__(self, text):
 #        table.taxid = "352472"
 #        table.genesinrows = False
         
-        from orngDataCaching import data_hints
+        from Orange.orng.orngDataCaching import data_hints
         data_hints.set_hint(table, "taxid", "352472", 10.0)
         data_hints.set_hint(table, "genesinrows", False, 10.0)
         

Orange/bioinformatics/widgets/OWDisplayProfiles.py

 <priority>1030</priority>
 """
 
-from OWTools import *
-from OWWidget import *
-from OWGraph import *
-from OWToolbars import ZoomSelectToolbar
-import OWGUI
-
-from OWGraph import ColorPaletteGenerator
-
+from Orange.OrangeWidgets.OWGUI
+from Orange.OrangeWidgets.OWGraph import *
+from Orange.OrangeWidgets.OWToolbars import ZoomSelectToolbar
+from Orange.OrangeWidgets.OWTools import *
+from Orange.OrangeWidgets.OWWidget import *
 import statc
 
 ## format of data:

Orange/bioinformatics/widgets/OWFeatureSelection.py

 <icon>icons/FeatureSelection.png</icon>
 """
 
-from __future__ import with_statement
-import orange
+from __future__ import absolute_import, with_statement
 
-from obiExpression import *
-from obiDifscale import ExpressionSignificance_AREA, ExpressionSignificance_FCts
-
-from OWGraph import *
-from OWGraphTools import PolygonCurve
-from OWWidget import *
-from OWHist import OWInteractiveHist
-from OWToolbars import ZoomSelectToolbar
-
-from obiGEO import transpose
 from collections import defaultdict
 from functools import wraps
 from operator import add
+
 import numpy as np
 import numpy.ma as ma
 
-import OWGUI
-        
+import orange
+from Orange.OrangeWidgets import OWGUI
+from Orange.OrangeWidgets.OWGraph import *
+from Orange.OrangeWidgets.OWGraphTools import PolygonCurve
+from Orange.OrangeWidgets.OWHist import OWInteractiveHist
+from Orange.OrangeWidgets.OWToolbars import ZoomSelectToolbar
+from Orange.OrangeWidgets.OWWidget import *
+
+from ..obiDifscale import ExpressionSignificance_AREA, ExpressionSignificance_FCts
+from ..obiExpression import *
+from ..obiGEO import transpose
+
 class ExpressionSignificance_TTest_PValue(ExpressionSignificance_TTest):
     def __call__(self, *args, **kwargs):
         return [(key, pval) for key, (t, pval) in \
             self.controlArea.setDisabled(False)
     return f
 
-from orngDataCaching import data_hints
-from OWGenotypeDistances import SetContextHandler
-from OWVulcanoPlot import LabelSelectionWidget
+from Orange.orng.orngDataCaching import data_hints
+from .OWGenotypeDistances import SetContextHandler
+from .OWVulcanoPlot import LabelSelectionWidget
 
 class OWFeatureSelection(OWWidget):
     settingsList = ["method_index", "dataLabelIndex", "compute_null",

Orange/bioinformatics/widgets/OWGEODatasets.py

 <icon>icons/GEODataSets.png</icon>
 """
 
-from __future__ import with_statement
-
-import sys, os, glob
-from OWWidget import *
-import OWGUI, OWGUIEx
-import obiGEO
-import orngServerFiles
-
-from orngDataCaching import data_hints
+from __future__ import absolute_import, with_statement
 
 from collections import defaultdict
 from functools import partial 
+import sys, os, glob
+
+from Orange.orng import orngServerFiles
+from Orange.orng.orngDataCaching import data_hints
+from Orange.OrangeWidgets import OWGUI, OWGUIEx
+from Orange.OrangeWidgets.OWWidget import *
+
+from .. import obiGEO
 
 LOCAL_GDS_COLOR = Qt.darkGreen
 
                 pass
         return QSortFilterProxyModel.lessThan(self, left, right)
     
-from OWGUI import LinkStyledItemDelegate, LinkRole
+from Orange.OrangeWidgets.OWGUI import LinkStyledItemDelegate, LinkRole
 
 def childiter(item):
     """ Iterate over the children of an QTreeWidgetItem instance.

Orange/bioinformatics/widgets/OWGOEnrichmentAnalysis.py

 <priority>2020</priority>
 """
 
-from __future__ import with_statement
+from __future__ import absolute_import, with_statement
 
-import obiGO
-import obiProb
-import obiTaxonomy
-import obiGene
-import sys, os, tarfile, math
-import gc
-import OWGUI
-import orngServerFiles
-
-from os.path import join as p_join
-from OWWidget import *
 from collections import defaultdict
 from functools import partial
+import gc
+import sys, os, tarfile, math
+from os.path import join as p_join
 
-from orngDataCaching import data_hints
+from Orange.orng import orngServerFiles
+from Orange.orng.orngDataCaching import data_hints
+from Orange.OrangeWidgets import OWGUI
+from Orange.OrangeWidgets.OWWidget import *
+
+from .. import obiGene, obiGO, obiProb, obiTaxonomy
 
 dataDir = orngServerFiles.localpath("GO")
 
         gc.enable()
 
 def getOrgFileName(org):
-    import orngServerFiles
+    from Orange.orng import orngServerFiles
     files = orngServerFiles.listfiles("go")
     return [f for f in files if org in f].pop()
 
             self.SetGraph(graph)
 
     def UpdateGOAndAnnotation(self, tags=[]):
-        from OWUpdateGenomicsDatabases import OWUpdateGenomicsDatabases
+        from .OWUpdateGenomicsDatabases import OWUpdateGenomicsDatabases
         w = OWUpdateGenomicsDatabases(parent = self, searchString=" ".join(tags))
         w.setModal(True)
         w.show()

Orange/bioinformatics/widgets/OWGeneInfo.py

 <contact>Ales Erjavec (ales.erjavec(@at@)fri.uni-lj.si)</contact>
 <icon>icons/GeneInfo.png</icon>
 """
-from __future__ import with_statement
 
-import obiGene, obiTaxonomy
-import orange
-import orngServerFiles
-
-from OWWidget import *
-import OWGUI
-
-from orngDataCaching import data_hints
+from __future__ import absolute_import, with_statement
 
 from collections import defaultdict
 from functools import partial
 
+import orange
+from Orange.orng import orngServerFiles
+from Orange.orng.orngDataCaching import data_hints
+from Orange.OrangeWidgets import OWGUI
+from Orange.OrangeWidgets.OWWidget import *
+
+from .. import obiGene, obiTaxonomy
+
 class TreeModel(QAbstractItemModel):
     def __init__(self, data, header, parent):
         QAbstractItemModel.__init__(self, parent)
             return QVariant(self._header[section])
         return QVariant()
 
-from OWGUI import LinkStyledItemDelegate, LinkRole
+from Orange.OrangeWidgets.OWGUI import LinkStyledItemDelegate, LinkRole
 
 def lru_cache(maxsize=100):
     """ A least recently used cache function decorator.
     return schema, ret
     
 def dicty_info(taxid, genes):
-    import obiDicty 
+    from .. import obiDicty 
     info = obiDicty.DictyBase()
     name_matcher = obiGene.GMDicty()
     name_matcher.set_targets(info.info.keys())
         self.treeWidget.selectionModel().select(itemSelection, QItemSelectionModel.Select | QItemSelectionModel.Rows)
         
     def sendReport(self):
-        import OWReport
+        from Orange.OrangeWidgets import OWReport
         genes, matched = self.matchedInfo
         info, org = self.currentLoaded
         self.reportRaw("<p>Input: %i genes of which %i (%.1f%%) matched NCBI synonyms<br>Organism: %s<br>Filter: %s</p>" % (genes, matched, 100.0 * matched / genes, obiTaxonomy.name(org), self.searchString))

Orange/bioinformatics/widgets/OWGeneMania.py

 <icon>icons/GeneMANIA.png</icon>
 """
 
-from OWWidget import *
-import OWGUI
-import obiGeneMania
-import Orange
+from __future__ import absolute_import
 
 import os, sys
 import multiprocessing
 import random
 
+import Orange
+from Orange.OrangeWidgets import OWGUI
+from Orange.OrangeWidgets.OWWidget import *
+
+from .. import obiGeneMania
+
 class BarItemDelegate(QStyledItemDelegate):
     BarRole = OWGUI.OrangeUserRole.next() 
     BarForegroundRole = OWGUI.OrangeUserRole.next()

Orange/bioinformatics/widgets/OWGenotypeDistances.py

 <contact>Ales Erjavec (ales.erjavec(@at@).fri.uni-lj.si)</contact>
 """
 
-from OWWidget import *
-import OWGUI
-from OWItemModels import PyListModel
-import Orange
+from __future__ import absolute_import
 
 from collections import defaultdict
 from operator import add
-import numpy
 import math
 
-from obiExperiments import separate_by, data_type, linearize, dist_pcorr, dist_eucl, dist_spearman
+import numpy
+
+import Orange
+from Orange.OrangeWidgets import OWGUI
+from Orange.OrangeWidgets.OWItemModels import PyListModel
+from Orange.OrangeWidgets.OWWidget import *
+
+from ..obiExperiments import separate_by, data_type, linearize, dist_pcorr, dist_eucl, dist_spearman
 
 def clone_attr(attr):
     newattr = attr.clone()

Orange/bioinformatics/widgets/OWGsea.py

 <priority>2025</priority>
 <icon>icons/GSEA.png</icon>
 """
-from __future__ import with_statement
 
-from OWWidget import *
-import OWGUI
-import obiGsea
-import obiGeneSets
+from __future__ import absolute_import, with_statement
+
 from exceptions import Exception
 import cPickle as pickle
 from collections import defaultdict
-import obiKEGG
-import orngServerFiles
-import obiGene
 
-from orngDataCaching import data_hints
+from Orange.orng import orngServerFiles
+from Orange.orng.orngDataCaching import data_hints
+from Orange.OrangeWidgets import OWGUI
+from Orange.OrangeWidgets.OWWidget import *
+
+from .. import obiGene, obiGeneSets, obiGsea, obiKEGG
 
 def nth(l, n):
     return [ a[n] for a in l ]

Orange/bioinformatics/widgets/OWHeatMap.py

 <priority>1040</priority>
 """
 
-import orange, math
-import orangene
-import OWGUI
-from OWWidget import *
-from OWDlgs import OWChooseImageSizeDlg
-from ColorPalette import signedPalette
-from OWClustering import HierarchicalClusterItem, DendrogramWidget, DendrogramItem
-import OWColorPalette
+from __future__ import absolute_import
 
 from collections import defaultdict
 import itertools
-import orngClustering
+import math
+
+import orange
+import orangene
+from Orange.orng import orngClustering
+from Orange.OrangeWidgets import OWColorPalette
+from Orange.OrangeWidgets import OWGUI
+from Orange.OrangeWidgets.ColorPalette import signedPalette
+from Orange.OrangeWidgets.OWClustering import HierarchicalClusterItem, DendrogramWidget, DendrogramItem
+from Orange.OrangeWidgets.OWDlgs import OWChooseImageSizeDlg
+from Orange.OrangeWidgets.OWWidget import *
 
 DEBUG = False
 
         context.checksum = examples.checksum()
         return context, isNew
     
-from OWGenotypeDistances import SetContextHandler
+from .OWGenotypeDistances import SetContextHandler
 
 class OWHeatMap(OWWidget):
     contextHandlers = {"": DomainContextHandler("", ["CellWidth", "CellHeight"]),

Orange/bioinformatics/widgets/OWKEGGPathwayBrowser.py

 <priority>2030</priority>
 <icon>icons/KEGG.png</icon>
 """
-from __future__ import with_statement 
+
+from __future__ import absolute_import, with_statement 
 
 import sys
-import orange
-import obiKEGG, orngServerFiles
-import obiTaxonomy
-
-import obiKEGG2 as obiKEGG
-import obiGeneSets
-import orngMisc
-
+from collections import defaultdict
 import webbrowser
 
-from OWWidget import *
-import OWGUI
-from collections import defaultdict
+import orange
+from Orange.orng import orngMisc
+from Orange.orng.orngDataCaching import data_hints
+from Orange.OrangeWidgets import OWGUI
+from Orange.OrangeWidgets.OWWidget import *
 
-from orngDataCaching import data_hints
+from .. import obiKEGG, orngServerFiles
+from .. import obiTaxonomy
+from .. import obiKEGG2 as obiKEGG
+from .. import obiGeneSets
 
 USE_THREADING = True
 
             self.send("Unselected Examples", None)
         
     def ClearCache(self):
-        from obiKEGG2 import caching
+        from ..obiKEGG2 import caching
         try:
             caching.clear_cache()
         except Exception, ex:
             self.pathwayView.viewport().update()
             
     def saveGraph(self):
-        from OWDlgs import OWChooseImageSizeDlg
+        from Orange.OrangeWidgets.OWDlgs import OWChooseImageSizeDlg
         sizeDlg = OWChooseImageSizeDlg(self.pathwayView.scene(), parent=self)
         sizeDlg.exec_()
 
     def UpdateToLatestPathways(self):
         pass        
           
-import obiProb
+from .. import obiProb
 
 def pathway_enrichment(genesets, genes, reference, prob=None, callback=None):
     result_sets = []

Orange/bioinformatics/widgets/OWMAPlot.py

 <icon>icons/Normalize.png</icons>
 """
 
-from OWWidget import *
-from OWGraph import *
-import OWGUI
-import numpy
-
-import obiExpression
-        
-import OWConcurrent
+from __future__ import absolute_import
 
 from functools import partial
 
+import numpy
+        
+from Orange.OrangeWidgets import OWConcurrent
+from Orange.OrangeWidgets import OWGUI
+from Orange.OrangeWidgets.OWWidget import *
+from Orange.OrangeWidgets.OWGraph import *
+
+from .. import obiExpression
+
 class ProgressBarDiscard(QObject):
     def __init__(self, parent, redirect):
         QObject.__init__(self, parent)
         
         
     def saveGraph(self):
-        from OWDlgs import OWChooseImageSizeDlg
+        from Orange.OrangeWidgets.OWDlgs import OWChooseImageSizeDlg
         dlg = OWChooseImageSizeDlg(self.graph, parent=self)
         dlg.exec_()
         
     w.show()
     app.exec_()
         
-        
+        

Orange/bioinformatics/widgets/OWMeSHBrowser.py

 <priority>2040</priority>
 """
 
-from OWWidget import *
+from __future__ import absolute_import
+
 from PyQt4.QtCore import *
 from PyQt4.QtGui import *
-from obiMeSH import *
-import OWGUI
+
+from Orange.OrangeWidgets import OWGUI
+from Orange.OrangeWidgets.OWWidget import *
+
+from ..obiMeSH import *
 
 class MyQTableWidgetItem(QTableWidgetItem):
 	""" Our implementation of QTable item allowing numerical sorting.  """

Orange/bioinformatics/widgets/OWMoleculeVisualizer.py

 <priority>2050</priority>
 """
 
-from __future__ import with_statement
+from __future__ import absolute_import, with_statement
+
+import sys, os, urllib2, urllib
+import warnings
+import shelve
+from cStringIO import StringIO
+import pickle
+
+from PyQt4.QtSvg import *
 
 import orange
-from OWWidget import *
-from PyQt4.QtSvg import *
+from Orange.orng import orngEnviron
+from Orange.OrangeWidgets import OWGUI
+from Orange.OrangeWidgets.OWWidget import *
 
-import OWGUI
-import sys, os, urllib2, urllib
-import warnings
-
-import shelve
-from cStringIO import StringIO
-
-import pickle
-import obiChem
-import orngEnviron
+from .. import obiChem
 
 class dummy_module(object):
 	def __init__(self, name):

Orange/bioinformatics/widgets/OWPIPA.py

 <priority>30</priority>
 """
 
-from OWWidget import *
-import obiDicty
-import OWGUI
-import orngEnviron
+from __future__ import absolute_import
+
 import sys, os
 from collections import defaultdict
 import math
 
+from Orange.orng import orngEnviron
+from Orange.OrangeWidgets import OWGUI
+from Orange.OrangeWidgets.OWWidget import *
+
+from .. import obiDicty
 
 #def pyqtConfigure(object, **kwargs):
 #    if hasattr(object, "pyqtConfigure"):
             domain.addmetas(table.domain.getmetas())
             table = orange.ExampleTable(domain, table)
             
-            from orngDataCaching import data_hints
+            from Orange.orng.orngDataCaching import data_hints
             data_hints.set_hint(table, "taxid", "352472") 
             data_hints.set_hint(table, "genesinrows", False)
             

Orange/bioinformatics/widgets/OWQualityControl.py

 
 """
 
+from __future__ import absolute_import, with_statement
+
 import sys
-
-import Orange
-
-from OWWidget import *
-from OWItemModels import PyListModel, safe_text
-from OWGraphics import GraphicsSimpleTextLayoutItem
-import OWGUI
-
-from OWGenotypeDistances import SetContextHandler
-
-import obiExperiments as exp
-import numpy
-
 from collections import defaultdict
 from contextlib import contextmanager
 from pprint import pprint
 
+import numpy
+
+import Orange
+from Orange.OrangeWidgets import OWGUI
+from Orange.OrangeWidgets.OWWidget import *
+from Orange.OrangeWidgets.OWItemModels import PyListModel, safe_text
+from Orange.OrangeWidgets.OWGraphics import GraphicsSimpleTextLayoutItem
+
+from .. import obiExperiments as exp
+
+from .OWGenotypeDistances import SetContextHandler
+
 DEBUG = False
 
-
 @contextmanager
 def widget_disable(widget):
     """A context to disable the widget (enabled property)  
         self.on_view_resize(self.scene_view.size())
         
     def save_graph(self):
-        from OWDlgs import OWChooseImageSizeDlg
+        from Orange.OrangeWidgets.OWDlgs import OWChooseImageSizeDlg
         dlg = OWChooseImageSizeDlg(self.scene, parent=self)
         dlg.exec_()
 

Orange/bioinformatics/widgets/OWSetEnrichment.py

 """<name>Gene Set Enrichment</name>
 """
-from __future__ import with_statement
 
-from OWWidget import *
-
-import obiGeneSets
-import obiGene
-import obiTaxonomy
-import obiProb
-import OWGUI
+from __future__ import absolute_import, with_statement
 
 import math
-import orngServerFiles
-import orngEnviron
-
-from orngDataCaching import data_hints
-
 from collections import defaultdict
 
-from OWGUI import LinkStyledItemDelegate, LinkRole
</