Location: Hodgkin & Huxley (1952) model @ ab2962b87966 / BG / scripts_BG / AP.py

Author:
WeiweiAi <wai484@aucklanduni.ac.nz>
Date:
2022-03-31 10:48:40+13:00
Desc:
Add open channel IV of HH models; Add simulation and plot python scripts
Permanent Source URI:
https://staging.physiomeproject.org/workspace/64f/rawfile/ab2962b8796666ad9938a2577611c954f006b5fd/BG/scripts_BG/AP.py

# importing modules
from asyncio import constants
import sys as sys
import os 
import numpy
import opencor as oc
import pandas as pd 
# getting the name of the directory
# where the this file is present.
current = os.path.dirname(os.path.realpath(__file__))  # scripts_BG
# Getting the parent directory name
# where the current directory is present.
parent = os.path.dirname(current) # BG
gparent = os.path.dirname(parent) # VPH-MIP
mpath = gparent + '\\cellLib\\src'
# appending a path
sys.path.append(mpath)
import simExp

start, ending, pointInterval = 0, 20, 0.01

simfile = gparent+'\\sed-ml\\periodic-stimulus.sedml'
savefiles=[current+'\\AP_HH']
indexStart = 0
indexEnd = int(ending/pointInterval) + 1 
varSet = {'boundary_conditions/V_b':{'constants':0}}
varLoop = {'initial_conditions/V_initial':{'constants':numpy.array([-15])}}
varSave = {'time':{'voi':False},'outputs/V':{'states':False},'outputs/INa':{'algebraic':False},'outputs/IK':{'algebraic':False},'outputs/Ileak':{'algebraic':False},
'outputs/Ii':{'algebraic':False},'outputs/gNa':{'algebraic':False},'outputs/gK':{'algebraic':False}}

simExp.simExp(simfile, savefiles,start, ending, pointInterval,indexStart,indexEnd,varSet,varLoop,varSave)

start, ending, pointInterval = 0, 0.02, 0.00001

simfile = parent+'\\stimulated_BG.cellml'
savefiles=[current+'\\AP_BG']
indexStart = 0
indexEnd = int(ending/pointInterval) + 1  
varSet = {'depolarization/q_m_init':{'constants':-15000000}}
varLoop = {'depolarization/q_m_init':{'constants':numpy.array([-15000000])}}
varSave = {'time':{'voi':False},'outputs/V_m':{'algebraic':False},'outputs/I_Na':{'algebraic':False},'outputs/I_K':{'algebraic':False},'outputs/I_leak':{'algebraic':False},
'outputs/I_i':{'algebraic':False},'outputs/q_S31_norm':{'algebraic':False},'outputs/q_S4_norm':{'algebraic':False},
'outputs/A_g_Na':{'algebraic':False},'outputs/A_g_K':{'algebraic':False}}

simExp.simExp(simfile, savefiles,start, ending, pointInterval,indexStart,indexEnd,varSet,varLoop,varSave)