Location: Reproducibility study of Computational modelling of glucose uptake by SGLT1 and GLUT2 in the enterocyte @ 6e51b0b7b641 / Figure01.py

Author:
nima <nafs080@aucklanduni.ac.nz>
Date:
2022-04-05 19:04:25+12:00
Desc:
Updated Python Scripts
Permanent Source URI:
https://models.physiomeproject.org/workspace/840/rawfile/6e51b0b7b64171080f85f8fd67242c31b9044607/Figure01.py

import opencor as opencor
import numpy as np
import matplotlib.pyplot as plt
# matplotlib.use('agg')

# load the reference model
simulation = opencor.open_simulation("../res/figure2.sedml")
data = simulation.data()


def run_sim_glut():
    simulation.reset(True)
    simulation.clear_results()
    # data.constants()["Apical_concentrations/glucose_m"] = 0.05
    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.005
    data.constants()["A_GLUT2/n_GLUT"] = 2e8
    data.constants()["GLUT2/n_GLUT"] = 2e8
    data.constants()["Blood_concentrations/Q_in"] = 1e-17
    data.constants()["phenomonological_constants/n_SGLT"] = 3e7
    # remove the following lines
    data.constants()["parameters/k0_12"] = 12000
    data.constants()["parameters/k0_61"] = 15

    data.set_starting_point(0)
    data.set_ending_point(10000)
    data.set_point_interval(10)
    simulation.run()


    ds = simulation.results().data_store()

    time = ds.voi_and_variables()["parameters/time"].values()
    v_cell = ds.voi_and_variables()["Cell_concentration/v_cell"].values()*1e18
    Na_i = ds.voi_and_variables()["Cell_concentration/Na_i"].values()*1e3
    Cl_i = ds.voi_and_variables()["Cell_concentration/Cl_i"].values()*1e3
    K_i = ds.voi_and_variables()["Cell_concentration/K_i"].values()*1e3
    glucose_i = ds.voi_and_variables()["Cell_concentration/glucose_i"].values()*1e3
    J_w_A = ds.voi_and_variables()["Cell_concentration/J_w_A"].values()
    J_w_B = ds.voi_and_variables()["Cell_concentration/J_w_B"].values()*-1
    glucose_s = ds.voi_and_variables()["Blood_concentrations/glucose_s"].values()*1e3

    return(time, v_cell, Na_i, Cl_i, K_i, glucose_i, J_w_A, J_w_B, glucose_s)

def run_sim_noglut():
    simulation.reset(True)
    simulation.clear_results()
    data.constants()["A_GLUT2/n_GLUT"] = 0.0
    data.constants()["Cell_concentration/L_A"] = 6e-5
    data.constants()["Cell_concentration/L_B"] = 6e-5
    data.constants()["GLUT2/n_GLUT"] = 2e8
    data.constants()["Blood_concentrations/Q_in"] = 1e-17
    data.constants()["phenomonological_constants/n_SGLT"] = 3e7
    # remove the following lines
    data.constants()["parameters/k0_12"] = 12000
    data.constants()["parameters/k0_61"] = 15

    data.set_starting_point(0)
    data.set_ending_point(10000)
    data.set_point_interval(10)
    simulation.run()

    ds = simulation.results().data_store()

    time = ds.voi_and_variables()["parameters/time"].values()
    v_cell = ds.voi_and_variables()["Cell_concentration/v_cell"].values() * 1e18
    Na_i = ds.voi_and_variables()["Cell_concentration/Na_i"].values() * 1e3
    Cl_i = ds.voi_and_variables()["Cell_concentration/Cl_i"].values() * 1e3
    K_i = ds.voi_and_variables()["Cell_concentration/K_i"].values() * 1e3
    glucose_i = ds.voi_and_variables()["Cell_concentration/glucose_i"].values() * 1e3
    J_w_A = ds.voi_and_variables()["Cell_concentration/J_w_A"].values()
    J_w_B = ds.voi_and_variables()["Cell_concentration/J_w_B"].values() * -1
    glucose_s = ds.voi_and_variables()["Blood_concentrations/glucose_s"].values() * 1e3

    return(time, v_cell, Na_i, Cl_i, K_i, glucose_i, J_w_A, J_w_B, glucose_s)




if __name__ == '__main__':
    results1 = run_sim_glut()
    results2 = run_sim_noglut()
    plt.figure(figsize=(12,12))
    plt.subplot(4,2,1)
    plt.plot(results1[0], results1[1], label= 'With GLUT2', linewidth= '2')
    plt.plot(results2[0], results2[1], label= 'Without GLUT2', linewidth= '2')
    plt.xlim(2000, 10000)
    plt.tick_params(axis='both', labelsize=12)
    plt.title('A', fontsize = 12)
    plt.legend(loc= 'best', fontsize= 11)

    plt.subplot(4,2,2)
    plt.plot(results1[0], results1[2], label= 'With GLUT2', linewidth= '2')
    plt.plot(results2[0], results2[2], label= 'Without GLUT2', linewidth= '2')
    plt.xlim(2000, 10000)
    plt.tick_params(axis='both', labelsize=11)
    plt.title('B', fontsize = 12)
    # plt.legend(loc= 'best', fontsize= 12)

    plt.subplot(4, 2, 3)
    plt.plot(results1[0], results1[3], label='With GLUT2', linewidth='2')
    plt.plot(results2[0], results2[3], label='Without GLUT2', linewidth='2')
    plt.xlim(2000, 10000)
    plt.tick_params(axis='both', labelsize=11)
    plt.title('C', fontsize=12)

    plt.subplot(4, 2, 4)
    plt.plot(results1[0], results1[4], label='With GLUT2', linewidth='2')
    plt.plot(results2[0], results2[4], label='Without GLUT2', linewidth='2')
    plt.xlim(2000, 10000)
    plt.tick_params(axis='both', labelsize=11)
    plt.title('D', fontsize=12)

    plt.subplot(4, 2, 5)
    plt.plot(results1[0], results1[5], label='With GLUT2', linewidth='2')
    plt.plot(results2[0], results2[5], label='Without GLUT2', linewidth='2')
    plt.xlim(2000, 10000)
    plt.tick_params(axis='both', labelsize=11)
    plt.title('E', fontsize=12)

    plt.subplot(4, 2, 6)
    plt.plot(results1[0], results1[6], label='With GLUT2', linewidth='2')
    plt.plot(results2[0], results2[6], label='Without GLUT2', linewidth='2')
    plt.xlim(2000, 10000)
    plt.tick_params(axis='both', labelsize=11)
    plt.ticklabel_format(axis= "y", style="sci", scilimits= (0,0))
    plt.title('F', fontsize=12)

    plt.subplot(4, 2, 7)
    plt.plot(results1[0], results1[7], label='With GLUT2', linewidth='2')
    plt.plot(results2[0], results2[7], label='Without GLUT2', linewidth='2')
    plt.xlim(2000, 10000)
    plt.tick_params(axis='both', labelsize=11)
    plt.title('G', fontsize=12)

    plt.subplot(4, 2, 8)
    plt.plot(results1[0], results1[8], label='With GLUT2', linewidth='2')
    plt.plot(results2[0], results2[8], label='Without GLUT2', linewidth='2')
    plt.xlim(2000, 10000)
    plt.yticks(np.arange(0, 12, 2.5))
    plt.tick_params(axis='both', labelsize=11)
    plt.title('H', fontsize=12)

    plt.subplots_adjust(left=0.1,
                        bottom=0.1,
                        right=0.9,
                        top=0.9,
                        wspace=0.4,
                        hspace=0.4)

    plt.savefig('Figure02.png')
    plt.show()