diff --git a/NetPyNE/HybridSmall/HybridSmall.py b/NetPyNE/HybridSmall/HybridSmall.py index ea93f23..25de36c 100644 --- a/NetPyNE/HybridSmall/HybridSmall.py +++ b/NetPyNE/HybridSmall/HybridSmall.py @@ -1,13 +1,3 @@ -""" -params.py - -netParams is a dict containing a set of network parameters using a standardized structure - -simConfig is a dict containing a set of simulation configurations using a standardized structure - -Contributors: salvadordura@gmail.com -""" - from netpyne import specs netParams = specs.NetParams() # object of class NetParams to store the network parameters @@ -26,13 +16,13 @@ pop_size = 3 # Population parameters -netParams.popParams['PYR_HH'] = {'cellModel': 'HH', 'cellType': 'PYR', 'numCells': pop_size} # add dict with params for this pop -netParams.popParams['PYR_Izhi'] = {'cellModel': 'Izhi', 'cellType': 'PYR', 'numCells': pop_size} # add dict with params for this pop +netParams.popParams['PYR_HH'] = {'cellType': 'PYR_HH', 'numCells': pop_size} # add dict with params for this pop +netParams.popParams['PYR_Izhi'] = {'cellType': 'PYR_Izhi', 'numCells': pop_size} # add dict with params for this pop # Cell parameters list ## PYR cell properties (HH) -cellRule = {'conds': {'cellType': 'PYR', 'cellModel': 'HH'}, 'secs': {}} +cellRule = {'secs': {}} cellRule['secs']['soma'] = {'geom': {}, 'topol': {}, 'mechs': {}} # soma properties cellRule['secs']['soma']['geom'] = {'diam': 18.8, 'L': 18.8, 'Ra': 123.0, 'pt3d':[]} cellRule['secs']['soma']['geom']['pt3d'].append((0, 0, 0, 18.8)) @@ -42,7 +32,7 @@ netParams.cellParams['PYR_HH'] = cellRule # add dict to list of cell properties ## PYR cell properties (Izhi) -cellRule = {'conds': {'cellType': 'PYR', 'cellModel': 'Izhi'}, 'secs': {}} +cellRule = {'secs': {}} cellRule['secs']['soma'] = {'geom': {}, 'pointps':{}} # soma properties cellRule['secs']['soma']['geom'] = {'diam': 10, 'L': 10, 'cm': 31.831} cellRule['secs']['soma']['pointps']['Izhi'] = {'mod':'Izhi2007b', @@ -58,15 +48,15 @@ # Stimulation parameters netParams.stimSourceParams['bkg1'] = {'type': 'NetStim', 'rate': 20, 'noise': 0} netParams.stimSourceParams['bkg2'] = {'type': 'NetStim', 'rate': 20, 'noise': 1} -netParams.stimTargetParams['bg->PYR_Izhi'] = {'source': 'bkg1', 'conds': {'cellType': 'PYR', 'cellModel': 'Izhi'}, - 'connFunc': 'fullConn','weight': 0.01, 'delay': 0, 'synMech': 'syn2'} -netParams.stimTargetParams['bg->PYR_HH'] = {'source': 'bkg2', 'conds': {'cellType': 'PYR', 'cellModel': 'HH'}, - 'connFunc': 'fullConn','weight': 0.005, 'synMech': 'syn1', 'sec': 'soma', 'loc': 1.0, 'delay': 0} +netParams.stimTargetParams['bg->PYR_Izhi'] = {'source': 'bkg1', 'conds': {'cellType': 'PYR_Izhi'}, + 'weight': 0.01, 'delay': 0, 'synMech': 'syn2'} +netParams.stimTargetParams['bg->PYR_HH'] = {'source': 'bkg2', 'conds': {'cellType': 'PYR_HH'}, + 'weight': 0.005, 'synMech': 'syn1', 'sec': 'soma', 'loc': 1.0, 'delay': 0} # Connectivity parameters netParams.connParams['PYR->PYR'] = { - 'preConds': {'cellType': 'PYR'}, 'postConds': {'cellType': 'PYR'}, + 'preConds': {'cellType': ['PYR_HH', 'PYR_Izhi']}, 'postConds': {'cellType': ['PYR_HH', 'PYR_Izhi']}, 'weight': 0.0, # weight of each connection 'delay': '0.2+normal(13.0,1.4)', # delay min=0.2, mean=13.0, var = 1.4 'threshold': 10, # threshold @@ -75,7 +65,6 @@ - ############################################################################### # SIMULATION PARAMETERS ############################################################################### @@ -110,8 +99,11 @@ simConfig.saveDpk = False # save to a .dpk pickled file simConfig.saveDat = True +simConfig.validateNetParams=True # Analysis and plotting simConfig.analysis['plotRaster'] = {'orderInverse': False} #True # Whether or not to plot a raster simConfig.analysis['plotTraces'] = {'include': [1,51]} # plot recorded traces for this list of cells #simConfig.analysis['plotRatePSD'] = {'include': ['allCells', 'PYR_HH', 'PYR_Izhi'], 'smooth': 10} # plot recorded traces for this list of cells + +cfg = simConfig \ No newline at end of file diff --git a/NetPyNE/HybridSmall/index.npjson b/NetPyNE/HybridSmall/index.npjson new file mode 100644 index 0000000..c3cc48a --- /dev/null +++ b/NetPyNE/HybridSmall/index.npjson @@ -0,0 +1,6 @@ +{ + "mod_folder": "../HybridSmall", + "simConfig": "HybridSmall.py", + "python_run": "init.py", + "netParams": "HybridSmall.py" +} \ No newline at end of file diff --git a/NetPyNE/HybridSmall/init.py b/NetPyNE/HybridSmall/init.py new file mode 100644 index 0000000..e9f3c35 --- /dev/null +++ b/NetPyNE/HybridSmall/init.py @@ -0,0 +1,10 @@ +""" +init.py + +Starting script to run NetPyNE-based model. +""" + +from netpyne import sim + +cfg, netParams = sim.loadFromIndexFile('index.npjson') +sim.createSimulateAnalyze(netParams, cfg) diff --git a/NetPyNE/UI/clean.sh b/NetPyNE/UI/clean.sh index a2c5a9d..8403c75 100755 --- a/NetPyNE/UI/clean.sh +++ b/NetPyNE/UI/clean.sh @@ -1,2 +1,2 @@ -rm -rf x86_64 __pycache__ +rm -rf x86_64 arm64 __pycache__ *dat mv *mod *hoc *nrn_py *netpyne.py *nrn.py *dat *spikes *props *txt NET*nml LEMS*json test*json /tmp diff --git a/NeuroML2/HybridSmall.net.nml b/NeuroML2/HybridSmall.net.nml index 562e96e..189e2d0 100644 --- a/NeuroML2/HybridSmall.net.nml +++ b/NeuroML2/HybridSmall.net.nml @@ -23,10 +23,10 @@ - + Cell exported from NetPyNE: -{'conds': {'cellType': 'PYR', 'cellModel': 'HH'}, 'secs': {'soma': {'geom': {'diam': 18.8, 'L': 18.8, 'Ra': 123.0, 'pt3d': [(0, 0, 0, 18.8), (0, 0, 18.8, 18.8)]}, 'topol': {}, 'mechs': {'hh': {'gnabar': 0.12, 'gkbar': 0.036, 'gl': 0.003, 'el': -70}}}}} - +{secs: {'soma': {'geom': {'diam': 18.8, 'L': 18.8, 'Ra': 123.0, 'pt3d': [(0, 0, 0, 18.8), (0, 0, 18.8, 18.8)]}, 'topol': {}, 'mechs': {'hh': {'gnabar': 0.12, 'gkbar': 0.036, 'gl': 0.003, 'el': -70}}}}} + @@ -38,7 +38,7 @@ - + @@ -52,11 +52,11 @@ - + - + @@ -68,7 +68,7 @@ - + @@ -84,40 +84,40 @@ - - - - - - + + + + + + - - - - + + + + - - - - - + + + + + - - - + + + - - - + + + - - - + + + diff --git a/NeuroML2/LEMS_HybridSmall.xml b/NeuroML2/LEMS_HybridSmall.xml index 07993a5..b5691ef 100644 --- a/NeuroML2/LEMS_HybridSmall.xml +++ b/NeuroML2/LEMS_HybridSmall.xml @@ -18,27 +18,27 @@ - - - + + + - - - + + + - - - + + + - - - + + +