* fluent: General cleanup.

This commit is contained in:
2006-04-19 19:59:55 +00:00
parent 4541716f90
commit f45c9c6bf7
4 changed files with 42 additions and 26 deletions

View File

@@ -2,6 +2,9 @@ import gtk
import logger
from annotations import Annotations
from workflow import *
import geneontology
import gostat
from scipy import array
class EinarsWorkflow (Workflow):
@@ -19,7 +22,7 @@ class EinarsWorkflow (Workflow):
go = Stage('go', 'Gene Ontology Data')
go.add_function(LoadAnnotationsFunction())
go.add_function(Function('godist', 'GO Distances'))
go.add_function(GODistanceFunction())
self.add_stage(go)
regression = Stage('regression', 'Regression')
@@ -37,6 +40,7 @@ class LoadAnnotationsFunction(Function):
def load_file(self, filename):
f = open(filename)
self.annotations = Annotations('genes', 'go-terms')
logger.log('notice', 'Loading annotation file: %s' % filename)
for line in f.readlines():
val = line.split(' \t')
@@ -61,3 +65,21 @@ class LoadAnnotationsFunction(Function):
dialog.destroy()
return [self.annotations]
class GODistanceFunction(Function):
def __init__(self):
Function.__init__(self, 'go_diatance', 'GO Distances')
self.output = None
def run(self, data):
logger.log('debug', 'datatype: %s' % type(data))
if not type(data) == Annotations:
return None
logger.log('debug', 'dimensions: %s' % data.dimensions)
genes = data.get_ids('genes')
gene_distances = array((len(genes), len(genes)))
return gene_distances