From 0db25f1dd78df881f7cc45977435098125b2f7aa Mon Sep 17 00:00:00 2001 From: tangstad Date: Fri, 5 May 2006 14:43:53 +0000 Subject: [PATCH] Changed use of Dataset.get_matrix() to Dataset.asarray() and removed it. --- system/dataset.py | 4 ---- system/plots.py | 4 ++-- workflows/affy_workflow.py | 2 +- workflows/go_workflow.py | 2 +- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/system/dataset.py b/system/dataset.py index 29f6bdd..2362d9b 100644 --- a/system/dataset.py +++ b/system/dataset.py @@ -160,10 +160,6 @@ class Dataset: """Returns dataset name""" return self._name - def get_matrix(self): - """Returns internal numeric matrix for dataset.""" - return self._array - def get_all_dims(self): """Returns all dimensions in project""" return self._all_dims diff --git a/system/plots.py b/system/plots.py index 3c4d6c0..212ac15 100644 --- a/system/plots.py +++ b/system/plots.py @@ -386,7 +386,7 @@ class LinePlot(Plot): import rpy silent_eval = rpy.with_mode(rpy.NO_CONVERSION, rpy.r) - rpy.with_mode(rpy.NO_CONVERSION, rpy.r.assign)("m", dataset.get_matrix()) + rpy.with_mode(rpy.NO_CONVERSION, rpy.r.assign)("m", dataset.asarray()) ymin, ymax = rpy.r("range(m)*1.1") self._ymin, self._ymax = ymin, ymax silent_eval("res <- apply(m, 2, density, from=%s, to=%s)" % (ymin, ymax)) @@ -420,7 +420,7 @@ class LinePlot(Plot): ids = selection[dim_2] # current identifiers index = [ind for id,ind in self._dataset[dim_2].items() if id in ids] #conversion to index for i in index: - line = self._dataset.get_matrix()[i] + line = self._dataset.asarray()[i] self.ax.plot(range(1, len(line)+1), line) self.ax.set_xlim((0.5, cols+0.5)) diff --git a/workflows/affy_workflow.py b/workflows/affy_workflow.py index 602e109..5a4e756 100644 --- a/workflows/affy_workflow.py +++ b/workflows/affy_workflow.py @@ -203,7 +203,7 @@ class PCAFunction(workflow.Function): dim_2, dim_1 = data.get_dim_names() silent_eval = rpy.with_mode(rpy.NO_CONVERSION, rpy.r) - rpy.with_mode(rpy.NO_CONVERSION, rpy.r.assign)("m", data.get_matrix()) + rpy.with_mode(rpy.NO_CONVERSION, rpy.r.assign)("m", data.asarray()) silent_eval("t = prcomp(t(m))") # we make a unique name for component dimension diff --git a/workflows/go_workflow.py b/workflows/go_workflow.py index 4a893c6..3dd9f73 100644 --- a/workflows/go_workflow.py +++ b/workflows/go_workflow.py @@ -236,7 +236,7 @@ class PCAFunction(workflow.Function): silent_eval = rpy.with_mode(rpy.NO_CONVERSION, rpy.r) - rpy.with_mode(rpy.NO_CONVERSION, rpy.r.assign)("m", data.get_matrix()) + rpy.with_mode(rpy.NO_CONVERSION, rpy.r.assign)("m", data.asarray()) silent_eval("t = prcomp(t(m))") T_ids = map(str, range(1, rpy.r("dim(t$x)")[1]+1))