"""
netParams.py
Specifications for EEE model using NetPyNE
Originally:
High-level specifications for M1 network model using NetPyNE
Contributors: salvadordura@gmail.com
"""
from netpyne import specs
import os
curpath = os.getcwd()
while os.path.split(curpath)[1] != "sim":
curpath = os.path.split(curpath)[0]
cellpath = os.path.join(curpath, "cells")
try:
from __main__ import cfg
except:
from cfg import cfg
netParams = specs.NetParams()
cellRule = netParams.importCellParams(label='SPI6', conds={'cellType': 'SPI6', 'cellModel': 'HH_reduced'}, fileName=os.path.join(cellpath, 'SPI6.py'), cellName='SPI6')
cellRule = netParams.importCellParams(label='eee6', conds={'cellType': 'eee6', 'cellModel': 'HH_reduced'}, fileName=os.path.join(cellpath, 'eee6.py'), cellName='eee6')
cellRule = netParams.importCellParams(label='eee7', conds={'cellType': 'eee7', 'cellModel': 'HH_reduced'}, fileName=os.path.join(cellpath, 'eee7.py'), cellName='eee7')
cellRule = netParams.importCellParams(label='eee7us', conds={'cellType': 'eee7us', 'cellModel': 'HH_reduced'}, fileName=os.path.join(cellpath, 'eee7us.py'), cellName='eee7us')
cellRule = netParams.importCellParams(label='eee7ps', conds={'cellType': 'eee7ps', 'cellModel': 'HH_reduced'}, fileName=os.path.join(cellpath, 'eee7ps.py'), cellName='eee7ps')
cellRule['secLists']['alldend'] = ['Bdend1', 'Bdend2', 'Adend1', 'Adend2', 'Adend3']
cellRule['secLists']['apicdend'] = ['Adend1', 'Adend2', 'Adend3']
cellRule['secLists']['basaldend'] = ['Bdend1', 'Bdend2']
for cell_label, cell_params in netParams.cellParams.iteritems():
for secName,sec in cell_params['secs'].iteritems():
sec['vinit'] = -75.0413649414
if secName in cellRule['secLists']['alldend']:
sec['mechs']['nax']['gbar'] = cfg.dendNa
sec['mechs']['kdr']['gbar'] = cfg.dendK * sec['mechs']['kdr']['gbar']
sec['mechs']['kap']['gbar'] = cfg.dendK * sec['mechs']['kap']['gbar']
if secName in cellRule['secLists']['basaldend']:
sec["geom"]["Ra"] = cfg.BdendRa
netParams.popParams['SPI6'] = {'cellModel':'HH_reduced', 'cellType':'SPI6', 'numCells':1}
netParams.popParams['eee6'] = {'cellModel':'HH_reduced', 'cellType':'eee6', 'numCells':1}
netParams.popParams['eee7'] = {'cellModel':'HH_reduced', 'cellType':'eee7', 'numCells':1}
netParams.popParams['eee7us']= {'cellModel':'HH_reduced', 'cellType':'eee7us', 'numCells':1}
netParams.popParams['eee7ps']= {'cellModel':'HH_reduced', 'cellType':'eee7ps', 'numCells':1}
netParams.synMechParams['NMDA'] = {'mod': 'MyExp2SynNMDABB', 'tau1NMDA': cfg.tau1NMDA, 'tau2NMDA': cfg.tau2NMDA, 'e': 0}
netParams.synMechParams['AMPA'] = {'mod': 'AMPA'}
if cfg.addIClamp:
for iclabel in [k for k in dir(cfg) if k.startswith('IClamp')]:
ic = getattr(cfg, iclabel, None)
netParams.stimSourceParams[iclabel] = {'type': 'IClamp', 'del': ic['start'], 'dur': ic['dur'], 'amp': ic['amp']}
for curpop in ic['pop']:
netParams.stimTargetParams[iclabel+'_'+curpop] = \
{'source': iclabel, 'conds': {'popLabel': ic['pop']}, 'sec': ic['sec'], 'loc': ic['loc']}
if cfg.addNetStim:
for nslabel in [k for k in dir(cfg) if k.startswith('NetStim')]:
ns = getattr(cfg, nslabel, None)
netParams.stimSourceParams[nslabel] = {'type': 'NetStim', 'start': ns['start'], 'interval': ns['interval'], 'noise': ns['noise'], 'number': ns['number']}
for i in range(len(ns['synMech'])):
if ns['synMech'][i] == 'AMPA':
ns['weight'][i] = ns['weight'][0] * cfg.ratioAMPANMDA
for curpop in ic['pop']:
netParams.stimTargetParams[nslabel+'_'+curpop+'_'+ns['synMech'][i]] = \
{'source': nslabel, 'conds': {'popLabel': ns['pop']}, 'sec': ns['sec'], 'synsPerConn': cfg.numsyns, 'loc': ns['loc'], 'synMech': ns['synMech'][i], 'weight': ns['weight'][i], 'delay': ns['delay']}