- Author:
- Weiwei Ai <wai484@aucklanduni.ac.nz>
- Date:
- 2024-10-21 14:11:01+13:00
- Desc:
- Modify SGLT1_BG_fast.cellml to allow users to modify test_volt and Glco in the simulation tab.
- Permanent Source URI:
- https://models.fieldml.org/workspace/b65/rawfile/65898d4880efb52227f2860ddafb4c8cde585d47/src/plot_GLUT2.py
import os
import sys
# Get the directory containing the current file
current_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(current_dir, '../dataPlot/'))
from dataPlot import plot_line2D, subplots_ajdust
path_=os.path.join(current_dir, '../Facilitated transporter/CellMLV2/sim_results/')
save_fig = {'save_fig': True, 'fig_format': 'png', 'file_path': path_, 'filename': 'GLUT2_fit_ss_new'}
filename = path_+'report_task_GLUT2_kinetic.csv'
filename_BG_io = path_+'GLUT2_BG_ss_io.csv'
filename_BG_oi = path_+'GLUT2_BG_ss_oi.csv'
filename_ss_io = path_+'report_task_GLUT2_ss_io.csv'
filename_ss_oi = path_+'report_task_GLUT2_ss_oi.csv'
Vi=0.09
outputs={'glu':{'component':'main','name':'glu','scale':1},
'v_io_ss':{'component':'main','name':'v_io_ss','scale':1},
'v_oi_ss':{'component':'main','name':'v_oi_ss','scale':1},
}
subtitle_kwargs={}
fig_cfg = {'num_rows': 1, 'num_cols': 2, 'width':8, 'height':3, 'fig_title': None, 'title_y': 1, 'fontsize': 8,
'left': 0.1, 'bottom': 0.25, 'right': 0.95, 'top': 0.98, 'wspace': 0.3, 'hspace': 0.1}
fig, axs= subplots_ajdust(fig_cfg, **subtitle_kwargs)
plot_cfg = {}
line_cfg = {}
N=len(outputs)
for i, output in enumerate(outputs):
if i>0:
line_cfg[i] = { 'xdata': (filename,'glu'), 'ydata':(filename,output),
'color': 'b', 'marker': '.', 'linestyle': '', 'label': 'Lowe AG & Walmsley AR (1986)'}
line_cfg[3] = { 'xdata': (filename_BG_io,'q_init_Ai'), 'ydata':(filename_BG_io,'v_r1'),
'color': 'k', 'linestyle': '-', 'label': 'Bond graph'}
line_cfg[4] = { 'xdata': (filename_BG_oi,'q_init_Ao'), 'ydata':(filename_BG_oi,'v_r1'),
'color': 'k', 'linestyle': '-', 'label': 'Bond graph'}
line_cfg[5] = { 'xdata': (filename_ss_io,'q_Ai'), 'ydata':(filename_ss_io,'v_free'),
'color': 'r', 'linestyle': '--', 'label': 'Steady-state Eq 19'}
line_cfg[6] = { 'xdata': (filename_ss_oi,'q_Ao'), 'ydata':(filename_ss_oi,'v_free'),
'color': 'r', 'linestyle': '--', 'label': 'Steady-state Eq 19'}
line_cfg[7] = { 'xdata': (filename_ss_io,'q_Ai'), 'ydata':(filename_ss_io,'v'),
'color': 'm', 'linestyle': '-.', 'label': 'Steady-state Eqs 19 and 20'}
line_cfg[8] = { 'xdata': (filename_ss_oi,'q_Ao'), 'ydata':(filename_ss_oi,'v'),
'color': 'm', 'linestyle': '-.', 'label': 'Steady-state Eqs 19 and 20'}
plot_cfg[2] = {'ylabel': 'Outward flux (mM/s)', 'xlabel': '$[A]_i$ (mM)','show_grid': 'both', 'grid_axis': 'both', 'title': '(b)', 'title_y': -0.3,
'line': [1,3,5,7], 'legend': [1,3,5,7]}
plot_cfg[1] = {'ylabel': 'Inward flux (mM/s)', 'xlabel': '$[A]_o$ (mM)','show_grid': 'both', 'grid_axis': 'both', 'title': '(a)', 'title_y': -0.3,
'line': [2,4,6,8], 'legend': [2,4,6,8]}
plot_line2D(axs, plot_cfg, line_cfg, save_fig)