def setUp(self):
    super(TransformTest, self).setUp()
    (wells_384, rows_384, cols_384) = ([], [], [])
    for row in string.ascii_uppercase[:16]:
        for col in range(24):
            wells_384.append(('%s%02d' % (row, col)))
            rows_384.append(('%s' % row))
            cols_384.append(('%02d' % col))
    n_per_batch = 100
    n_each_control = (3 * n_per_batch)
    n_other = (3 * n_per_batch)
    np.random.seed(123)
    self.columns = [0, 1]
    neg_control_batches = []
    for i in range(0, n_each_control, n_per_batch):
        batch = ('week%d' % (i % n_per_batch))
        control_tuples = []
        for j in range(n_per_batch):
            control_tuples.append(('NEGATIVE_CONTROL', 'DMSO', 'DMSO', 1.0, _ACTIVITY, batch, _PLATE, wells_384[j], rows_384[j], cols_384[j], _SITE, _TIMEPOINT, _SEQUENCE, _CELL_DENSITY, _PASSAGE, _CELL_LINE_ID))
        neg_control_batches.append(pd.DataFrame(np.random.multivariate_normal(mean=np.array([(2.0 + i), (4.0 + i)]), cov=np.array([[(3.0 + i), (1.0 + i)], [(1.0 + i), (2.0 + i)]]), size=n_per_batch), columns=self.columns, index=pd.MultiIndex.from_tuples(control_tuples, names=metadata.METADATA_ORDER)))
    self.neg_controls = pd.concat(neg_control_batches)
    pos_control_batches = []
    for i in range(0, n_each_control, n_per_batch):
        batch = ('week%d' % (i % n_per_batch))
        control_tuples = []
        for j in range(n_per_batch):
            control_tuples.append(('POSITIVE_CONTROL', 'Taxol', 'Taxol', 1.0, _ACTIVITY, batch, _PLATE, wells_384[j], rows_384[j], cols_384[j], _SITE, _TIMEPOINT, _SEQUENCE, _CELL_DENSITY, _PASSAGE, _CELL_LINE_ID))
        pos_control_batches.append(pd.DataFrame(np.random.multivariate_normal(mean=np.array([(5.0 + i), (7.0 + i)]), cov=np.array([[(6.0 + i), (4.0 + i)], [(4.0 + i), (5.0 + i)]]), size=n_per_batch), columns=self.columns, index=pd.MultiIndex.from_tuples(control_tuples, names=metadata.METADATA_ORDER)))
    self.pos_controls = pd.concat(pos_control_batches)
    self.controls = pd.concat([self.neg_controls, self.pos_controls])
    experimental_batches = []
    for i in range(0, n_other, n_per_batch):
        batch = ('week%d' % (i % n_per_batch))
        experimental_tuples = []
        for j in range(n_per_batch):
            experimental_tuples.append(('EXPERIMENTAL', 'other', '2', 1.0, _ACTIVITY, batch, _PLATE, wells_384[j], rows_384[j], cols_384[j], _SITE, _TIMEPOINT, _SEQUENCE, _CELL_DENSITY, _PASSAGE, _CELL_LINE_ID))
        experimental_batches.append(pd.DataFrame(np.random.multivariate_normal(mean=np.array([(1.0 + i), (2.0 + i)]), cov=np.array([[(3.0 + i), (1.0 + i)], [(1.0 + i), (2.0 + i)]]), size=n_per_batch), columns=self.columns, index=pd.MultiIndex.from_tuples(experimental_tuples, names=metadata.METADATA_ORDER)))
    self.experimental = pd.concat(experimental_batches)
    self.data = pd.concat([self.controls, self.experimental])
def setUp(self):
    super(TransformTest, self).setUp()
    (wells_384, rows_384, cols_384) = ([], [], [])
    for row in string.ascii_uppercase[:16]:
        for col in range(24):
            wells_384.append(('%s%02d' % (row, col)))
            rows_384.append(('%s' % row))
            cols_384.append(('%02d' % col))
    n_per_batch = 100
    n_each_control = (3 * n_per_batch)
    n_other = (3 * n_per_batch)
    np.random.seed(123)
    self.columns = [0, 1]
    neg_control_batches = []
    for i in range(0, n_each_control, n_per_batch):
        batch = ('week%d' % (i % n_per_batch))
        control_tuples = []
        for j in range(n_per_batch):
            control_tuples.append(('NEGATIVE_CONTROL', 'DMSO', 'DMSO', 1.0, _ACTIVITY, batch, _PLATE, wells_384[j], rows_384[j], cols_384[j], _SITE, _TIMEPOINT, _SEQUENCE, _CELL_DENSITY, _PASSAGE, _CELL_LINE_ID))
        neg_control_batches.append(pd.DataFrame(np.random.multivariate_normal(mean=np.array([(2.0 + i), (4.0 + i)]), cov=np.array([[(3.0 + i), (1.0 + i)], [(1.0 + i), (2.0 + i)]]), size=n_per_batch), columns=self.columns, index=pd.MultiIndex.from_tuples(control_tuples, names=metadata.METADATA_ORDER)))
    self.neg_controls = pd.concat(neg_control_batches)
    pos_control_batches = []
    for i in range(0, n_each_control, n_per_batch):
        batch = ('week%d' % (i % n_per_batch))
        control_tuples = []
        for j in range(n_per_batch):
            control_tuples.append(('POSITIVE_CONTROL', 'Taxol', 'Taxol', 1.0, _ACTIVITY, batch, _PLATE, wells_384[j], rows_384[j], cols_384[j], _SITE, _TIMEPOINT, _SEQUENCE, _CELL_DENSITY, _PASSAGE, _CELL_LINE_ID))
        pos_control_batches.append(pd.DataFrame(np.random.multivariate_normal(mean=np.array([(5.0 + i), (7.0 + i)]), cov=np.array([[(6.0 + i), (4.0 + i)], [(4.0 + i), (5.0 + i)]]), size=n_per_batch), columns=self.columns, index=pd.MultiIndex.from_tuples(control_tuples, names=metadata.METADATA_ORDER)))
    self.pos_controls = pd.concat(pos_control_batches)
    self.controls = pd.concat([self.neg_controls, self.pos_controls])
    experimental_batches = []
    for i in range(0, n_other, n_per_batch):
        batch = ('week%d' % (i % n_per_batch))
        experimental_tuples = []
        for j in range(n_per_batch):
            experimental_tuples.append(('EXPERIMENTAL', 'other', '2', 1.0, _ACTIVITY, batch, _PLATE, wells_384[j], rows_384[j], cols_384[j], _SITE, _TIMEPOINT, _SEQUENCE, _CELL_DENSITY, _PASSAGE, _CELL_LINE_ID))
        experimental_batches.append(pd.DataFrame(np.random.multivariate_normal(mean=np.array([(1.0 + i), (2.0 + i)]), cov=np.array([[(3.0 + i), (1.0 + i)], [(1.0 + i), (2.0 + i)]]), size=n_per_batch), columns=self.columns, index=pd.MultiIndex.from_tuples(experimental_tuples, names=metadata.METADATA_ORDER)))
    self.experimental = pd.concat(experimental_batches)
    self.data = pd.concat([self.controls, self.experimental])