Multiselection included. (Without input validation).
This commit is contained in:
@@ -73,6 +73,8 @@ class DatasetSaveFunction(workflow.Function):
|
||||
if not data:
|
||||
logger.log("notice", "No data to save.")
|
||||
return
|
||||
else:
|
||||
data = data[0]
|
||||
|
||||
chooser = gtk.FileChooserDialog(title="Save pickled data...", parent=None,
|
||||
action=gtk.FILE_CHOOSER_ACTION_SAVE,
|
||||
@@ -101,7 +103,7 @@ class CelFileImportFunction(workflow.Function):
|
||||
def __init__(self):
|
||||
workflow.Function.__init__(self, 'cel_import', 'Import Affy')
|
||||
|
||||
def run(self, data):
|
||||
def run(self, (data,)):
|
||||
import rpy
|
||||
chooser = gtk.FileChooserDialog(title="Select cel files...", parent=None,
|
||||
action=gtk.FILE_CHOOSER_ACTION_OPEN,
|
||||
@@ -150,7 +152,7 @@ class PCAFunction(workflow.Function):
|
||||
workflow.Function.__init__(self, 'pca', 'PCA')
|
||||
self._workflow = wf
|
||||
|
||||
def run(self, data):
|
||||
def run(self, (data,)):
|
||||
import rpy
|
||||
|
||||
dim_2, dim_1 = data.get_dim_names()
|
||||
|
@@ -81,7 +81,7 @@ class GODistanceFunction(workflow.Function):
|
||||
workflow.Function.__init__(self, 'go_diatance', 'GO Distances')
|
||||
self.output = None
|
||||
|
||||
def run(self, data):
|
||||
def run(self, (data,)):
|
||||
logger.log('debug', 'datatype: %s' % type(data))
|
||||
if not type(data) == Annotations:
|
||||
return None
|
||||
@@ -108,7 +108,7 @@ class DatasetLog(workflow.Function):
|
||||
def __init__(self):
|
||||
workflow.Function.__init__(self, 'log', 'Log')
|
||||
|
||||
def run(self, data):
|
||||
def run(self, (data,)):
|
||||
logger.log('notice', 'Taking the log of dataset %s' % data.get_name())
|
||||
d = data.asarray()
|
||||
d = log(d)
|
||||
@@ -151,7 +151,8 @@ class DatasetSaveFunction(workflow.Function):
|
||||
if not data:
|
||||
logger.log("notice", "No data to save.")
|
||||
return
|
||||
|
||||
else:
|
||||
data = data[0]
|
||||
chooser = gtk.FileChooserDialog(title="Save pickled data...", parent=None,
|
||||
action=gtk.FILE_CHOOSER_ACTION_SAVE,
|
||||
buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
|
||||
@@ -179,7 +180,7 @@ class CelFileImportFunction(workflow.Function):
|
||||
def __init__(self):
|
||||
workflow.Function.__init__(self, 'cel_import', 'Import Affy')
|
||||
|
||||
def run(self, data):
|
||||
def run(self, (data,)):
|
||||
import rpy
|
||||
chooser = gtk.FileChooserDialog(title="Select cel files...", parent=None,
|
||||
action=gtk.FILE_CHOOSER_ACTION_OPEN,
|
||||
@@ -228,7 +229,7 @@ class PCAFunction(workflow.Function):
|
||||
workflow.Function.__init__(self, 'pca', 'PCA')
|
||||
self._workflow = wf
|
||||
|
||||
def run(self, data):
|
||||
def run(self, (data,)):
|
||||
import rpy
|
||||
|
||||
dim_2, dim_1 = data.get_dim_names()
|
||||
|
@@ -49,7 +49,7 @@ class LoadAnnotationsFunction(Function):
|
||||
logger.log('notice', 'Reading file: %s' % dialog.get_filename())
|
||||
self.load_affy_file(dialog.get_filename())
|
||||
|
||||
def run(self, data):
|
||||
def run(self, (data,)):
|
||||
btns = ('Open', gtk.RESPONSE_OK, \
|
||||
'Cancel', gtk.RESPONSE_CANCEL)
|
||||
dialog = gtk.FileChooserDialog('Open Affy Annotation File',
|
||||
@@ -81,7 +81,7 @@ class PCAFunction(Function):
|
||||
self.output = None
|
||||
self.workflow = workflow
|
||||
|
||||
def run(self, data):
|
||||
def run(self, (data,)):
|
||||
logger.log('debug', 'datatype: %s' % type(data))
|
||||
if not isinstance(data,dataset.Dataset):
|
||||
return None
|
||||
@@ -226,7 +226,7 @@ class LoadMoothaData(Function):
|
||||
def __init__(self):
|
||||
Function.__init__(self, 'load', 'Load diabetes data')
|
||||
|
||||
def run(self,data):
|
||||
def run(self,(data,)):
|
||||
data_file = open('full_data.pickle','r')
|
||||
data = pickle.load(data_file)
|
||||
data_file.close()
|
||||
@@ -250,7 +250,7 @@ class Log2Function(Function):
|
||||
def __init__(self):
|
||||
Function.__init__(self, 'log', 'Log2')
|
||||
|
||||
def run(self,data):
|
||||
def run(self,(data,)):
|
||||
x = log2(data._array)
|
||||
#pull out identifiers
|
||||
ids = []
|
||||
|
Reference in New Issue
Block a user