示例#1
0
df = pd.DataFrame()
# read the files and compute the mean YFP value
for i, op in enumerate(operator):
    for j, strain in enumerate(rbs):
        # find the file
        try:
            #r_file = glob.glob(datadir + str(date) + '_' + run + '*' + \
            #        operator + '_' + strain + '_' + str(c) + 'uM' + '*csv')
            r_file = glob.glob(datadir + str(date) + '*'+ op + '_' + strain + '.csv')
            print(r_file)
            # read the csv file
            dataframe = pd.read_csv(r_file[0])
            # apply an automatic bivariate gaussian gate to the log front
            # and side scatterng
            data = mwc.auto_gauss_gate(dataframe, alpha,
                                        x_val='FSC-A', y_val='SSC-A',
                                        log=True)
            # compute the mean and append it to the data frame along the
            # operator and strain
            df = df.append([[date, username, op, energy[i],
                        strain, repressors[j],
                        data['FITC-A'].mean()]],
                        ignore_index=True)
        except:
            pass

# rename the columns of the data_frame
df.columns = ['date', 'username', 'operator', 'binding_energy', \
        'rbs', 'repressors', 'mean_YFP_A']

# initialize pandas series to save the corrected YFP value
示例#2
0
    for r in rbs:
        if op in ['007', '012', '009', '013']:
            conc_list = concentrations_std
        elif op in ['010', '014']:
            conc_list = concentrations_alt
        for c in conc_list:
            try:
                r_file = glob.glob(datadir + str(date) + '_' + run + '*' + \
                        op + '_' + r + '_' + str(c) + 'uMIPTG' + '*csv')
                print(r_file)
                # convert to dataframe
                temp_df = pd.read_csv(r_file[0])
                # apply an automatic bivariate gaussian gate to the log front
                # and side scattering
                data = mwc.auto_gauss_gate(temp_df, alpha,
                                            x_val='FSC-A', y_val='SSC-A',
                                            log=True)
                # compute the mean and append it to the data frame along the
                # operator and strain
                df = df.append([[date, username, str(op), op_dict[op],
                            r, rbs_dict[r], c,
                            data['FITC-A'].mean()]],
                            ignore_index=True)
            except:
                pass

# rename the columns of the data_frame
df.columns = ['date', 'username', 'operator', 'binding_energy', \
        'rbs', 'repressors', 'IPTG_uM', 'mean_YFP_A']

mean_bgcorr_A = np.array([])