9.31556123e+00,   3.22439204e-08,   5.71925258e-05,
         3.70698682e-01,   3.85329914e+04,   2.41529096e+04,
         2.43090986e+04,   2.86685025e+04,   1.11990152e+03,
         1.46303304e+03,   9.01419378e+05,   9.16429780e+04,
         7.99801158e+04,   1.69026159e+04,   5.09448820e-01,
         7.84471874e-05,   7.47324740e-07,   9.20472237e-03,
         7.66006690e-01,   1.17392697e-08,   1.92114387e-02,
         1.51333432e+00,   5.89673352e-09,   5.41091972e-04,
         1.81968382e+00,   1.80402454e-06,   2.24990216e-03,
         1.43036340e+00,   1.00064585e-07,   7.26550483e-03,
         1.00000000e-02,   3.64962469e-06,   2.09630718e-01,
         3.55723180e-07,   2.61192682e-02,   2.62023580e-05,
         1.54476111e-03,   1.01089158e-06,   8.08297025e-03,
         1.10796394e-07,   6.87439549e-04,   1.28003247e-05,
         2.11267099e-02,   4.86731639e-06,   2.37896838e-02,
         7.98431070e-08,   2.03144337e-01,   4.92250704e-06,
         2.97646552e-02,   4.87999878e-07,   8.02754496e-03,
         2.80093210e-06,   1.33217623e-04,   1.17453801e-04,
         3.07145084e-03,   6.03418156e-04,   1.50334426e-02,
         6.65686789e-05,   1.64949367e-02,   7.59172307e-04,
         5.24390424e-03,   1.89608777e-04,   1.80147595e-03,
         1.30296705e-04,   1.47706376e-03,   1.14915557e+00,
         6.26994247e-06,   6.42049097e-05,   9.89376804e-01,
         1.58266178e-05,   4.84818743e-03,   6.05651201e+00,
         7.66416641e-06,   2.52347502e-04,   9.60186500e+00])

tspan = np.linspace(0, 20160, 1000)

run_flux_visualization(model, tspan, parameters=parames, verbose=False)
print('finished')
from corm import model
from visualization.species_visualization_bidirectional_equilibration import run_flux_visualization
import numpy as np

# tipe 1 cluster: 8509
# type 2 cluster: 7848
# type 3 cluster: 5113

all_dream_log_parames = np.load("/home/oscar/PycharmProjects/CORM/results/2015_02_02_COX2_all_traces.npy")[1784]

pysb_sampled_parameter_names = ['kr_AA_cat2', 'kcat_AA2', 'kr_AA_cat3', 'kcat_AA3', 'kr_AG_cat2', 'kr_AG_cat3',
                                'kcat_AG3', 'kr_AA_allo1', 'kr_AA_allo2', 'kr_AA_allo3', 'kr_AG_allo1', 'kr_AG_allo2']

generic_kf = np.log10(1.5e4)

param_dict = {pname: pvalue for pname, pvalue in zip(pysb_sampled_parameter_names, all_dream_log_parames)}
for pname, pvalue in param_dict.items():

    # Sub in parameter values at current location in parameter space

    if 'kr' in pname:
        model.parameters[pname].value = 10 ** (pvalue + generic_kf)

    elif 'kcat' in pname:
        model.parameters[pname].value = 10 ** pvalue

tspan = np.linspace(0, 10, num=100)

run_flux_visualization(model, tspan)
print('finished')