def testFromFile1(self): filepath = os.path.join(settings.SCISHEETS_TEST_DIR, "tabularize_test.pcl") api = APIPlugin(filepath) api.initialize() tabularize(api, 'Groups', 1, 'MeanCt', new_category_colnm='BioRuns', values_colnm_prefix='Gene_') BioRuns = api.getColumnValue('BioRuns') Gene_I = api.getColumnValue('Gene_I') Gene_R1 = api.getColumnValue('Gene_R1') Gene_R2 = api.getColumnValue('Gene_R2')
def testSimple(self): new_category_colnm = "NewCategory" values_colnm_prefix = "Col" tabularize(self.api, CATEGORY_COLNM, 1, VALUES_COLNM, new_category_colnm=new_category_colnm, values_colnm_prefix=values_colnm_prefix) table = self.api._table self.assertTrue(table.isColumnPresent(new_category_colnm)) for sfx in SFX_NAMES: expected_name = "%s%s" % (values_colnm_prefix, sfx) self.assertTrue(table.isColumnPresent(expected_name)) column = table.columnFromName(expected_name) cells = [x for x in column.getCells() if not isNan(x)] size = len(VALUES)/len(SFX_NAMES) self.assertEqual(len(cells), size)
def testSimple(self): new_category_colnm = "NewCategory" values_colnm_prefix = "Col" tabularize(self.api, CATEGORY_COLNM, 1, VALUES_COLNM, new_category_colnm=new_category_colnm, values_colnm_prefix=values_colnm_prefix) table = self.api._table self.assertTrue(table.isColumnPresent(new_category_colnm)) for sfx in SFX_NAMES: expected_name = "%s%s" % (values_colnm_prefix, sfx) self.assertTrue(table.isColumnPresent(expected_name)) column = table.columnFromName(expected_name, is_relative=True) cells = [x for x in column.getCells() if not isNan(x)] size = len(VALUES) / len(SFX_NAMES) self.assertEqual(len(cells), size)