Exemplo n.º 1
0
                                  integrator_options=integrator_opt)

pars_eq = np.copy(all_par_set_calibrated)
pars_eq[:, kcat_idx] = 0
conc_eq = pre_equilibration(cupsoda_solver, param_values=pars_eq)[1]

sims_final = CupSodaSimulator(model,
                              tspan=tspan,
                              gpu=0,
                              obs_species_only=False,
                              memory_usage='shared_constant',
                              integrator_options=integrator_opt).run(
                                  param_values=all_par_set_calibrated,
                                  initials=conc_eq)
print(sims_final.dataframe['__s27'])
sims_final.save('simulations_arrestin_jnk3.h5')

# Simulations without arrestin
jnk3_initial_idxs = [47, 48, 49]

pars_eq_noarrestin = np.copy(all_par_set_calibrated)
all_pars_noarrestin = np.copy(all_par_set_calibrated)
pars_eq_noarrestin[:, arrestin_idx] = 0
all_pars_noarrestin[:, arrestin_idx] = 0
pars_eq_noarrestin[:, jnk3_initial_idxs] = [0.592841488, 0, 0.007158512]

pars_eq_noarrestin[:, kcat_idx] = 0
conc_eq_noarrestin = pre_equilibration(cupsoda_solver,
                                       param_values=pars_eq_noarrestin)[1]

sims_final_noarrestin = CupSodaSimulator(
    elif parameter_idx in [91]:
        samples = np.random.uniform(low=602214.086, high=1806642.258, size=size)
        return samples
    else:
        raise ValueError('Distribution is not defined for parameter index {}'.format(parameter_idx))


parameters = np.array([p.value for p in model.parameters])

nsamples = 50000
repeated_parameter_values = np.tile(parameters, (nsamples, 1))

for par_idx in kr_pars_to_sample:
    repeated_parameter_values[:, par_idx] = sample_kr_uniform(nsamples)

for kf_idx, kr_idx in zip(kf_pars_to_calculate, kr_pars_to_sample):
    repeated_parameter_values[:, kf_idx] = repeated_parameter_values[:, kr_idx] / sample_kd_uniform(kr_idx, nsamples)
np.save('pars_sampled_kd_bcl2.npy', repeated_parameter_values)
#
tspan = np.linspace(0, 20000, 100)

vol= 1e-19
integrator_opt = {'rtol': 1e-6, 'atol': 1e-6, 'mxsteps': 20000}
sims = CupSodaSimulator(model, tspan=tspan, gpu=0, memory_usage='shared_constant', vol=vol,
                        integrator_options=integrator_opt).run(param_values=repeated_parameter_values)
sims.save('simulations_sampled_kd_bcl2.h5')

signatures = run_tropical_multi(model=model, simulations=sims, cpu_cores=20, verbose=True)

with open('signatures_sampled_kd_bcl2.pickle', 'wb') as handle:
    pickle.dump(signatures, handle, protocol=pickle.HIGHEST_PROTOCOL)
Exemplo n.º 3
0
arrestin_idx = 44
kcat_idx = [36, 37]
repeated_parameter_values = np.tile(par_clus1, (n_conditions, 1))
repeated_parameter_values[:, arrestin_idx] = arrestin_initials
np.save('arrestin_diff_IC_par0.npy', repeated_parameter_values)

tspan_eq = np.linspace(0, 100, 100)
integrator_opt = {'rtol': 1e-6, 'atol': 1e-6, 'mxsteps': 20000}

cupsoda_solver = CupSodaSimulator(model,
                                  tspan=tspan_eq,
                                  gpu=0,
                                  obs_species_only=False,
                                  memory_usage='shared_constant',
                                  integrator_options=integrator_opt)

pars_eq = np.copy(repeated_parameter_values)
pars_eq[:, kcat_idx] = 0
conc_eq = pre_equilibration(cupsoda_solver, param_values=pars_eq)[1]

sims_final = CupSodaSimulator(model,
                              tspan=tspan,
                              gpu=0,
                              obs_species_only=False,
                              memory_usage='shared_constant',
                              integrator_options=integrator_opt).run(
                                  param_values=repeated_parameter_values,
                                  initials=conc_eq)

sims_final.save('simulations_ic_jnk3.h5')