From 939dba20ee1a3ca270d41bd5bb024117bc23f206 Mon Sep 17 00:00:00 2001 From: flatberg Date: Mon, 23 Jul 2007 17:35:28 +0000 Subject: [PATCH] first import lpls --- workflows/smokers.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/workflows/smokers.py b/workflows/smokers.py index d011f70..7844eac 100644 --- a/workflows/smokers.py +++ b/workflows/smokers.py @@ -21,6 +21,7 @@ class SmallTestWorkflow(workflow.Workflow): load.add_function(DatasetLoadFunctionSmokerSmall()) load.add_function(DatasetLoadFunctionSmokerMedium()) load.add_function(DatasetLoadFunctionSmokerFull()) + load.add_function(DatasetLoadFunctionSmokerGO()) #load.add_function(DatasetLoadFunctionCYCLE()) self.add_stage(load) @@ -40,6 +41,7 @@ class SmallTestWorkflow(workflow.Workflow): model = workflow.Stage('models', 'Models') model.add_function(blmfuncs.PCA()) model.add_function(blmfuncs.PLS()) + model.add_function(blmfuncs.LPLS()) #model.add_function(bioconFuncs.SAM(app)) self.add_stage(model) @@ -113,6 +115,20 @@ class DatasetLoadFunctionSmokerFull(workflow.Function): out.append(dataset.read_ftsv(input_file)) return out +class DatasetLoadFunctionSmokerGO(workflow.Function): + """Loader for all ftsv files of smokers small datasets.""" + def __init__(self): + workflow.Function.__init__(self, 'load_go', 'Smoker (GO)') + + def run(self): + path = 'data/smokers-go/' + files = os.listdir(path) + out = [] + for fname in files: + if fname.endswith('.ftsv'): + input_file = open(os.path.join(path, fname)) + out.append(dataset.read_ftsv(input_file)) + return out class DatasetLoadFunctionCYCLE(workflow.Function): """Loader for pickled CYCLE datasets."""