def tomoseq_all_sim(point_mat, func): axis_list = ["x", "y", "z"] ts_all = tomo_seq_all_axis(point_mat) for axis in axis_list: ts_sim = expression_simulator(point_mat, func, axis) ts_all.ts_dict[axis] = ts_sim return (ts_all)
def register_tomoseq(self, prefix, hpf, stage="shield"): self.stage_time_dict[stage] = hpf self.t_vec = safe_append(self.t_vec, hpf) self.ts_t_vec = safe_append(self.ts_t_vec, hpf) pmat = self.ct.get_pmat(hpf) ts_all = tomo_seq_all_axis(pmat) axis_list = ["av", "vd", "lr"] for i in range(len(axis_list)): axis = axis_list[i] divnum = np.arange(-1400, 1400, self.div_width_dict_shield[axis]) filename = prefix + "_" + axis + ".csv" ts_all.register_axis(filename, axis, divnum) self.ts_dict[hpf] = ts_all
def register_tomoseq_ss(self, prefix, hpf, stage="10ss", fix_angle=0): self.stage_time_dict[stage] = hpf self.t_vec = safe_append(self.t_vec, hpf) self.ts_t_vec = safe_append(self.ts_t_vec, hpf) pmat = self.ct.get_pmat(hpf) ts_all = tomo_seq_all_axis(pmat, fix_angle) axis_list = ["va", "dv", "lr"] label_list = ["av", "vd", "lr"] for i in range(len(axis_list)): axis = axis_list[i] label = label_list[i] divnum = np.arange(-1400, 1400, self.div_width_dict_ss10[axis]) filename = prefix + "_" + label + ".csv" ts_all.register_axis(filename, axis, divnum) self.ts_dict[hpf] = ts_all
def register_tomoseq_divnum(self, prefix, hpf, stage, divnum_dict, fix_angle, axis_list=["av", "vd", "lr"], label_list=["av", "vd", "lr"]): self.stage_time_dict[stage] = hpf self.t_vec = safe_append(self.t_vec, hpf) self.ts_t_vec = safe_append(self.ts_t_vec, hpf) pmat = self.ct.get_pmat(hpf) ts_all = tomo_seq_all_axis(pmat, fix_angle) for i in range(len(axis_list)): axis = axis_list[i] label = label_list[i] filename = prefix + "_" + label + ".csv" ts_all.register_axis(filename, axis, divnum_dict[axis], divnum_direct=True) self.ts_dict[hpf] = ts_all
type=str, help='file prefix for cell density') parser.add_argument('--sample_num', '-n', default=2000, type=int, help='number of points sampled from cell density') parser.add_argument('--time', '-t', default=6.0, type=float, help='hpf') args = parser.parse_args() # cell coordinate preparation gpp = GP_data_processor() gpp.register_file(args.dens) point_mat = gpp.sample_point_time(args.time, size=args.sample_num) divnum = np.arange(-2, 2, 0.055) # expression data preparation ts_all = tomo_seq_all_axis(point_mat) for axis in ['av', 'vd', 'lr']: fname_av = args.expression + '_' + axis + '.csv' ts_all.register_axis(fname_av, axis, divnum) # adding data for STGE slice_all = ts_all.get_slice_list() gene_id = args.gene exp_all = ts_all.get_expression(gene_id) stge = STGE() stge.add_region_list(slice_all, exp_all) # tunig and save hyper parameters inits = np.random.uniform(0.01, 10, 3) res = stge.optimize_parameters(sigma_f=inits[0], l_corr=inits[1], sigma_obs=inits[2]) gene_param = np.concatenate(([gene_id], res.astype(str))).reshape([1, 4])