def visualize(details): #get accNum acnum = details['acnum'] gtype = details['gtype'] #obtain a Data Object for the GEO accession number try: dataobj = Data(acnum) except: return None #get pivoted dataset dataset = dataobj.getDataTable() if (gtype == "scatter"): try: return plotScatter(dataset, details['genes']) except: return "Error" elif (gtype == "heatmap"): return plotHeat(dataset) elif (gtype == "box"): return plotBox(dataset) elif (gtype == "hist"): return plotHist(dataset) elif (gtype == "bar"): return plotBar(dataset, details['sample'], details['number']) else: return None, None
def getMeta(details): acnum = details['acnum'] try: dataobj = Data(acnum) except: return None #get samples list from pivoted table dataset = dataobj.getDataTable() #generate the csv file csvWrite(dataset) samples = list(dataobj.getDataTable().columns) #prepare meta data description = dataobj.getDescription() return description, samples, dataset
def test_boxPlot(client): dataset=Data('GSE6207').getDataTable() rv = client.boxplot.plotBox(dataset) assert rv!=None
def test_Histogram(client): dataset=Data('GSE6207').getDataTable() rv = client.histogram.plotHist(dataset) assert rv!=None
def test_BarPlot(client): dataset=Data('GSE6207').getDataTable() sample='GSM143388' number=[0,100] rv = client.barplot.plotBar(dataset,sample,number) assert rv!=None
def test_plotHeat(client): dataset=Data('GSE6207').getDataTable() rv = client.heatmap.plotHeat(dataset) assert rv!=None
def test_plotScatter(client): dataset=Data('GSE6207').getDataTable() genes=['GSM143386','GSM143385'] rv = client.scatterplot.plotScatter(dataset,genes) assert rv!=None