-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcfg.py
76 lines (61 loc) · 2.77 KB
/
cfg.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
""" cfg.py """
from netpyne import specs
import numpy as np
from itertools import product
cfg = specs.SimConfig()
cfg.dt = 0.0125
cfg.cvode_active = False
cfg.recordStims = False
cfg.recordStep = 0.025
cfg.istims = np.linspace(0.00, 0.4, 21)
cfg.vstims = np.linspace(0, 100, 21)
# 20, 18, 16 14 12 10 8 6 4 2
cfg.isis = [50, 55.5, 62.5, 71.5, 83.25, 100, 125, 166.75, 250, 500]
cfg.dur = [250, 1000]
cfg.duration = 400
cfg.recordCells = ['all']
"""
for var in [ 'v', 'ina', 'ik', 'ica', 'icl']:
cfg.recordTraces[var] = {'sec': 'soma', 'loc': 0.5, 'var': '%s' %(var)}
#for var in [ 'v', 'i_pas', 'h', 'ina', 'ik', 'ica', 'icl']:
for label, nav in [ ['NaV1.7', 'nav1p7'], ['NaV1.8', 'nav1p8'], ['NaV1.8T', 'nav1p8T'] ]:
cfg.recordTraces[label] = {'sec': 'soma', 'loc': 0.5, 'var': 'ina_%s' %(nav)}
"""
for var in [ 'v' ]:
for sec, loc in [ ['cblperi', 0], ['cblperi', 0.5], ['cblperi', 1.0], ['drgsoma', 0.5], ['cblcntr', 0.5], ['cblcntr', 1.0]]:
label = "%s(%s).%s" %(sec, loc, var)
cfg.recordTraces[label] = {'sec': sec, 'loc': loc, 'var': '%s' %(var)}
for var in [ 'ina', 'ik', 'i_pas' ]:
for sec, loc in [ ['cblperi', 0], ['cblperi', 0.5], ['cblperi', 1.0], ['drgsoma', 0.5], ['cblcntr', 0.5], ['cblcntr', 1.0]]:
label = "%s(%s).%s" %(sec, loc, var)
cfg.recordTraces[label] = {'sec': sec, 'loc': loc, 'var': '%s' %(var)}
for var in [ 'v' ]:
for sec, loc in [ ['cable', 0], ['cable', 0.25], ['cable', 0.5], ['cable', 0.75], ['cable', 1.00] ]:
label = "%s(%s).%s" % (sec, loc, var)
cfg.recordTraces[label] = {'sec': sec, 'loc': loc, 'var': '%s' %(var)}
for var in [ 'ina', 'ik', 'i_pas' ]:
for sec, loc in [ ['cable', 0], ['cable', 0.25], ['cable', 0.5], ['cable', 0.75], ['cable', 1.00] ]:
label = "%s(%s).%s" %(sec, loc, var)
cfg.recordTraces[label] = {'sec': sec, 'loc': loc, 'var': '%s' %(var)}
# Saving
cfg.simLabel = 'sim'
cfg.saveFolder = 'data'
cfg.savePickle = True
# cfg.saveJson = True
# cfg.saveDataInclude = ['netParams', 'netCells', 'simData', 'simConfig', 'plotData']
# run simulation
cfg.hParams = {'celsius': 22}
cfg.analysis.plotTraces = {'include': ['all'], 'overlay': True, 'oneFigPer': 'trace', 'saveData': True, 'saveFig': True,
'showFig': False, 'timeRange': [0, cfg.duration]}
#use the saveData to plot values
"""
pts = 3
#generate recordTraces along the fiber and at soma (ordered dictionary so generate them in order)
for x in range(-pts, 0):
x /= pts
cfg.recordTraces['v_fiber(%+1.2f)' %(x)] = {'sec': 'peri', 'loc': (1+x), 'var': 'v'}
for x in range(0, pts+1):
x /= pts
cfg.recordTraces['v_fiber(%+1.2f)' %(x)] = {'sec': 'cntr', 'loc': x , 'var': 'v'}
cfg.recordTraces['v_soma'] = {'sec': 'soma', 'loc': 0.5, 'var': 'v'}
"""