Anonymous avatar Anonymous committed 29559ea

no message

Comments (0)

Files changed (1)

OWGOTermFinder.py

         self.GO = None
 
         # received by signals
-        self.geneNameAttr = 'GeneName'
+        self.geneNameAttr = 'DDB' # name of attribute from where to take the gene ID or name
         # should read from 'GeneName' column in input signal "Examples"
         self.clusterGenes = [] ## ['YPD1', 'WHI4', 'SHS1', 'GCS1', 'HO', 'YDL228C', 'SSB1', 'PTP1', 'BRE4', 'OST4', 'YDL233W', 'GYP7']
         self.clusterData = None
         self.clusterGenes = []
         self.clusterData = data
         if data:
-            dattrs = [str(a.name) for a in data.domain.attributes]
+            dattrs = [str(a.name) for a in data.domain.attributes + data.domain.getmetas().values()]
+            print self.geneNameAttr in dattrs, dattrs
             if self.geneNameAttr in dattrs:
                 for e in data:
-                    g = str(e[self.geneNameAttr].value)
+                    g = str(e[self.geneNameAttr])
                     if g not in self.clusterGenes:
                         self.clusterGenes.append( g)
+            print len(self.clusterGenes), self.clusterGenes[:10]
         self.findTermsBuildDAG()
 
     def referenceDataset(self, data, id):
         self.referenceGenes = []
         if data:
-            dattrs = [str(a.name) for a in data.domain.attributes]
+            dattrs = [str(a.name) for a in data.domain.attributes + data.domain.getmetas().values()]
             if self.geneNameAttr in dattrs:
                 for e in data:
-                    g = str(e[self.geneNameAttr].value)
+                    g = str(e[self.geneNameAttr])
                     if g not in self.referenceGenes:
                         self.referenceGenes.append( g)
         self.findTermsBuildDAG()
     ow = OWGOTermFinder()
     a.setMainWidget(ow)
 
-    d = orange.ExampleTable('testClusterSet.tab')
+    d = orange.ExampleTable('testClusterSet.tab', dontCheckStored=1)
+    d = orange.ExampleTable('hjSmall.tab', dontCheckStored=1)
     ow.clusterDataset(d, 0)
     ow.show()
     a.exec_loop()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.