- Author:
- soroush <ssaf006@aucklanduni.ac.nz>
- Date:
- 2022-09-07 10:24:08+12:00
- Desc:
- adding labels.
- Permanent Source URI:
- https://models.physiomeproject.org/workspace/840/rawfile/996f990613016a37eedc1d35f1a4c298e30002ea/Figure03.py
# To reproduce Figure 1 in the associated Physiome paper,
# execute this script from the command line:
#
# cd [PathToThisFile]
# [PathToOpenCOR]/pythonshell Figure3.py
import opencor as opencor
import numpy as np
import matplotlib.pyplot as plt
simulation = opencor.open_simulation("model.sedml")
data = simulation.data()
simulation.reset(True)
# results = dict()
def run_sim_glut(glucose_m):
# reset everything in case we are running interactively and have existing results
simulation.reset(True)
simulation.clear_results()
data.constants()["Cell_concentration/L_A"] = 6e-5
data.constants()["Cell_concentration/L_B"] = 6e-5
data.constants()["Blood_concentrations/v_B"] = 1e-16
data.constants()["Blood_concentrations/glucose_in"] = 0.004
data.constants()["Blood_concentrations/Q_in"] = 9e-18
# data.constants()["Blood_concentrations/v_w1"] = 1.8e-4
data.constants()["phenomonological_constants/n_SGLT"] = 3e7
data.constants()["parameters/k0_12"] = 12000
data.constants()["parameters/k0_61"] = 15
data.constants()["Apical_concentrations/glucose_m"] = glucose_m
if glucose_m == 0:
data.constants()["A_GLUT2/n_GLUT"] = 0.5e8
else:
data.constants()["A_GLUT2/n_GLUT"] = 1e8
data.set_starting_point(0)
data.set_ending_point(10000)
data.set_point_interval(10)
simulation.run()
ds = simulation.results().data_store()
v_cell = ds.voi_and_variables()["Cell_concentration/v_cell"].values()[-1]*1e18
glucose_i = ds.voi_and_variables()["Cell_concentration/glucose_i"].values()[-1]*1e3
glucose_s = ds.voi_and_variables()["Blood_concentrations/glucose_s"].values()[-1]*1e3
J_A_GLUT = ds.voi_and_variables()["A_GLUT2/J_A_GLUT"].values()[-1]
J_GL_SGLT = ds.voi_and_variables()["phenomonological_constants/J_Gl_SGLT"].values()[-1]
J_GLUT = ds.voi_and_variables()["GLUT2/J_GLUT"].values()[-1]*-1
return (v_cell, glucose_i, glucose_s, J_A_GLUT, J_GL_SGLT, J_GLUT)
def run_sim_noglut(glucose_m):
# reset everything in case we are running interactively and have existing results
simulation.reset(True)
simulation.clear_results()
data.constants()["Cell_concentration/L_A"] = 6e-5
data.constants()["Cell_concentration/L_B"] = 6e-5
data.constants()["Blood_concentrations/v_B"] = 1e-16
data.constants()["Blood_concentrations/glucose_in"] = 0.004
data.constants()["Blood_concentrations/Q_in"] = 9e-18
# data.constants()["Blood_concentrations/v_w1"] = 1.8e-4
data.constants()["phenomonological_constants/n_SGLT"] = 3e7
data.constants()["parameters/k0_12"] = 12000
data.constants()["parameters/k0_61"] = 15
data.constants()["Apical_concentrations/glucose_m"] = glucose_m
data.constants()["A_GLUT2/n_GLUT"] = 0
data.set_starting_point(0)
data.set_ending_point(10000)
data.set_point_interval(10)
simulation.run()
ds = simulation.results().data_store()
v_cell = ds.voi_and_variables()["Cell_concentration/v_cell"].values()[-1]*1e18
glucose_i = ds.voi_and_variables()["Cell_concentration/glucose_i"].values()[-1]*1e3
glucose_s = ds.voi_and_variables()["Blood_concentrations/glucose_s"].values()[-1]*1e3
J_A_GLUT = ds.voi_and_variables()["A_GLUT2/J_A_GLUT"].values()[-1]
J_GL_SGLT = ds.voi_and_variables()["phenomonological_constants/J_Gl_SGLT"].values()[-1]
J_GLUT = ds.voi_and_variables()["GLUT2/J_GLUT"].values()[-1]*-1
return (v_cell, glucose_i, glucose_s, J_A_GLUT, J_GL_SGLT, J_GLUT)
if __name__ == '__main__':
# different values for luminal glucose
glucose_m = [0, 0.02, 0.05, 0.08, 0.1]
plt.figure(figsize = (12,12))
X = [0, 20, 50, 80, 100]
plt.subplot(3,2,1)
result1 = run_sim_glut(glucose_m[0])
result2 = run_sim_glut(glucose_m[1])
result3 = run_sim_glut(glucose_m[2])
result4 = run_sim_glut(glucose_m[3])
result5 = run_sim_glut(glucose_m[4])
Y1 = [result1[0], result2[0], result3[0], result4[0], result5[0]]
result6 = run_sim_noglut(glucose_m[0])
result7 = run_sim_noglut(glucose_m[1])
result8 = run_sim_noglut(glucose_m[2])
result9 = run_sim_noglut(glucose_m[3])
result10 = run_sim_noglut(glucose_m[4])
Y2 = [result6[0], result7[0], result8[0], result9[0], result10[0]]
plt.plot(X, Y1, label= 'With GLUT2', linewidth = 3)
plt.plot(X, Y2, label= 'Without GLUT2', linewidth = 3)
plt.title('A', fontsize = 14)
plt.xlabel('', fontsize=14)
plt.ylabel('v$_{cell}$ ($\mu m^3$)', fontsize=14)
plt.legend(loc= 'best', fontsize= 12)
plt.tick_params(axis = 'both', labelsize=11)
plt.tight_layout()
plt.subplot(3, 2, 2)
Y1 = [result1[1], result2[1], result3[1], result4[1], result5[1]]
Y2 = [result6[1], result7[1], result8[1], result9[1], result10[1]]
plt.plot(X, Y1, label='With GLUT2', linewidth=3)
plt.plot(X, Y2, label='Without GLUT2', linewidth=3)
plt.title('B', fontsize=14)
plt.xlabel('', fontsize=14)
plt.ylabel('Gl$_i$ (mM)', fontsize=14)
# plt.legend(loc='best', fontsize=12)
plt.tick_params(axis='both', labelsize=11)
plt.subplot(3, 2, 3)
Y1 = [result1[2], result2[2], result3[2], result4[2], result5[2]]
Y2 = [result6[2], result7[2], result8[2], result9[2], result10[2]]
plt.plot(X, Y1, label='With GLUT2', linewidth=3)
plt.plot(X, Y2, label='Without GLUT2', linewidth=3)
plt.title('C', fontsize=14)
plt.xlabel('', fontsize=14)
plt.ylabel('Gl$_b$ (mM)', fontsize=14)
# plt.legend(loc='best', fontsize=12)
plt.tick_params(axis='both', labelsize=11)
plt.subplot(3, 2, 4)
Y1 = [result1[3], result2[3], result3[3], result4[3], result5[3]]
Y2 = [result6[3], result7[3], result8[3], result9[3], result10[3]]
plt.plot(X, Y1, label='With GLUT2', linewidth=3)
plt.plot(X, Y2, label='Without GLUT2', linewidth=3)
plt.title('D', fontsize=14)
plt.xlabel('', fontsize=14)
plt.ylabel('J$_{A_{GLUT2}}$ ($\mu$m/s)', fontsize=14)
# plt.legend(loc='best', fontsize=12)
plt.tick_params(axis='both', labelsize=11)
plt.subplot(3, 2, 5)
Y1 = [result1[4], result2[4], result3[4], result4[4], result5[4]]
Y2 = [result6[4], result7[4], result8[4], result9[4], result10[4]]
plt.plot(X, Y1, label='With GLUT2', linewidth=3)
plt.plot(X, Y2, label='Without GLUT2', linewidth=3)
plt.title('E', fontsize=14)
plt.xlabel('Luminal Glucose (mM)', fontsize=14)
plt.ylabel('J$_{SGLT1}$ ($\mu$m/s)', fontsize=14)
# plt.legend(loc='best', fontsize=12)
plt.tick_params(axis='both', labelsize=11)
plt.subplot(3, 2, 6)
Y1 = [result1[5], result2[5], result3[5], result4[5], result5[5]]
Y2 = [result6[5], result7[5], result8[5], result9[5], result10[5]]
plt.plot(X, Y1, label='With GLUT2', linewidth=3)
plt.plot(X, Y2, label='Without GLUT2', linewidth=3)
plt.title('F', fontsize=14)
plt.xlabel('Luminal Glucose (mM)', fontsize=14)
plt.ylabel('J$_{B_{GLUT2}}$ ($\mu$m/s)', fontsize=14)
# plt.legend(loc='best', fontsize=12)
plt.tick_params(axis='both', labelsize=11)
plt.subplots_adjust(left=0.1,
bottom=0.1,
right=0.9,
top=0.9,
wspace=0.4,
hspace=0.4)
plt.savefig('Figure03.png')
plt.show()