Added text-input for contrast-matrix creator for affymetrics workflow.
This commit is contained in:
parent
98445498b5
commit
97f56f66ac
|
@ -79,3 +79,30 @@ class CreateProjectDruid(gtk.Window):
|
|||
wf = self.workflows.get_value(it, 1)
|
||||
self.wf_info.set_text(wf.description)
|
||||
|
||||
|
||||
def get_text(title, text):
|
||||
"""Allow user to type in a string for text."""
|
||||
dlg = gtk.Dialog(title)
|
||||
dlg.show()
|
||||
|
||||
text = gtk.Label(text)
|
||||
text.show()
|
||||
|
||||
entry = gtk.Entry()
|
||||
entry.show()
|
||||
entry.set_activates_default(True)
|
||||
dlg.vbox.pack_start(text)
|
||||
dlg.vbox.pack_start(entry)
|
||||
|
||||
dlg.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL)
|
||||
dlg.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
|
||||
dlg.set_default_response(gtk.RESPONSE_OK)
|
||||
response = dlg.run()
|
||||
|
||||
retval = None
|
||||
|
||||
if response == gtk.RESPONSE_OK:
|
||||
retval = entry.get_text()
|
||||
dlg.destroy()
|
||||
return retval
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import gtk
|
||||
from system import dataset, logger, plots, workflow
|
||||
from system import dataset, logger, plots, workflow, dialogs
|
||||
from scipy import randn, array, transpose, zeros
|
||||
import cPickle
|
||||
|
||||
|
@ -17,6 +17,7 @@ class AffyWorkflow (workflow.Workflow):
|
|||
load.add_function(PhenotypeImportFunction())
|
||||
load.add_function(TestDataFunction())
|
||||
load.add_function(DatasetLoadFunction())
|
||||
load.add_function(ContrastMatrixGenerateFunction())
|
||||
self.add_stage(load)
|
||||
|
||||
explore = workflow.Stage('explore', 'Explorative analysis')
|
||||
|
@ -105,6 +106,19 @@ class DatasetSaveFunction(workflow.Function):
|
|||
chooser.destroy()
|
||||
|
||||
|
||||
class ContrastMatrixGenerateFunction(workflow.Function):
|
||||
def __init__(self):
|
||||
workflow.Function.__init__(self, 'contrast_create', 'Create contrast matrix')
|
||||
|
||||
def run(self, data):
|
||||
response = dialogs.get_text('Enter contrasts...', """\
|
||||
Enter comma-separated list of contrasts.
|
||||
Available categories: %s
|
||||
|
||||
Example: Y-N, M-F""" % ", ".join(data.get_categories()))
|
||||
logger.log("notice", "contrasts selected: %s" % response)
|
||||
|
||||
|
||||
class CelFileImportFunction(workflow.Function):
|
||||
"""Loads Affymetrics .CEL-files into matrix."""
|
||||
def __init__(self):
|
||||
|
|
Reference in New Issue