- Author:
- WeiweiAi <wai484@aucklanduni.ac.nz>
- Date:
- 2022-01-25 17:00:51+13:00
- Desc:
- wholeCell
0: base model, dynamic Nai, Ki and Cli
1: C++, dynamic Nai, Ki and Cli
2: base model, constant Nai, Ki and Cli
3: C++, constant Nai, Ki and Cli
- Permanent Source URI:
- https://staging.physiomeproject.org/workspace/701/rawfile/94a7b120ab1b692d753de772f9ed81e297a577ab/Simulation/src/gatePlot.py
# To plot the gating variables steady state and time constants
def steadyPlot(simFign,sedversions,outKeys):
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Set figure dimension (width, height) in inches.
fw, fh = 6, 6
fig = plt.figure(figsize=(fw,fh))
# Set subplots
subpRow, subpCol = 1, 1
ax, lns = {}, {}
# This gives list with the colors from the cycle, which you can use to iterate over.
cycle = plt.rcParams['axes.prop_cycle'].by_key()['color']
cline = ['.','-.',':','--',]
# Set subplots
lfontsize, labelfontsize = 12, 12 # legend, label fontsize
# Read data from the files
x_name = 'V'
y_name = outKeys
y_label1 = y_name.replace('outputs/', '$')
y_label = y_label1.replace('_inf', '_{\infty}$')
for i, varName in enumerate([y_name]):
ax[i] = fig.add_subplot(subpRow, subpCol, i+1)
for j, sedversion in enumerate(sedversions):
# The saved output file name
filename = '../simulatedData/simVramp_%s.csv' % sedversion
data = pd.read_csv(filename)
x_data = data[x_name]
y_data = data[varName]
ax[i].plot(x_data, y_data, cline[j], color=cycle[j+1], label = 'CellML_V%s' % sedversion)
ofilename ='../originalData/%s.csv' %simFign
odata = pd.read_csv(ofilename)
ox_data = odata['x']
oy_data = odata['Curve1']
ax[i].plot(ox_data, oy_data, '.', color=cycle[0], label = 'Testrow_et_al_2018')
plt.tick_params(direction='in', axis='both')
ax[i].legend(loc = 'best', fontsize=lfontsize, frameon=False)
ax[i].set_xlabel ('Voltage (mV)', fontsize= labelfontsize)
ax[i].set_ylabel (y_label, fontsize= labelfontsize)
ax[i].set_title('%s in the primary publication' % (simFign))
figfiles = '../sim%s.png' % (simFign)
plt.savefig(figfiles)
plt.show()
def tauPlot(simFign, sedversions, outKeys,logflag,sflag):
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Set figure dimension (width, height) in inches.
fw, fh = 6, 6
fig = plt.figure(figsize=(fw,fh))
# Set subplots
subpRow, subpCol = 1, 1
ax, lns = {}, {}
# This gives list with the colors from the cycle, which you can use to iterate over.
cycle = plt.rcParams['axes.prop_cycle'].by_key()['color']
cline = ['.','-.',':','--',]
# Set subplots
lfontsize, labelfontsize = 12, 12 # legend, label fontsize
# Read data from the files
x_name = 'V'
y_name = outKeys
y_label1 = y_name.replace('outputs/', '$\\')
y_label1 = y_label1.replace('_', '_{')
y_lable= y_label1+'}$'
for i, varName in enumerate([y_name]):
ax[i] = fig.add_subplot(subpRow, subpCol, i+1)
for j, sedversion in enumerate(sedversions):
# The saved output file name
filename = '../simulatedData/simVramp_%s.csv' % sedversion
data = pd.read_csv(filename)
x_data = data[x_name]
if sflag==1:
y_data = data[varName]/1000
y_lable= y_label1+'}$ (s)'
else:
y_data = data[varName]
y_lable= y_label1+'}$ (ms)'
ax[i].plot(x_data, y_data, cline[j], color=cycle[j+1], label = 'CellML_V%s' % sedversion)
ofilename ='../originalData/%s.csv' %simFign
odata = pd.read_csv(ofilename)
ox_data = odata['x']
oy_data = odata['Curve1']
ax[i].plot(ox_data, oy_data, '.', color=cycle[0], label = 'Testrow_et_al_2018')
plt.tick_params(direction='in', axis='both')
ax[i].legend(loc = 'best', fontsize=lfontsize, frameon=False)
ax[i].set_xlabel ('Voltage (mV)', fontsize= labelfontsize)
ax[i].set_ylabel (y_lable, fontsize= labelfontsize)
ax[i].set_title('%s in the primary publication' % (simFign))
if logflag==1:
ax[i].set_yscale('log')
figfiles = '../sim%s.png' % (simFign)
plt.savefig(figfiles)
plt.show()