diff --git a/latch/models.py b/latch/models.py new file mode 100644 index 0000000..4a36d12 --- /dev/null +++ b/latch/models.py @@ -0,0 +1,63 @@ +# Urrios 2016: multicellular memory + +import numpy as np + +def not_cell(state, params): + L_X, x, y, N_X, N_Y = state + delta_L, gamma_X, n_y, theta_X, eta_x, omega_x, m_x, delta_x, rho_x = params + + f = gamma_X * (y ** n_y)/(1 + (theta_X*y)**n_y ) + dL_X_dt = f - delta_L * L_X + + dx_dt = N_X * (eta_x * (1/(1+ (omega_x*L_X)**m_x))) - N_Y * (delta_x * x) - rho_x * x + + return dL_X_dt, dx_dt + + +def not_cell_a(state, params): + return not_cell(state, params) + + +""" + L_A, a, b, N_A, N_B = state + delta_L, gamma_A, n_b, theta_A, eta_a, omega_a, m_a, delta_a, rho_a= params + + f_b = gamma_A * (b ** n_b)/(1 + (theta_A*b)**n_b ) + dL_A_dt = f_b - delta_L * L_A + + da_dt = N_A * (eta_a * (1/(1+ (omega_a*L_A)**m_b))) - N_B * (delta_a * a) - rho_a * a +""" + +def not_cell_b(state, params): + return not_cell(state, params) + +def population(state, params): + N = state + r = params + + dN = r * N * (1 - N) + + return dN + + +def toggle_model(state, T, params): + L_A, L_B, a, b, N_A, N_B = state + + state_A = L_A, a, b, N_A, N_B + state_B = L_B, b, a, N_B, N_A + + delta_L, gamma_A, gamma_B, n_a, n_b, theta_A, theta_B, eta_a, eta_b, omega_a, omega_b, m_a, m_b, delta_a, delta_b, rho_a, rho_b, r_A, r_B = params + + params_A = delta_L, gamma_A, n_b, theta_A, eta_a, omega_a, m_a, delta_a, rho_a + params_B = delta_L, gamma_B, n_a, theta_B, eta_b, omega_b, m_b, delta_b, rho_b + + dL_A_dt, da_dt = not_cell(state_A, params_A) + dL_B_dt, db_dt = not_cell(state_B, params_B) + + dN_A_dt = population(N_A, r_A) + dN_B_dt = population(N_B, r_B) + + return np.array([dL_A_dt, dL_B_dt, da_dt, db_dt, dN_A_dt, dN_B_dt]) + +def toggle_model_ODE(T, state, params): + return toggle_model(state, T, params) \ No newline at end of file diff --git a/latch/parameters.py b/latch/parameters.py new file mode 100644 index 0000000..a3f010c --- /dev/null +++ b/latch/parameters.py @@ -0,0 +1,24 @@ +# see Supplementary Table 1 in Urrios 2016 + +gamma_A = 0.615 #nM/min +gamma_B = 0.495 #nM/min +mu_A = 2 # +mu_B = 2 # +omega_a = 1550 #nM-1 +omega_b = 1550 #nM-1 +eta_a = 0.369#0.0369 #nM/min +eta_b = 0.162#0.162 #nM/min +r_A = 0.07 +r_B = 0.07 +m_a = 2 +m_b = 2 +delta_L = 0.15 #min-1 +delta_a = 0.05 #min-1 +delta_b = 0.023 #min-1 +theta_A = 0.26 #nM-1 +theta_B = 0.167 #nM-1 +n_a = 0.9 +n_b = 1.2 +rho_a = 5#5 #min-1 +rho_b = 5#5 #min-1 + diff --git a/latch/test_model.py b/latch/test_model.py new file mode 100644 index 0000000..f69102b --- /dev/null +++ b/latch/test_model.py @@ -0,0 +1,77 @@ +from scipy.integrate import odeint +import matplotlib.pyplot as plt + +from models import * +from parameters import * + +params = [delta_L, gamma_A, gamma_B, n_a, n_b, theta_A, theta_B, eta_a, eta_b, omega_a, omega_b, m_a, m_b, delta_a, delta_b, rho_a, rho_b, r_A, r_B] +#params = [delta_L, gamma_A, gamma_A, n_a, n_a, theta_A, theta_A, eta_a, eta_a, omega_a, omega_a, m_a, m_a, delta_a, delta_a, rho_a, rho_a, r_A, r_A] +#params = [delta_L, gamma_B, gamma_B, n_b, n_b, theta_B, theta_B, eta_b, eta_b, omega_b, omega_b, m_b, m_b, delta_b, delta_b, rho_b, rho_b, r_B, r_B] + +# simulation parameters +t_end = 500 +N = 1000 + +# Y = L_A, L_B, a, b, N_A, N_B +Y0 = np.array([0]*6) +Y0[-2] = 1 +Y0[-1] = 1 +Y0[2] = 0 +T1 = np.linspace(0, t_end, N) +T2 = np.linspace(0, t_end, N) +T3 = np.linspace(0, t_end, N) +T4 = np.linspace(0, t_end, N) +T5 = np.linspace(0, t_end, N) + +params[-4] = rho_a +params[-3] = 0 + +Y1 = odeint(toggle_model, Y0, T1, args=((tuple(params),))) + +params[-4] = 0 +Y2 = odeint(toggle_model, Y1[-1], T2, args=((tuple(params),))) + +params[-3] = rho_b +Y3 = odeint(toggle_model, Y2[-2], T3, args=((tuple(params),))) + +params[-3] = 0 +Y4 = odeint(toggle_model, Y3[-2], T4, args=((tuple(params),))) + +params[-3] = 0 +Y5 = odeint(toggle_model, Y4[-2], T5, args=((tuple(params),))) + +T2 += T1[-1] +T3 += T2[-1] +T4 += T3[-1] +T5 += T4[-1] + +Y = np.append(np.append(np.append(np.append(Y1, Y2, axis=0), Y3, axis=0), Y4, axis=0), Y5, axis=0) +T = np.append(np.append(np.append(np.append(T1, T2, axis=0), T3, axis=0), T4, axis=0), T5, axis=0) + +L_A = Y[:,0] +L_B = Y[:,1] +a = Y[:,2] +b = Y[:,3] +N_A = Y[:,4] +N_B = Y[:,5] + +ax1 = plt.subplot(311) +ax1.plot(T,L_A) +ax1.plot(T,L_B) +ax1.legend(["L_A", "L_B"]) + +ax2 = plt.subplot(312) +ax2.plot(T,a) +ax2.plot(T,b) +ax2.legend(["a", "b"]) + +ax3 = plt.subplot(313) +ax3.plot(T,N_A) +ax3.plot(T,N_B) +ax3.legend(["N_A", "N_B"]) + +#plt.plot(Y) +#plt.legend(["L_A", "L_B", "a", "b", "N_A", "N_B"]) +#plt.xticks([0, len(T)-1], [0, T[-1]]) + +plt.show() diff --git a/latch/test_model_ODE.py b/latch/test_model_ODE.py new file mode 100644 index 0000000..9c734ad --- /dev/null +++ b/latch/test_model_ODE.py @@ -0,0 +1,183 @@ +from scipy.integrate import ode +import matplotlib.pyplot as plt + +from models import * +from parameters import * + +params = [delta_L, gamma_A, gamma_B, n_a, n_b, theta_A, theta_B, eta_a, eta_b, omega_a, omega_b, m_a, m_b, delta_a, delta_b, rho_a, rho_b, r_A, r_B] +#params = [delta_L, gamma_A, gamma_A, n_a, n_a, theta_A, theta_A, eta_a, eta_a, omega_a, omega_a, m_a, m_a, delta_a, delta_a, rho_a, rho_a, r_A, r_A] +#params = [delta_L, gamma_B, gamma_B, n_b, n_b, theta_B, theta_B, eta_b, eta_b, omega_b, omega_b, m_b, m_b, delta_b, delta_b, rho_b, rho_b, r_B, r_B] + +# simulation parameters +t_end = 200 +N = t_end*2 + +# Y = L_A, L_B, a, b, N_A, N_B +Y0 = np.array([0]*6) +Y0[-2] = 1 +Y0[-1] = 1 +Y0[2] = 0 +T1 = np.linspace(0, t_end, N) +T2 = np.linspace(0, t_end, N) +T3 = np.linspace(0, t_end, N) +T4 = np.linspace(0, t_end, N) +T5 = np.linspace(0, t_end, N) + +# 1 + +params[-4] = rho_a +params[-3] = 0 + +t1 = t_end +dt = t_end/N +T1 = np.arange(0,t1+dt,dt) +Y1 = np.zeros([1+N,6]) +Y1[0,:] = Y0 + +r = ode(toggle_model_ODE).set_integrator('zvode', method='bdf') +r.set_initial_value(Y0, T1[0]).set_f_params(params) + +i = 1 +while r.successful() and r.t < t1: + Y1[i,:] = r.integrate(r.t+dt) + i += 1 + +# 2 + +params[-4] = 0 +params[-3] = 0 + +t1 = t_end +dt = t_end/N +T2 = np.arange(0,t1+dt,dt) +Y0 = Y1[-1,:] +Y2 = np.zeros([1+N,6]) +Y2[0,:] = Y0 + +r = ode(toggle_model_ODE).set_integrator('zvode', method='bdf') +r.set_initial_value(Y0, T2[0]).set_f_params(params) +i = 1 +while r.successful() and r.t < t1: + Y2[i,:] = r.integrate(r.t+dt) + i += 1 + +T2 += t_end + +# 3 + +params[-4] = 0 +params[-3] = rho_b + +t1 = t_end +dt = t_end/N +T3 = np.arange(0,t1+dt,dt) +Y0 = Y2[-1,:] +Y3 = np.zeros([1+N,6]) +Y3[0,:] = Y0 + +r = ode(toggle_model_ODE).set_integrator('zvode', method='bdf') +r.set_initial_value(Y0, T3[0]).set_f_params(params) +i = 1 +while r.successful() and r.t < t1: + Y3[i,:] = r.integrate(r.t+dt) + i += 1 + +T3 += 2*t_end + +# 4 + +params[-4] = 0 +params[-3] = 0 + +t1 = t_end +dt = t_end/N +T4 = np.arange(0,t1+dt,dt) +Y0 = Y3[-1,:] +Y4 = np.zeros([1+N,6]) +Y4[0,:] = Y0 + +r = ode(toggle_model_ODE).set_integrator('zvode', method='bdf') +r.set_initial_value(Y0, T4[0]).set_f_params(params) +i = 1 +while r.successful() and r.t < t1: + Y4[i,:] = r.integrate(r.t+dt) + i += 1 + +T4 += 3*t_end + +# 5 + +params[-4] = rho_a +params[-3] = 0 + +t1 = t_end +dt = t_end/N +T5 = np.arange(0,t1+dt,dt) +Y0 = Y4[-1,:] +Y5 = np.zeros([1+N,6]) +Y5[0,:] = Y0 + +r = ode(toggle_model_ODE).set_integrator('zvode', method='bdf') +r.set_initial_value(Y0, T5[0]).set_f_params(params) +i = 1 +while r.successful() and r.t < t1: + Y5[i,:] = r.integrate(r.t+dt) + i += 1 + +T5 += 4*t_end + + +""" +Y1 = odeint(toggle_model, Y0, T1, args=((tuple(params),))) + +params[-4] = 0 +Y2 = odeint(toggle_model, Y1[-1], T2, args=((tuple(params),))) + +params[-3] = rho_b +Y3 = odeint(toggle_model, Y2[-2], T3, args=((tuple(params),))) + +params[-3] = 0 +Y4 = odeint(toggle_model, Y3[-2], T4, args=((tuple(params),))) + +params[-3] = 0 +Y5 = odeint(toggle_model, Y4[-2], T5, args=((tuple(params),))) + +T2 += T1[-1] +T3 += T2[-1] +T4 += T3[-1] +T5 += T4[-1] + +Y = np.append(np.append(np.append(np.append(Y1, Y2, axis=0), Y3, axis=0), Y4, axis=0), Y5, axis=0) +T = np.append(np.append(np.append(np.append(T1, T2, axis=0), T3, axis=0), T4, axis=0), T5, axis=0) +""" + +Y = np.append(np.append(np.append(np.append(Y1, Y2, axis=0), Y3, axis=0), Y4, axis=0), Y5, axis=0) +T = np.append(np.append(np.append(np.append(T1, T2, axis=0), T3, axis=0), T4, axis=0), T5, axis=0) + +L_A = Y[:,0] +L_B = Y[:,1] +a = Y[:,2] +b = Y[:,3] +N_A = Y[:,4] +N_B = Y[:,5] + +ax1 = plt.subplot(311) +ax1.plot(T,L_A) +ax1.plot(T,L_B) +ax1.legend(["L_A", "L_B"]) + +ax2 = plt.subplot(312) +ax2.plot(T,a) +ax2.plot(T,b) +ax2.legend(["a", "b"]) + +ax3 = plt.subplot(313) +ax3.plot(T,N_A) +ax3.plot(T,N_B) +ax3.legend(["N_A", "N_B"]) + +#plt.plot(Y) +#plt.legend(["L_A", "L_B", "a", "b", "N_A", "N_B"]) +#plt.xticks([0, len(T)-1], [0, T[-1]]) + +plt.show() diff --git a/mux/check_T_f.py b/mux/check_T_f.py index a9f6d67..b527489 100644 --- a/mux/check_T_f.py +++ b/mux/check_T_f.py @@ -3,7 +3,7 @@ import numpy as np import matplotlib.pyplot as plt -from data import * +from parameters import * for name, max_val in zip(names[:], max_vals[:]): diff --git a/mux/direct_params.pickle b/mux/direct_params.pickle index 1722c20..fb6165a 100644 Binary files a/mux/direct_params.pickle and b/mux/direct_params.pickle differ diff --git a/mux/mux.py b/mux/mux.py index bee8f66..2caedab 100644 --- a/mux/mux.py +++ b/mux/mux.py @@ -2,7 +2,7 @@ import pickle from transfer import * -from data import * +from parameters import * with open('direct_params.pickle', 'rb') as handle: diff --git a/mux/out_macia.csv b/mux/out_macia.csv index 3338c19..b37c4b4 100644 --- a/mux/out_macia.csv +++ b/mux/out_macia.csv @@ -1,65 +1,65 @@ S_0,S_1,I_0,I_1,I_2,I_3,ch1,ch2,ch3,ch4,GFP1,GFP2,GFP3,GFP4 -0,0,0,0,0,0,2273.41,2874.94,3740.15,4731.50,20.13,8.97,3.72,2.01 -0,0,0,0,0,1,2273.41,2874.94,3740.15,3740.15,20.13,8.97,3.72,3.72 -0,0,0,0,1,0,2273.41,2874.94,3740.15,4731.50,20.13,8.97,3.72,2.01 -0,0,0,0,1,1,2273.41,2874.94,3740.15,3740.15,20.13,8.97,3.72,3.72 -0,0,0,1,0,0,2273.41,2816.34,3740.15,4731.50,20.13,9.64,3.72,2.01 -0,0,0,1,0,1,2273.41,2816.34,3740.15,3740.15,20.13,9.64,3.72,3.72 -0,0,0,1,1,0,2273.41,2816.34,3740.15,4731.50,20.13,9.64,3.72,2.01 -0,0,0,1,1,1,2273.41,2816.34,3740.15,3740.15,20.13,9.64,3.72,3.72 -0,0,1,0,0,0,1401.31,2874.94,3740.15,4731.50,65.31,8.97,3.72,2.01 -0,0,1,0,0,1,1401.31,2874.94,3740.15,3740.15,65.31,8.97,3.72,3.72 -0,0,1,0,1,0,1401.31,2874.94,3740.15,4731.50,65.31,8.97,3.72,2.01 -0,0,1,0,1,1,1401.31,2874.94,3740.15,3740.15,65.31,8.97,3.72,3.72 -0,0,1,1,0,0,1401.31,2816.34,3740.15,4731.50,65.31,9.64,3.72,2.01 -0,0,1,1,0,1,1401.31,2816.34,3740.15,3740.15,65.31,9.64,3.72,3.72 -0,0,1,1,1,0,1401.31,2816.34,3740.15,4731.50,65.31,9.64,3.72,2.01 -0,0,1,1,1,1,1401.31,2816.34,3740.15,3740.15,65.31,9.64,3.72,3.72 -0,1,0,0,0,0,2393.54,2874.94,3740.15,4731.50,16.95,8.97,3.72,2.01 -0,1,0,0,0,1,2393.54,2874.94,3740.15,3740.15,16.95,8.97,3.72,3.72 -0,1,0,0,1,0,2393.54,2874.94,3740.15,4731.50,16.95,8.97,3.72,2.01 -0,1,0,0,1,1,2393.54,2874.94,3740.15,3740.15,16.95,8.97,3.72,3.72 -0,1,0,1,0,0,2393.54,1070.80,3740.15,4731.50,16.95,84.64,3.72,2.01 -0,1,0,1,0,1,2393.54,1070.80,3740.15,3740.15,16.95,84.64,3.72,3.72 -0,1,0,1,1,0,2393.54,1070.80,3740.15,4731.50,16.95,84.64,3.72,2.01 -0,1,0,1,1,1,2393.54,1070.80,3740.15,3740.15,16.95,84.64,3.72,3.72 -0,1,1,0,0,0,2393.54,2874.94,3740.15,4731.50,16.95,8.97,3.72,2.01 -0,1,1,0,0,1,2393.54,2874.94,3740.15,3740.15,16.95,8.97,3.72,3.72 -0,1,1,0,1,0,2393.54,2874.94,3740.15,4731.50,16.95,8.97,3.72,2.01 -0,1,1,0,1,1,2393.54,2874.94,3740.15,3740.15,16.95,8.97,3.72,3.72 -0,1,1,1,0,0,2393.54,1070.80,3740.15,4731.50,16.95,84.64,3.72,2.01 -0,1,1,1,0,1,2393.54,1070.80,3740.15,3740.15,16.95,84.64,3.72,3.72 -0,1,1,1,1,0,2393.54,1070.80,3740.15,4731.50,16.95,84.64,3.72,2.01 -0,1,1,1,1,1,2393.54,1070.80,3740.15,3740.15,16.95,84.64,3.72,3.72 -1,0,0,0,0,0,870180.77,870180.77,3254.53,4731.50,1.00,1.00,5.84,2.01 -1,0,0,0,0,1,870180.77,870180.77,3254.53,2816.34,1.00,1.00,5.84,9.64 -1,0,0,0,1,0,870180.77,870180.77,1401.31,4731.50,1.00,1.00,65.31,2.01 -1,0,0,0,1,1,870180.77,870180.77,1401.31,2816.34,1.00,1.00,65.31,9.64 -1,0,0,1,0,0,870180.77,870180.77,3254.53,4731.50,1.00,1.00,5.84,2.01 -1,0,0,1,0,1,870180.77,870180.77,3254.53,2816.34,1.00,1.00,5.84,9.64 -1,0,0,1,1,0,870180.77,870180.77,1401.31,4731.50,1.00,1.00,65.31,2.01 -1,0,0,1,1,1,870180.77,870180.77,1401.31,2816.34,1.00,1.00,65.31,9.64 -1,0,1,0,0,0,870180.77,870180.77,3254.53,4731.50,1.00,1.00,5.84,2.01 -1,0,1,0,0,1,870180.77,870180.77,3254.53,2816.34,1.00,1.00,5.84,9.64 -1,0,1,0,1,0,870180.77,870180.77,1401.31,4731.50,1.00,1.00,65.31,2.01 -1,0,1,0,1,1,870180.77,870180.77,1401.31,2816.34,1.00,1.00,65.31,9.64 -1,0,1,1,0,0,870180.77,870180.77,3254.53,4731.50,1.00,1.00,5.84,2.01 -1,0,1,1,0,1,870180.77,870180.77,3254.53,2816.34,1.00,1.00,5.84,9.64 -1,0,1,1,1,0,870180.77,870180.77,1401.31,4731.50,1.00,1.00,65.31,2.01 -1,0,1,1,1,1,870180.77,870180.77,1401.31,2816.34,1.00,1.00,65.31,9.64 -1,1,0,0,0,0,870180.77,870180.77,3254.53,4731.50,1.00,1.00,5.84,2.01 -1,1,0,0,0,1,870180.77,870180.77,3254.53,1219.20,1.00,1.00,5.84,76.83 -1,1,0,0,1,0,870180.77,870180.77,2393.54,4731.50,1.00,1.00,16.95,2.01 -1,1,0,0,1,1,870180.77,870180.77,2393.54,1219.20,1.00,1.00,16.95,76.83 -1,1,0,1,0,0,870180.77,870180.77,3254.53,4731.50,1.00,1.00,5.84,2.01 -1,1,0,1,0,1,870180.77,870180.77,3254.53,1219.20,1.00,1.00,5.84,76.83 -1,1,0,1,1,0,870180.77,870180.77,2393.54,4731.50,1.00,1.00,16.95,2.01 -1,1,0,1,1,1,870180.77,870180.77,2393.54,1219.20,1.00,1.00,16.95,76.83 -1,1,1,0,0,0,870180.77,870180.77,3254.53,4731.50,1.00,1.00,5.84,2.01 -1,1,1,0,0,1,870180.77,870180.77,3254.53,1219.20,1.00,1.00,5.84,76.83 -1,1,1,0,1,0,870180.77,870180.77,2393.54,4731.50,1.00,1.00,16.95,2.01 -1,1,1,0,1,1,870180.77,870180.77,2393.54,1219.20,1.00,1.00,16.95,76.83 -1,1,1,1,0,0,870180.77,870180.77,3254.53,4731.50,1.00,1.00,5.84,2.01 -1,1,1,1,0,1,870180.77,870180.77,3254.53,1219.20,1.00,1.00,5.84,76.83 -1,1,1,1,1,0,870180.77,870180.77,2393.54,4731.50,1.00,1.00,16.95,2.01 -1,1,1,1,1,1,870180.77,870180.77,2393.54,1219.20,1.00,1.00,16.95,76.83 +0,0,0,0,0,0,7059.37,5900.65,7059.37,4846.62,1.18,1.39,1.18,1.91 +0,0,0,0,0,1,7059.37,5900.65,7059.37,10898.83,1.18,1.39,1.18,1.03 +0,0,0,0,1,0,7059.37,5900.65,7975.62,4846.62,1.18,1.39,1.11,1.91 +0,0,0,0,1,1,7059.37,5900.65,7975.62,10898.83,1.18,1.39,1.11,1.03 +0,0,0,1,0,0,7059.37,9780.75,7059.37,4846.62,1.18,1.04,1.18,1.91 +0,0,0,1,0,1,7059.37,9780.75,7059.37,10898.83,1.18,1.04,1.18,1.03 +0,0,0,1,1,0,7059.37,9780.75,7975.62,4846.62,1.18,1.04,1.11,1.91 +0,0,0,1,1,1,7059.37,9780.75,7975.62,10898.83,1.18,1.04,1.11,1.03 +0,0,1,0,0,0,12974.45,5900.65,7059.37,4846.62,1.01,1.39,1.18,1.91 +0,0,1,0,0,1,12974.45,5900.65,7059.37,10898.83,1.01,1.39,1.18,1.03 +0,0,1,0,1,0,12974.45,5900.65,7975.62,4846.62,1.01,1.39,1.11,1.91 +0,0,1,0,1,1,12974.45,5900.65,7975.62,10898.83,1.01,1.39,1.11,1.03 +0,0,1,1,0,0,12974.45,9780.75,7059.37,4846.62,1.01,1.04,1.18,1.91 +0,0,1,1,0,1,12974.45,9780.75,7059.37,10898.83,1.01,1.04,1.18,1.03 +0,0,1,1,1,0,12974.45,9780.75,7975.62,4846.62,1.01,1.04,1.11,1.91 +0,0,1,1,1,1,12974.45,9780.75,7975.62,10898.83,1.01,1.04,1.11,1.03 +0,1,0,0,0,0,22211.76,16225.35,22211.76,16225.35,1.00,1.00,1.00,1.00 +0,1,0,0,0,1,22211.76,16225.35,22211.76,16225.35,1.00,1.00,1.00,1.00 +0,1,0,0,1,0,22211.76,16225.35,22211.76,16225.35,1.00,1.00,1.00,1.00 +0,1,0,0,1,1,22211.76,16225.35,22211.76,16225.35,1.00,1.00,1.00,1.00 +0,1,0,1,0,0,22211.76,16225.35,22211.76,16225.35,1.00,1.00,1.00,1.00 +0,1,0,1,0,1,22211.76,16225.35,22211.76,16225.35,1.00,1.00,1.00,1.00 +0,1,0,1,1,0,22211.76,16225.35,22211.76,16225.35,1.00,1.00,1.00,1.00 +0,1,0,1,1,1,22211.76,16225.35,22211.76,16225.35,1.00,1.00,1.00,1.00 +0,1,1,0,0,0,22211.76,16225.35,22211.76,16225.35,1.00,1.00,1.00,1.00 +0,1,1,0,0,1,22211.76,16225.35,22211.76,16225.35,1.00,1.00,1.00,1.00 +0,1,1,0,1,0,22211.76,16225.35,22211.76,16225.35,1.00,1.00,1.00,1.00 +0,1,1,0,1,1,22211.76,16225.35,22211.76,16225.35,1.00,1.00,1.00,1.00 +0,1,1,1,0,0,22211.76,16225.35,22211.76,16225.35,1.00,1.00,1.00,1.00 +0,1,1,1,0,1,22211.76,16225.35,22211.76,16225.35,1.00,1.00,1.00,1.00 +0,1,1,1,1,0,22211.76,16225.35,22211.76,16225.35,1.00,1.00,1.00,1.00 +0,1,1,1,1,1,22211.76,16225.35,22211.76,16225.35,1.00,1.00,1.00,1.00 +1,0,0,0,0,0,32330053.96,32330053.96,10261.70,10261.70,1.00,1.00,1.04,1.04 +1,0,0,0,0,1,32330053.96,32330053.96,10261.70,10898.83,1.00,1.00,1.04,1.03 +1,0,0,0,1,0,32330053.96,32330053.96,10261.70,10261.70,1.00,1.00,1.04,1.04 +1,0,0,0,1,1,32330053.96,32330053.96,10261.70,10898.83,1.00,1.00,1.04,1.03 +1,0,0,1,0,0,32330053.96,32330053.96,10261.70,10261.70,1.00,1.00,1.04,1.04 +1,0,0,1,0,1,32330053.96,32330053.96,10261.70,10898.83,1.00,1.00,1.04,1.03 +1,0,0,1,1,0,32330053.96,32330053.96,10261.70,10261.70,1.00,1.00,1.04,1.04 +1,0,0,1,1,1,32330053.96,32330053.96,10261.70,10898.83,1.00,1.00,1.04,1.03 +1,0,1,0,0,0,32330053.96,32330053.96,10261.70,10261.70,1.00,1.00,1.04,1.04 +1,0,1,0,0,1,32330053.96,32330053.96,10261.70,10898.83,1.00,1.00,1.04,1.03 +1,0,1,0,1,0,32330053.96,32330053.96,10261.70,10261.70,1.00,1.00,1.04,1.04 +1,0,1,0,1,1,32330053.96,32330053.96,10261.70,10898.83,1.00,1.00,1.04,1.03 +1,0,1,1,0,0,32330053.96,32330053.96,10261.70,10261.70,1.00,1.00,1.04,1.04 +1,0,1,1,0,1,32330053.96,32330053.96,10261.70,10898.83,1.00,1.00,1.04,1.03 +1,0,1,1,1,0,32330053.96,32330053.96,10261.70,10261.70,1.00,1.00,1.04,1.04 +1,0,1,1,1,1,32330053.96,32330053.96,10261.70,10898.83,1.00,1.00,1.04,1.03 +1,1,0,0,0,0,32330053.96,32330053.96,22211.76,16225.35,1.00,1.00,1.00,1.00 +1,1,0,0,0,1,32330053.96,32330053.96,22211.76,16225.35,1.00,1.00,1.00,1.00 +1,1,0,0,1,0,32330053.96,32330053.96,22211.76,16225.35,1.00,1.00,1.00,1.00 +1,1,0,0,1,1,32330053.96,32330053.96,22211.76,16225.35,1.00,1.00,1.00,1.00 +1,1,0,1,0,0,32330053.96,32330053.96,22211.76,16225.35,1.00,1.00,1.00,1.00 +1,1,0,1,0,1,32330053.96,32330053.96,22211.76,16225.35,1.00,1.00,1.00,1.00 +1,1,0,1,1,0,32330053.96,32330053.96,22211.76,16225.35,1.00,1.00,1.00,1.00 +1,1,0,1,1,1,32330053.96,32330053.96,22211.76,16225.35,1.00,1.00,1.00,1.00 +1,1,1,0,0,0,32330053.96,32330053.96,22211.76,16225.35,1.00,1.00,1.00,1.00 +1,1,1,0,0,1,32330053.96,32330053.96,22211.76,16225.35,1.00,1.00,1.00,1.00 +1,1,1,0,1,0,32330053.96,32330053.96,22211.76,16225.35,1.00,1.00,1.00,1.00 +1,1,1,0,1,1,32330053.96,32330053.96,22211.76,16225.35,1.00,1.00,1.00,1.00 +1,1,1,1,0,0,32330053.96,32330053.96,22211.76,16225.35,1.00,1.00,1.00,1.00 +1,1,1,1,0,1,32330053.96,32330053.96,22211.76,16225.35,1.00,1.00,1.00,1.00 +1,1,1,1,1,0,32330053.96,32330053.96,22211.76,16225.35,1.00,1.00,1.00,1.00 +1,1,1,1,1,1,32330053.96,32330053.96,22211.76,16225.35,1.00,1.00,1.00,1.00 diff --git a/mux/data.py b/mux/parameters.py similarity index 100% rename from mux/data.py rename to mux/parameters.py diff --git a/mux/reverse_params.py b/mux/reverse_params.py index e3261ee..c530381 100644 --- a/mux/reverse_params.py +++ b/mux/reverse_params.py @@ -7,7 +7,7 @@ from mux import * from transfer import * -from data import * +from parameters import * bounds_ID = ([min_gamma, min_alpha1, min_alpha2, min_omega1, min_omega2, min_n], [max_gamma, max_alpha1, max_alpha2, max_omega1, max_omega2, max_n]) @@ -15,6 +15,8 @@ bounds_NOT = ([min_gamma, min_alpha1, min_alpha2, min_omega1, min_omega2, min_n], [max_gamma, max_alpha1, max_alpha2+4, max_omega1, max_omega2, max_n]) +reverse_from = "NOT_mCherry" + direct_params = {} plot_on = True @@ -28,7 +30,7 @@ """ y = T_f(x, *params[cells["ID_"+name]]) - GFP_x = iT_f(y,*params[cells["NOT_GFP"]]) + GFP_x = iT_f(y,*params[cells[reverse_from]]) idx = np.isfinite(GFP_x) x1 = x[idx] @@ -50,7 +52,7 @@ if plot_on: plt.plot(x1,y1, label = "ID_"+name) - plt.plot(x1,GFP_x, label = "GFP_x") + plt.plot(x1,GFP_x, label = "reversed "+reverse_from) plt.plot(x1, y_fit1, label = "fit") #plt.plot(x1, y_fit11, label = "fit no bounds") plt.legend() @@ -70,7 +72,7 @@ """ not_y = T_f(x, *params[cells["NOT_"+name]]) - not_GFP_x = iT_f(not_y,*params[cells["NOT_GFP"]]) + not_GFP_x = iT_f(not_y,*params[cells[reverse_from]]) idx = np.isfinite(not_GFP_x) x2 = x[idx] @@ -91,7 +93,7 @@ if plot_on: plt.plot(x2,y2, label = "NOT_"+name) - plt.plot(x2,not_GFP_x, label = "NOT_GFP_x") + plt.plot(x2,not_GFP_x, label = "reversed "+reverse_from) plt.plot(x2, y_fit2, label = "fit") #plt.plot(x2, y_fit22, label = "fit no bounds") plt.legend()