def score1C(sim, data_df): sim_w = np.unique(sim.U, return_counts=True)[1] / sim.N est_w = data_df.groupby('cluster_id').vaf_purity.count().values / len( data_df) est_phi = data_df.groupby('cluster_id').vaf_purity.mean().values return score1C_base(sim.phi, est_phi, sim_w, est_w)
def score1C(sim, cluster_table): sim_w = np.unique(sim.U, return_counts=True)[1] / sim.N est_w = cluster_table['Cluster_Assignment'] / cluster_table[ 'Cluster_Assignment'].sum() est_phi = cluster_table['postDP_ccf_mean'] return score1C_base(sim.phi, est_phi, sim_w, est_w)
def score1C(sim, est): sim_w = np.unique(sim.U, return_counts=True)[1] / sim.N pre_est_w = np.zeros(est.J) pre_counts = np.unique(np.argmax(est.qun, axis=1), return_counts=True) pre_est_w[pre_counts[0]] = pre_counts[1] est_w = pre_est_w / len(sim.U) return score1C_base(sim.phi, est.phi, sim_w, est_w)
def score1C(sim, loci_table): sim_w = np.unique(sim.U, return_counts=True)[1] / sim.N est_w = loci_table[loci_table.cluster > 0].groupby( 'cluster')['tumor.vaf'].count() / len(loci_table) est_phi = loci_table[loci_table.cluster > 0].groupby( 'cluster')['tumor.vaf'].mean() / 100 return score1C_base(sim.phi, est_phi, sim_w, est_w)
def score1C(sim, cluster_table): sim_w = np.unique(sim.U, return_counts=True)[1] / sim.N est_w = cluster_table['no.of.mutations'] / cluster_table[ 'no.of.mutations'].sum() est_phi = cluster_table['location'] return score1C_base(sim.phi, est_phi, sim_w, est_w)
def score1C(sim, loci_table): sim_w = np.unique(sim.U, return_counts=True)[1]/sim.N pre_cluster_table = loci_table.groupby('ccube_ccf_mean').rough_mult.count() est_w = pre_cluster_table.values/len(loci_table) est_phi = pre_cluster_table.index.values return score1C_base(sim.phi, est_phi, sim_w, est_w)
row_list.append(folder_path.split('_')[-1]) row_list.append(info_df.median_depth.mean()) (ll_ratio, pval, J_pred, phi_pred_values, weights_pred, pred_cluster_assign, pred_subclonal, pred_profile, pred_signatures, pred_signatures_mut, est_dist, runtime) = \ method_function_dict[method](folder_path) row_list.append(J_pred) row_list.append(ll_ratio) row_list.append(pval) if J_pred is not None: row_list.append(score1B_base(J_true, J_pred)) else: row_list.append(np.nan) if phi_pred_values is not None: row_list.append( score1C_base(phi_true_values, phi_pred_values, weights_true, weights_pred)) else: row_list.append(np.nan) if pred_cluster_assign is not None: ordered_table = pd.merge(pred_cluster_assign, true_cluster_assign, on='mutation_id', how='inner') if len(true_cluster_assign) < 20000: row_list.append( score2A_base(ordered_table.true_cluster_id, ordered_table.pred_cluster_id)) else: row_list.append(np.nan) ordered_table = pd.merge(pred_subclonal, true_subclonal,
def score1C(sim, cluster_table): sim_w = np.unique(sim.U, return_counts=True)[1] / sim.N est_w = cluster_table['size'] / cluster_table['size'].sum() est_phi = cluster_table['mean'] return score1C_base(sim.phi, est_phi, sim_w, est_w)
def score1C(sim, data_df): sim_w = np.unique(sim.U, return_counts=True)[1]/sim.N est_w = data_df.groupby('Clonality').CCF.count().values/len(data_df) est_phi = data_df.groupby('Clonality').CCF.mean().values return score1C_base(sim.phi, est_phi, sim_w, est_w)
row_list.append(info_df.perc_dip.mean()) row_list.append(folder_path.split('_')[-1]) row_list.append(info_df.median_depth.mean()) (ll_ratio, pval, J_pred, phi_pred_values, weights_pred, pred_cluster_assign, pred_subclonal, pred_profile, pred_signatures, pred_signatures_mut, est_dist, runtime) = \ method_function_dict[method](folder_path) row_list.append(J_pred) row_list.append(ll_ratio) row_list.append(pval) if J_pred is not None: row_list.append(score1B_base(J_true, J_pred)) else: row_list.append(np.nan) if phi_pred_values is not None: row_list.append(score1C_base(phi_true_values, phi_pred_values, weights_true, weights_pred)) else: row_list.append(np.nan) if pred_cluster_assign is not None: ordered_table = pd.merge(pred_cluster_assign, true_cluster_assign, on='mutation_id', how='inner') if len(true_cluster_assign)<20000: row_list.append(score2A_base(ordered_table.true_cluster_id, ordered_table.pred_cluster_id)) else: row_list.append(np.nan) ordered_table = pd.merge(pred_subclonal, true_subclonal, on='mutation_id', how='inner') auc, accuracy, sensitivity, specificity, precision = \ score2C_base(ordered_table.true_subclonal, ordered_table.pred_subclonal)