Implemented Limma function for Affy workflow.

Extended ScatterPlot to take two datasets and updated code using it.
This commit is contained in:
2006-05-09 13:17:17 +00:00
parent 033d4d5333
commit 5b1af849dc
6 changed files with 144 additions and 24 deletions

View File

@@ -429,18 +429,19 @@ class LinePlot(Plot):
class ScatterPlot(Plot):
def __init__(self, dataset, id_dim, sel_dim, id_1, id_2, name="Scatter plot"):
def __init__(self, dataset_1, dataset_2, id_dim, sel_dim, id_1, id_2, name="Scatter plot"):
Plot.__init__(self, name)
fig = Figure(figsize=(5,4), dpi=72)
self.ax = ax = fig.add_subplot(111)
self.current_dim = id_dim
# testing testing
self.dataset = dataset
x_index = dataset[sel_dim][id_1]
y_index = dataset[sel_dim][id_2]
self.dataset_1 = dataset_1
self.xaxis_data = dataset._array[:,x_index]
self.yaxis_data = dataset._array[:,y_index]
x_index = dataset_1[sel_dim][id_1]
y_index = dataset_2[sel_dim][id_2]
self.xaxis_data = dataset_1._array[:,x_index]
self.yaxis_data = dataset_2._array[:,y_index]
ax.plot(self.xaxis_data,self.yaxis_data,'og')
ax.set_title(self.get_title())
ax.set_xlabel("%s - %s" % (sel_dim, id_1))
@@ -478,13 +479,13 @@ class ScatterPlot(Plot):
#logger.log('debug','Selection y_start bigger than y_end')
index =scipy.nonzero((xdata>x1) & (xdata<x2) & (ydata<y1) & (ydata>y2))
ids = self.dataset.get_identifiers(self.current_dim, index)
ids = self.dataset_1.get_identifiers(self.current_dim, index)
self.selection_listener(self.current_dim, ids)
def selection_changed(self, selection):
ids = selection[self.current_dim] # current identifiers
index = self.dataset.get_indices(self.current_dim, ids)
index = self.dataset_1.get_indices(self.current_dim, ids)
xdata_new = scipy.take(self.xaxis_data,index) #take data
ydata_new = scipy.take(self.yaxis_data,index)
self.ax.clear()