Projects/laydi
Projects
/
laydi
Archived
7
0
Fork 0
This repository has been archived on 2024-07-04. You can view files and clone it, but cannot push or open issues or pull requests.
laydi/workflows/test_workflow.py

51 lines
1.6 KiB
Python

import gtk
from fluents import dataset, logger, plots, workflow
#import geneontology
#import gostat
from scipy import array, randn, log, ones
import cPickle
import networkx
class TestWorkflow (workflow.Workflow):
name = 'Test Workflow'
ident = 'test'
description = 'This workflow currently serves as a general testing workflow.'
def __init__(self, app):
workflow.Workflow.__init__(self, app)
load = workflow.Stage('load', 'Test Data')
load.add_function(TestDataFunction())
self.add_stage(load)
class TestDataTask(workflow.Task):
title = "Test data"
def __init__(self):
workflow.Task.__init__(self)
def run(self):
logger.log('notice', 'Injecting foo test data')
x = randn(500,15)
X = dataset.Dataset(x)
p = plots.ScatterPlot(X, X, 'rows', 'rows', '0_1', '0_2',name='scatter')
# p2 = plots.ScatterMarkerPlot(X, X, 'rows', 'rows', '0_1', '0_2',name='marker')
graph = networkx.XGraph()
for x in 'ABCDEF':
for y in 'ADE':
graph.add_edge(x, y, 3)
ds = dataset.GraphDataset(array(networkx.adj_matrix(graph)))
ds_plot = plots.NetworkPlot(ds)
cds = dataset.CategoryDataset(ones([3, 3]))
ds_scatter = plots.ScatterMarkerPlot(ds, ds,
'rows_0', 'rows_0',
'0_1', '0_2')
lp = plots.LineViewPlot(X,major_axis=0)
vp = plots.VennPlot()
self.datasets = [p]
return [X, ds, p, ds_plot, ds_scatter, p2, cds, lp, vp]