def num_volume_corrcoef(LucN, hccN, MixN, mm2): #Raw Data r_LucN, r_hccN, r_MixN = graph.num_read_volume() #Adjustment of Timeseries time_point = len(r_LucN[0]) # Experiments sim_time_point = len(LucN) # Simulation time sim_tmp = (len(LucN)*0.66)/(time_point-1) #1.25 #Simulation timepoint LucN_p = [] hccN_p = [] MixN_p = [] for t in range(time_point): if t != 0: print int(sim_time_point*0.3 + round(t*sim_tmp)) LucN_p.append(LucN[int(sim_time_point*0.3 + round(t*sim_tmp))]) hccN_p.append(hccN[int(sim_time_point*0.3 + round(t*sim_tmp))]) MixN_p.append(MixN[int(sim_time_point*0.3 + round(t*sim_tmp))]) else: LucN_p.append(LucN[int(round(t*sim_tmp))]) hccN_p.append(hccN[int(round(t*sim_tmp))]) MixN_p.append(MixN[int(round(t*sim_tmp))]) print 'Simulation vs Raw' print 'Luc' LucN_v = check_number_of_volume(LucN_p, r_LucN, mm2,'Luc') print 'Mix' MixN_v = check_number_of_volume(MixN_p, r_MixN, mm2, 'Mix') print 'hcc' hccN_v = check_number_of_volume(hccN_p, r_hccN, mm2, 'HCC') draw.all_cells_fig(LucN_v, r_LucN, MixN_v, r_MixN, hccN_v, r_hccN)
def num_volume_corrcoef(LucN, hccN, MixN, mm2): #Raw Data r_LucN, r_hccN, r_MixN = graph.num_read_volume() #Adjustment of Timeseries time_point = len(r_LucN[0]) # Experiments sim_time_point = len(LucN) # Simulation time sim_tmp = (len(LucN) * 0.66) / (time_point - 1) #1.25 #Simulation timepoint LucN_p = [] hccN_p = [] MixN_p = [] for t in range(time_point): if t != 0: print int(sim_time_point * 0.3 + round(t * sim_tmp)) LucN_p.append(LucN[int(sim_time_point * 0.3 + round(t * sim_tmp))]) hccN_p.append(hccN[int(sim_time_point * 0.3 + round(t * sim_tmp))]) MixN_p.append(MixN[int(sim_time_point * 0.3 + round(t * sim_tmp))]) else: LucN_p.append(LucN[int(round(t * sim_tmp))]) hccN_p.append(hccN[int(round(t * sim_tmp))]) MixN_p.append(MixN[int(round(t * sim_tmp))]) print 'Simulation vs Raw' print 'Luc' LucN_v = check_number_of_volume(LucN_p, r_LucN, mm2, 'Luc') print 'Mix' MixN_v = check_number_of_volume(MixN_p, r_MixN, mm2, 'Mix') print 'hcc' hccN_v = check_number_of_volume(hccN_p, r_hccN, mm2, 'HCC') draw.all_cells_fig(LucN_v, r_LucN, MixN_v, r_MixN, hccN_v, r_hccN)
def num_cell_corrcoef(LucN, hccN, MixN, mm2): #Raw Data r_LucN, r_hccN, r_MixN = graph.num_read_cells(mm2) #Adjustment of Timeseries time_point = len(r_LucN[0]) # Experiments sim_time_point = len(LucN) # Simulation time sim_tmp = (len(LucN) * 0.66) / (time_point - 1) #1.25 #Simulation timepoint LucN_p = [] hccN_p = [] MixN_p = [] for t in range(time_point): if t != 0: print int(sim_time_point * 0.3 + round(t * sim_tmp)) LucN_p.append(LucN[int(sim_time_point * 0.3 + round(t * sim_tmp))]) hccN_p.append(hccN[int(sim_time_point * 0.3 + round(t * sim_tmp))]) MixN_p.append(MixN[int(sim_time_point * 0.3 + round(t * sim_tmp))]) else: LucN_p.append(LucN[int(round(t * sim_tmp))]) hccN_p.append(hccN[int(round(t * sim_tmp))]) MixN_p.append(MixN[int(round(t * sim_tmp))]) print 'Simulation vs Raw' print 'Luc' print check_number_of_cells(LucN_p, r_LucN, 'Luc') print 'Mix' print check_number_of_cells(MixN_p, r_MixN, 'Mix') print 'hcc' print check_number_of_cells(hccN_p, r_hccN, 'HCC') draw.all_cells_fig(LucN_p, r_LucN, MixN_p, r_MixN, hccN_p, r_hccN) corr_Luc = [] corr_hcc = [] corr_Mix = [] for i in range(len(r_LucN)): #times of experiments tmp_Luc = np.corrcoef(r_LucN[i], LucN_p) tmp_hcc = np.corrcoef(r_hccN[i], hccN_p) tmp_Mix = np.corrcoef(r_MixN[i], MixN_p) corr_Luc.append(tmp_Luc[0, 1]) corr_hcc.append(tmp_hcc[0, 1]) corr_Mix.append(tmp_Mix[0, 1]) print 'Average Correlation Luc = %s, HCC = %s, Mix ~ %s ' % (np.average( np.array(corr_Luc)), np.average( np.array(corr_hcc)), np.average(np.array(corr_Mix))) return 0
def num_cell_corrcoef(LucN, hccN, MixN, mm2): #Raw Data r_LucN, r_hccN, r_MixN = graph.num_read_cells(mm2) #Adjustment of Timeseries time_point = len(r_LucN[0]) # Experiments sim_time_point = len(LucN) # Simulation time sim_tmp = (len(LucN)*0.66)/(time_point-1) #1.25 #Simulation timepoint LucN_p = [] hccN_p = [] MixN_p = [] for t in range(time_point): if t != 0: print int(sim_time_point*0.3 + round(t*sim_tmp)) LucN_p.append(LucN[int(sim_time_point*0.3 + round(t*sim_tmp))]) hccN_p.append(hccN[int(sim_time_point*0.3 + round(t*sim_tmp))]) MixN_p.append(MixN[int(sim_time_point*0.3 + round(t*sim_tmp))]) else: LucN_p.append(LucN[int(round(t*sim_tmp))]) hccN_p.append(hccN[int(round(t*sim_tmp))]) MixN_p.append(MixN[int(round(t*sim_tmp))]) print 'Simulation vs Raw' print 'Luc' print check_number_of_cells(LucN_p, r_LucN, 'Luc') print 'Mix' print check_number_of_cells(MixN_p, r_MixN, 'Mix') print 'hcc' print check_number_of_cells(hccN_p, r_hccN, 'HCC') draw.all_cells_fig(LucN_p, r_LucN, MixN_p, r_MixN, hccN_p, r_hccN) corr_Luc = [] corr_hcc = [] corr_Mix = [] for i in range(len(r_LucN)): #times of experiments tmp_Luc = np.corrcoef(r_LucN[i], LucN_p) tmp_hcc = np.corrcoef(r_hccN[i], hccN_p) tmp_Mix = np.corrcoef(r_MixN[i], MixN_p) corr_Luc.append(tmp_Luc[0,1]) corr_hcc.append(tmp_hcc[0,1]) corr_Mix.append(tmp_Mix[0,1]) print 'Average Correlation Luc = %s, HCC = %s, Mix ~ %s ' % (np.average(np.array(corr_Luc)), np.average(np.array(corr_hcc)), np.average(np.array(corr_Mix))) return 0