Beispiel #1
0
)  # object of class SimConfig to store simulation configuration
simConfig.duration = 1 * 1e3  # Duration of the simulation, in ms
simConfig.dt = 0.025  # Internal integration timestep to use
simConfig.verbose = 0  # Show detailed messages
simConfig.recordTraces = {
    'V_soma': {
        'sec': 'soma',
        'loc': 0.5,
        'var': 'v'
    }
}  # Dict with traces to record
simConfig.recordStep = 1  # Step size in ms to save data (eg. V traces, LFP, etc)
simConfig.filename = 'model_output'  # Set file output name
simConfig.savePickle = False  # Save params, network and sim output to pickle file

simConfig.analysis['plotRaster'] = {
    'orderInverse': True,
    'saveFig': 'tut_import_raster.png'
}  # Plot a raster
simConfig.analysis['plotTraces'] = {
    'include': [0]
}  # Plot recorded traces for this list of cells

# Create network and run simulation
sim.createSimulateAnalyze(netParams=netParams, simConfig=simConfig)

# import pylab; pylab.show()  # this line is only necessary in certain systems where figures appear empty

# check model output
sim.checkOutput('tut_import')
Beispiel #2
0
                       for x in [30, 90]]

simConfig.analysis['plotTraces'] = {
    'include': [('E', 0)],
    'oneFigPer': 'cell',
    'overlay': True,
    'figSize': (5, 3),
    'saveFig': True
}  # Plot recorded traces for this list of cells
simConfig.analysis['plotLFP'] = {
    'includeAxon': False,
    'plots': ['timeSeries', 'locations'],
    'figSize': (5, 9),
    'saveFig': True
}
simConfig.analysis['getCSD'] = {
    'timeRange': [10, 45],
    'spacing_um': 150,
    'vaknin': True
}
simConfig.analysis['plotCSD'] = {'LFP_overlay': True}
#sim.analysis.getCSD(...args...)
#simConfig.analysis['plotCSD'] = {}

# Create network and run simulation
sim.createSimulateAnalyze(netParams=netParams, simConfig=simConfig)
#sim.analysis.plotCSD()

# check model output
sim.checkOutput('cell_lfp')
Beispiel #3
0
sim.runSim()  # run parallel Neuron simulation
sim.gatherData()  # gather spiking data and cell info from each node
sim.saveData(
)  # save params, cell info and sim output to file (pickle,mat,txt,etc)
sim.analysis.plotData()  # plot spike raster

# modify cells geometry
sim.net.modifyCells({
    'conds': {
        'pop': 'hop'
    },
    'secs': {
        'soma': {
            'geom': {
                'L': 160
            }
        }
    }
})

sim.simulate()

from netpyne import __gui__
if __gui__:
    sim.analysis.plotRaster(syncLines=True)
    sim.analysis.plotTraces(include=[1])

# check model output
sim.checkOutput('tut7')
Beispiel #4
0
import M1  # import parameters file
from netpyne import sim  # import netpyne init module

sim.createSimulateAnalyze(
    netParams=M1.netParams,
    simConfig=M1.simConfig)  # create and simulate network

# check model output
sim.checkOutput('M1')
Beispiel #5
0
def test_tutorial_3():
    import tut3
    sim.checkOutput('tut3')
Beispiel #6
0
simConfig.saveCellSecs = 0 #False
simConfig.saveCellConns = 0
simConfig.recordLFP = [[150, y, 150] for y in [600, 800, 1000]] # only L5 (Zagha) [[150, y, 150] for y in range(200,1300,100)]

simConfig.analysis['plotRaster'] = True 			# Plot a raster
simConfig.analysis['plotTraces'] = {'include': [1]} 			# Plot recorded traces for this list of cells
#simConfig.analysis['plot2Dnet'] = True           # plot 2D visualization of cell positions and connections
simConfig.analysis['plotLFP'] = True



def modifyGnabar(t):
    params = {'conds': {'cellType': 'PYR'}, 'secs': {'soma': {'mechs': {'hh': {'gnabar': 0.0}}}}}
    sim.net.modifyCells(params)
    print(sim.net.cells[0].secs['soma']['mechs']['hh'])


# Create network and run simulation
sim.create(netParams=netParams, simConfig=simConfig)
sim.runSimWithIntervalFunc(500, modifyGnabar)
sim.gatherData()                  			# gather spiking data and cell info from each node
sim.saveData()                    			# save params, cell info and sim output to file (pickle,mat,txt,etc)#
sim.analysis.plotData()         			# plot spike raster etc



# import pylab; pylab.show()  # this line is only necessary in certain systems where figures appear empty

# check model output
sim.checkOutput('tut2')
Beispiel #7
0
Starting script to run NetPyNE-based M1 model.

Usage:
    python init.py # Run simulation, optionally plot a raster

MPI usage:
    mpiexec -n 4 nrniv -python -mpi init.py
"""

import matplotlib
matplotlib.use('Agg')  # to avoid graphics error in servers

from netpyne import sim
from cfg import cfg
from netParams import netParams

print("Starting sim ...")

(pops, cells, conns, stims, rxd, simData) = sim.create(netParams,
                                                       cfg,
                                                       output=True)

# saveInterval defines how often the data is saved
sim.runSimWithIntervalFunc(cfg.saveInterval, sim.intervalSave)

# we run fileGather() instead of gather
sim.fileGather()
sim.analyze()

sim.checkOutput('M1detailed')
Beispiel #8
0
 def test_run(self, pkg_setup):
     import M1_run
     sim.checkOutput('M1')
Beispiel #9
0
 def test_init(self, pkg_setup):
     import init
     sim.checkOutput('saving')
Beispiel #10
0
def test_tutorial_1():
    import tut1
    sim.checkOutput('tut1')
Beispiel #11
0
 def test_init(self, pkg_setup):
     import init
     sim.checkOutput('PTcell')
Beispiel #12
0
def test_tutorial_7():
    import tut7
    sim.checkOutput('tut7')
Beispiel #13
0
def test_tutorial_6():
    import tut6
    sim.checkOutput('tut6')
Beispiel #14
0
def test_tutorial_5():
    import tut5
    sim.checkOutput('tut5')
Beispiel #15
0
simConfig.recordTraces = {
    'V_soma': {
        'sec': 'soma',
        'loc': 0.5,
        'var': 'v'
    }
}  # Dict with traces to record
simConfig.recordStep = 1  # Step size in ms to save data (eg. V traces, LFP, etc)
simConfig.filename = 'model_output'  # Set file output name
simConfig.savePickle = False  # Save params, network and sim output to pickle file
simConfig.saveMat = False  # Save params, network and sim output to pickle file

simConfig.analysis['plotRaster'] = {
    'orderBy': 'y',
    'orderInverse': True
}  # Plot a raster
simConfig.analysis['plotTraces'] = {
    'include': [('E2', 0), ('E4', 0), ('E5', 5)]
}  # Plot recorded traces for this list of cells
simConfig.analysis[
    'plot2Dnet'] = True  # plot 2D visualization of cell positions and connections
simConfig.analysis['plotConn'] = True  # plot connectivity matrix

# Create network and run simulation
sim.createSimulateAnalyze(netParams=netParams, simConfig=simConfig)

# import pylab; pylab.show()  # this line is only necessary in certain systems where figures appear empty

# check model output
sim.checkOutput('tut5')
Beispiel #16
0
 def test_run(self, pkg_setup):
     import HybridTut_run
     sim.checkOutput('HybridTut')
Beispiel #17
0
simConfig = specs.SimConfig(
)  # object of class SimConfig to store simulation configuration

simConfig.duration = 1 * 1e3  # Duration of the simulation, in ms
simConfig.dt = 0.025  # Internal integration timestep to use
simConfig.verbose = False  # Show detailed messages
simConfig.recordTraces = {
    'V_soma': {
        'sec': 'soma',
        'loc': 0.5,
        'var': 'v'
    }
}  # Dict with traces to record
simConfig.recordStep = 0.1  # Step size in ms to save data (eg. V traces, LFP, etc)
simConfig.filename = 'tut6'  # Set file output name
simConfig.savePickle = False  # Save params, network and sim output to pickle file

simConfig.analysis['plotRaster'] = {'saveFig': True}  # Plot a raster
simConfig.analysis['plotTraces'] = {
    'include': [('S', 0), ('M', 0)],
    'saveFig': True
}  # Plot recorded traces for this list of cells

# Create network and run simulation
sim.createSimulateAnalyze(netParams=netParams, simConfig=simConfig)

# import pylab; pylab.show()  # this line is only necessary in certain systems where figures appear empty

# check model output
sim.checkOutput('tut6')
Beispiel #18
0
import HHTut  # import parameters file
from netpyne import sim  # import netpyne sim module

sim.createSimulateAnalyze(
    netParams=HHTut.netParams,
    simConfig=HHTut.simConfig)  # create and simulate network

# check model output
sim.checkOutput('HHTut')
Beispiel #19
0
    'weight': 0.01,             # synaptic weight
    'delay': 5,                 # transmission delay (ms)
    'sec': 'dend',              # section to connect to
    'loc': 1.0,                 # location of synapse
    'synMech': 'exc'}           # target synaptic mechanism


# Simulation options
simConfig = specs.SimConfig()       # object of class SimConfig to store simulation configuration

simConfig.duration = 1*1e3          # Duration of the simulation, in ms
simConfig.dt = 0.025                # Internal integration timestep to use
simConfig.verbose = False           # Show detailed messages
simConfig.recordTraces = {'V_soma':{'sec':'soma','loc':0.5,'var':'v'}}  # Dict with traces to record
simConfig.recordStep = 1            # Step size in ms to save data (eg. V traces, LFP, etc)
simConfig.filename = 'tut3'         # Set file output name
simConfig.savePickle = False        # Save params, network and sim output to pickle file

simConfig.analysis['plotRaster'] = {'saveFig': True}                  # Plot a raster
simConfig.analysis['plotTraces'] = {'include': [1], 'saveFig': True}  # Plot recorded traces for this list of cells
simConfig.analysis['plot2Dnet'] = {'saveFig': True}                   # plot 2D cell positions and connections


# Create network and run simulation
sim.createSimulateAnalyze(netParams = netParams, simConfig = simConfig)

# import pylab; pylab.show()  # this line is only necessary in certain systems where figures appear empty

# check model output
sim.checkOutput('tut3')
Beispiel #20
0
    'probability': 0.1,         # probability of connection
    'weight': 0.005,            # synaptic weight
    'delay': 5,                 # transmission delay (ms)
    'sec': 'dend',              # section to connect to
    'loc': 1.0,                 # location in section to connect to
    'synMech': 'exc'}           # target synapse


# Simulation options
simConfig = specs.SimConfig()       # object of class SimConfig to store simulation configuration
simConfig.duration = 1*1e3          # Duration of the simulation, in ms
simConfig.dt = 0.025                # Internal integration timestep to use
simConfig.verbose = False           # Show detailed messages
simConfig.recordTraces = {'V_soma':{'sec':'soma','loc':0.5,'var':'v'}}  # Dict with traces to record
simConfig.recordStep = 1            # Step size in ms to save data (eg. V traces, LFP, etc)
simConfig.filename = 'tut4'         # Set file output name
simConfig.savePickle = False        # Save params, network and sim output to pickle file

simConfig.analysis['plotRaster'] = {'saveFig': True}                  # Plot a raster
simConfig.analysis['plotTraces'] = {'include': [1], 'saveFig': True}  # Plot recorded traces for this list of cells
simConfig.analysis['plot2Dnet'] = {'saveFig': True}                   # plot 2D cell positions and connections


# Create network and run simulation
sim.createSimulateAnalyze(netParams = netParams, simConfig = simConfig)

# import pylab; pylab.show()  # this line is only necessary in certain systems where figures appear empty

# check model output
sim.checkOutput('tut4')
Beispiel #21
0
import HybridTut  # import parameters file
from netpyne import sim  # import netpyne init module

sim.createSimulateAnalyze(
    netParams=HybridTut.netParams,
    simConfig=HybridTut.simConfig)  # create and simulate network

# check model output
sim.checkOutput('HybridTut')
Beispiel #22
0
"""
init.py

Starting script to run NetPyNE-based PT model.

Usage:
    python init.py # Run simulation, optionally plot a raster

MPI usage:
    mpiexec -n 4 nrniv -python -mpi init.py

Contributors: [email protected]
"""

#import matplotlib; matplotlib.use('Agg')  # to avoid graphics error in servers

from netpyne import sim
from cfg import cfg
from netParams import netParams

sim.createSimulateAnalyze(netParams, cfg)  #SimulateAnalyze(netParams, cfg)

# check model output
sim.checkOutput('PTcell')
Beispiel #23
0
sim.createSimulateAnalyze(netParams, cfg)

# Saving different network components to file
sim.cfg.saveJson = True

# save network params (rules)
sim.saveData(include=['netParams'], filename='out_netParams')

# save network instance
sim.saveData(include=['net'], filename='out_netInstance')

# save network params and instance together
sim.saveData(include=['netParams', 'net'],
             filename='out_netParams_netInstance')

# save sim config
sim.saveData(include=['simConfig'], filename='out_simConfig')

# save sim output data
sim.saveData(include=['simData'], filename='out_simData')

# save network instance with compact conn format (list instead of dict)
sim.cfg.compactConnFormat = [
    'preGid', 'sec', 'loc', 'synMech', 'weight', 'delay'
]
sim.gatherData()
sim.saveData(include=['net'], filename='out_netInstanceCompact')

# check model output
sim.checkOutput('saving')
Beispiel #24
0
def test_tutorial_2():
    import tut2
    sim.checkOutput('tut2')