Commits

Marko Toplak committed 56076de Merge

Trivial merge.

Comments (0)

Files changed (3)

 import os
 import ConfigParser
 from StringIO import StringIO
-
+from Orange.misc import serverfiles
+kegg_dir = serverfiles.localpath("KEGG2")
 
 default = """
 [cache]
-path = %(home)s/.obiKEGG/
+# path = %(home)s/.obiKEGG/
+path = %(kegg_dir)s/
 store = sqlite3
 kegg_invalidate = always
 
 
 """
 
-#_defaults_env = dict(default)
-#_defaults_env.update(dict(os.environ))
+# Orange kegg files dir
+env = dict(os.environ)
+env["kegg_dir"] = kegg_dir
 
-parser = ConfigParser.ConfigParser(dict(os.environ))#_defaults_env)
-# TODO: global settings
+parser = ConfigParser.ConfigParser(env)
+
 
 parser.readfp(StringIO(default), "default")
 
+# TODO: global settings rc file
 parser.read([os.path.expanduser("~/.obiKEGG/rc.cfg")])
 
 params = {}

widgets/OWKEGGPathwayBrowser.py

         
         
     def UpdateOrganismComboBox(self):
+        # First try to import suds
+        try:
+            import suds
+        except ImportError:
+            QMessageBox.warning(self,
+                "'suds' library required.",
+                '<p>Please install \
+<a href="http://pypi.python.org/pypi/suds">suds</a> library \
+to use KEGG Pathways widget.</p>'
+                )
+            
         try:
             genome = obiKEGG.KEGGGenome()
             all_codes = list(genome)
             result = {}
             def call(pathway_id):
                 result["pathway"] = p = obiKEGG.KEGGPathway(pathway_id)
-                p.title # makes sure the kgml file is downloaded
-                p.image
-                p.get_image() # makes sure the image is downloaded
+                p._get_kgml() # makes sure the kgml file is downloaded
+                p._get_image_filename() # makes sure the image is downloaded
                 
             self.setEnabled(False)
             try:

widgets/OWQualityControl.py

         self.scene = QGraphicsScene()
         self.scene_view = QualityGraphicsView(self.scene)
         self.scene_view.setRenderHints(QPainter.Antialiasing)
+        self.scene_view.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
         self.mainArea.layout().addWidget(self.scene_view)
         
         self.connect(self.scene_view,
         with disable_updates(self):
             self.split_by_model[:] = []
             self.sort_by_model[:] = []
-
+        
+        self.main_widget = None
         self.scene.clear()
         self.info_box.setText("\n")
         self._cached_distances = {}
     def on_distance_measure_changed(self):
         """Distance measure has changed
         """
-        with widget_disable(self):
-            self.update_distances()
-            self.replot_experiments()
+        if self.data is not None:
+            with widget_disable(self):
+                self.update_distances()
+                self.replot_experiments()
         
     def on_view_resize(self, size):
         """The view with the quality plot has changed
         """
         if self.main_widget:
             current = self.main_widget.size()
-            self.main_widget.resize(size.width() - 2, 
+            self.main_widget.resize(size.width() - 6, 
                                     current.height())
             
             self.scene.setSceneRect(self.scene.itemsBoundingRect())
         self.unique_pos = sorted(self.unique_pos.items(),
                                  key=lambda t: map(float_if_posible, t[0]))
         
-#        pprint(self.groups)
-#        pprint(self.unique_pos)
         
         if self.groups:
             if sort_labels:
                             tooltip = experiment_description(attr)
                             rug_item.setToolTip(tooltip)
                             rug_item.group_index = indices.index(i)
+                            rug_item.setZValue(rug_item.zValue() + 1)
                         else:
                             rug_item = ClickableRugItem(dist_vec[i] / max_dist,
                                            0.85, self.on_rug_item_clicked)