Skip to content

Commit

Permalink
Merge pull request #187 from Neurosim-lab/development
Browse files Browse the repository at this point in the history
PR from development to master - VERSION 0.6.5
  • Loading branch information
salvadord authored Jan 8, 2017
2 parents 1434629 + 3ca189b commit 23c0b32
Show file tree
Hide file tree
Showing 32 changed files with 2,757 additions and 1,931 deletions.
34 changes: 34 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
# Version 0.6.5

- Added support for artificial cells (without sections) (issue #44)

- A single NetStim (within a population) can now be connected to multiple cells (issue #113)

- VecStim populations use same params as NetStims and allows for pulses at arbitrary times with different rates

- NetStim and VecStim population allow for a uniformly distributed rates in the form [min,max]

- Added option to run batch sims via mpi and bulletin board (master/slave) (issue #108)

- netParams.shape paramter to select either 'cuboid', 'cylinder' or 'ellipsoid' network shape (issue #26)

- analysis.plot2Dnet() 'view' param to select frontal ('xy') or top-down ('xz') view

- analysis.plotConn() option to plot stacked bar graph, select different pre and post pops, synMech and syns vs conns

- Made distinction between number of connections and synaptic contacts (eg. can have 5 synsPerConn)

- New function netParams.addCellParamsSecList to create list of sections based on distance from soma

- Removed 'plast' and 'shape' from conns when not used (issue #177)

- Added option to center soma at origin when importing cell

- Now using noiseFromRandom123() for NetStims() (issue #89)

- Fixed bug in readCmdLineArgs()

- Fixed bug in saveData option of figure plots



# Version 0.6.4

- Added analysis.nTE() function to calculate normalized transfer entropy (issue #42)
Expand Down
8 changes: 7 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Include the data files
recursive-include netpyne *
recursive-include examples *
recursive-exclude
recursive-exclude examples *
global-exclude x86_64
global-exclude x86_64/*
global-exclude .libs*
global-exclude .libs/*
global-exclude *.pyc
File renamed without changes.
12 changes: 4 additions & 8 deletions doc/source/code/tut2.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
## Population parameters
netParams.popParams['S'] = {'cellType': 'PYR', 'numCells': 20, 'cellModel': 'HH'}
netParams.popParams['M'] = {'cellType': 'PYR', 'numCells': 20, 'cellModel': 'HH'}
netParams.popParams['background'] = {'rate': 10, 'noise': 0.5, 'cellModel': 'NetStim'}

## Cell property rules
cellRule = {'conds': {'cellType': 'PYR'}, 'secs': {}} # cell rule dict
Expand All @@ -18,6 +17,10 @@
## Synaptic mechanism parameters
netParams.synMechParams['exc'] = {'mod': 'Exp2Syn', 'tau1': 0.1, 'tau2': 5.0, 'e': 0} # excitatory synaptic mechanism

# Stimulation parameters
netParams.stimSourceParams['bkg'] = {'type': 'NetStim', 'rate': 10, 'noise': 0.5,}
netParams.stimTargetParams['bkg->PYR'] = {'source': 'bkg', 'conds': {'cellType': 'PYR'}, 'weight': 0.01, 'delay': 5, 'synMech': 'exc'}

## Cell connectivity rules
netParams.connParams['S->M'] = { # S -> M label
'preConds': {'popLabel': 'S'}, # conditions of presyn cells
Expand All @@ -27,13 +30,6 @@
'delay': 5, # transmission delay (ms)
'synMech': 'exc'} # synaptic mechanism

netParams.connParams['bg->PYR'] = { # background -> PYR label
'preConds': {'popLabel': 'background'},
'postConds': {'cellType': 'PYR'},
'weight': 0.01, # synaptic weight
'delay': 5, # transmission delay (ms)
'synMech': 'exc'} # synaptic mechanism


# Simulation options
simConfig = specs.SimConfig() # object of class SimConfig to store simulation configuration
Expand Down
11 changes: 5 additions & 6 deletions doc/source/code/tut3.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
## Population parameters
netParams.popParams['S'] = {'cellType': 'PYR', 'numCells': 20, 'cellModel': 'HH'}
netParams.popParams['M'] = {'cellType': 'PYR', 'numCells': 20, 'cellModel': 'HH'}
netParams.popParams['background'] = {'rate': 10, 'noise': 0.5, 'cellModel': 'NetStim'}

## Cell property rules
cellRule = {'conds': {'cellType': 'PYR'}, 'secs': {}} # cell rule dict
Expand All @@ -24,6 +23,11 @@
netParams.addSynMechParams('exc', {'mod': 'Exp2Syn', 'tau1': 1.0, 'tau2': 5.0, 'e': 0}) # excitatory synaptic mechanism


# Stimulation parameters
netParams.stimSourceParams['bkg'] = {'type': 'NetStim', 'rate': 10, 'noise': 0.5}
netParams.stimTargetParams['bkg->PYR'] = {'source': 'bkg', 'conds': {'cellType': 'PYR'}, 'weight': 0.01, 'delay': 5, 'synMech': 'exc'}


## Cell connectivity rules
netParams.connParams['S->M'] = {'preConds': {'popLabel': 'S'}, 'postConds': {'popLabel': 'M'}, # S -> M
'probability': 0.5, # probability of connection
Expand All @@ -33,11 +37,6 @@
'loc': 1.0, # location of synapse
'synMech': 'exc'} # target synaptic mechanism

netParams.connParams['bg->PYR'] = {'preConds': {'popLabel': 'background'},
'postConds': {'cellType': 'PYR'}, # background -> PYR
'weight': 0.01, # synaptic weight
'delay': 5, # transmission delay (ms)
'synMech': 'exc'} # target synapse


# Simulation options
Expand Down
17 changes: 8 additions & 9 deletions doc/source/code/tut4.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
netParams = specs.NetParams() # object of class NetParams to store the network parameters

## Population parameters
netParams.popParams['S'] = {'cellType': 'PYR', 'numCells': 20, 'cellModel': 'Izhi2007b'}
netParams.popParams['S'] = {'cellType': 'PYR', 'numCells': 20, 'cellModel': 'Izhi'}
netParams.popParams['M'] = {'cellType': 'PYR', 'numCells': 20, 'cellModel': 'HH'}
netParams.popParams['background'] = {'rate': 100, 'noise': 0.5, 'cellModel': 'NetStim'}


## Cell property rules
cellRule = {'conds': {'cellType': 'PYR', 'cellModel': 'HH'}, 'secs': {}} # cell rule dict
Expand All @@ -19,7 +19,7 @@
cellRule['secs']['dend']['mechs']['pas'] = {'g': 0.0000357, 'e': -70} # dend mechanisms
netParams.cellParams['PYR_HH_rule'] = cellRule # add dict to list of cell parameters

cellRule = {'conds': {'cellType': 'PYR', 'cellModel': 'Izhi2007b'}, 'secs': {}} # cell rule dict
cellRule = {'conds': {'cellType': 'PYR', 'cellModel': 'Izhi'}, 'secs': {}} # cell rule dict
cellRule['secs']['soma'] = {'geom': {}, 'pointps': {}} # soma params dict
cellRule['secs']['soma']['geom'] = {'diam': 10.0, 'L': 10.0, 'cm': 31.831} # soma geometry
cellRule['secs']['soma']['pointps']['Izhi'] = {'mod':'Izhi2007b', 'C':1, 'k':0.7,
Expand All @@ -31,6 +31,11 @@
netParams.synMechParams['exc'] = {'mod': 'Exp2Syn', 'tau1': 1.0, 'tau2': 5.0, 'e': 0} # excitatory synapse


# Stimulation parameters
netParams.stimSourceParams['bkg'] = {'type': 'NetStim', 'rate': 100, 'noise': 0.5}
netParams.stimTargetParams['bkg->PYR'] = {'source': 'bkg', 'conds': {'cellType': 'PYR'}, 'weight': 0.01, 'delay': 5, 'synMech': 'exc'}


## Cell connectivity rules
netParams.connParams['S->M'] = {
'preConds': {'popLabel': 'S'}, 'postConds': {'popLabel': 'M'}, # S -> M
Expand All @@ -41,12 +46,6 @@
'loc': 1.0,
'synMech': 'exc'} # target synapse

netParams.connParams['bg->PYR'] = {
'preConds': {'popLabel': 'background'}, 'postConds': {'cellType': 'PYR'}, # background -> PYR
'weight': 0.01, # synaptic weight
'delay': 5, # transmission delay (ms)
'synMech': 'exc'} # target synapse


# Simulation options
simConfig = specs.SimConfig() # object of class SimConfig to store simulation configuration
Expand Down
14 changes: 6 additions & 8 deletions doc/source/code/tut5.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
netParams.popParams['I4'] = {'cellType': 'I', 'numCells': 50, 'yRange': [300,600], 'cellModel': 'HH'}
netParams.popParams['E5'] = {'cellType': 'E', 'numCells': 50, 'ynormRange': [0.6,1.0], 'cellModel': 'HH'}
netParams.popParams['I5'] = {'cellType': 'I', 'numCells': 50, 'ynormRange': [0.6,1.0], 'cellModel': 'HH'}
netParams.popParams['background'] = {'rate': 20, 'noise': 0.3, 'cellModel': 'NetStim'}


## Cell property rules
Expand All @@ -37,15 +36,14 @@
## Synaptic mechanism parameters
netParams.synMechParams['exc'] = {'mod': 'Exp2Syn', 'tau1': 0.8, 'tau2': 5.3, 'e': 0} # NMDA synaptic mechanism
netParams.synMechParams['inh'] = {'mod': 'Exp2Syn', 'tau1': 0.6, 'tau2': 8.5, 'e': -75} # GABA synaptic mechanism


## Cell connectivity rules
netParams.connParams['bg->all'] = {
'preConds': {'popLabel': 'background'}, 'postConds': {'cellType': ['E', 'I']}, # background -> all
'weight': 0.01, # synaptic weight
'delay': 'max(1, gauss(5,2))', # transmission delay (ms)
'synMech': 'exc'} # synaptic mechanism

# Stimulation parameters
netParams.stimSourceParams['bkg'] = {'type': 'NetStim', 'rate': 20, 'noise': 0.3}
netParams.stimTargetParams['bkg->all'] = {'source': 'bkg', 'conds': {'cellType': ['E','I']}, 'weight': 0.01, 'delay': 'max(1, gauss(5,2))', 'synMech': 'exc'}


## Cell connectivity rules
netParams.connParams['E->all'] = {
'preConds': {'cellType': 'E'}, 'postConds': {'y': [100,1000]}, # E -> all (100-1000 um)
'probability': 0.1 , # probability of connection
Expand Down
1 change: 0 additions & 1 deletion doc/source/code/tut6.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
## Population parameters
netParams.popParams['S'] = {'cellType': 'PYR', 'numCells': 20, 'cellModel': 'HH'}
netParams.popParams['M'] = {'cellType': 'PYR', 'numCells': 20, 'cellModel': 'HH'}
netParams.popParams['background'] = {'rate': 10, 'noise': 0.5, 'cellModel': 'NetStim'}

## Cell property rules
cellRule = {'conds': {'cellType': 'PYR'}, 'secs': {}} # cell rule dict
Expand Down
18 changes: 9 additions & 9 deletions doc/source/code/tut7.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# Population parameters
netParams.popParams['hop'] = {'cellType': 'PYR', 'cellModel': 'HH', 'numCells': 50} # add dict with params for this pop
netParams.popParams['background'] = {'cellModel': 'NetStim', 'rate': 50, 'noise': 0.5} # background inputs
#netParams.popParams['background'] = {'cellModel': 'NetStim', 'rate': 50, 'noise': 0.5} # background inputs

# Cell parameters

Expand All @@ -33,14 +33,13 @@
netParams.synMechParams['exc'] = {'mod': 'Exp2Syn', 'tau1': 0.1, 'tau2': 1.0, 'e': 0}
netParams.synMechParams['inh'] = {'mod': 'Exp2Syn', 'tau1': 0.1, 'tau2': 1.0, 'e': -80}


# Stimulation parameters
netParams.stimSourceParams['bkg'] = {'type': 'NetStim', 'rate': 50, 'noise': 0.5}
netParams.stimTargetParams['bkg->all'] = {'source': 'bkg', 'conds': {'popLabel': 'hop'}, 'weight': 0.1, 'delay': 1, 'synMech': 'exc'}


# Connectivity parameters
netParams.connParams['bg->hop'] = {
'preConds': {'popLabel': 'background'}, 'postConds': {'popLabel': 'hop'}, # background -> PYR
'weight': 0.1, # fixed weight of 0.1
'synMech': 'exc', # target exc synapse
'delay': 1} # uniformly distributed delays between 1-5ms

netParams.connParams['hop->hop'] = {
'preConds': {'popLabel': 'hop'}, 'postConds': {'popLabel': 'hop'},
'weight': 0.0, # weight of each connection
Expand Down Expand Up @@ -79,6 +78,7 @@
sim.net.createPops() # instantiate network populations
sim.net.createCells() # instantiate network cells based on defined populations
sim.net.connectCells() # create connections between cells based on params
sim.net.addStims() # add stimulation
sim.setupRecording() # setup variables to record for each cell (spikes, V traces, etc)
sim.runSim() # run parallel Neuron simulation
sim.gatherData() # gather spiking data and cell info from each node
Expand All @@ -104,8 +104,8 @@

sim.simulate()

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

Expand Down
89 changes: 89 additions & 0 deletions doc/source/code/tut_artif.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
"""
tut_artif.py
Tutorial on artificial cells (no sections)
"""

from netpyne import specs, sim
from netpyne.specs import Dict

netParams = specs.NetParams() # object of class NetParams to store the network parameters
simConfig = specs.SimConfig() # dictionary to store sets of simulation configurations


###############################################################################
# NETWORK PARAMETERS
###############################################################################

# Population parameters
netParams.popParams['PYR1'] = {'cellModel': 'HH', 'cellType': 'PYR', 'numCells': 100} # pop of HH cells
netParams.popParams['artif1'] = {'cellModel': 'NetStim', 'numCells': 100, 'rate': 50, 'noise': 0.8, 'start': 1, 'seed': 2} # pop of NetStims
netParams.popParams['artif2'] = {'cellModel': 'IntFire2', 'numCells': 100, 'ib': 0.0} # pop of IntFire2
netParams.popParams['artif3'] = {'cellModel': 'IntFire4', 'numCells': 100, 'taue': 1.0} # pop of IntFire4
netParams.popParams['artif4'] = {'cellModel': 'VecStim', 'numCells': 100, 'rate': 5, 'noise': 0.5, 'start': 50,
'pulses': [{'start': 200, 'end': 300, 'rate': 60, 'noise':0.2}, {'start': 500, 'end': 800, 'rate': 30, 'noise': 0.5}]} # pop of Vecstims with 2 pulses

# Synaptic mechanism parameters
netParams.synMechParams['AMPA'] = {'mod': 'Exp2Syn', 'tau1': 0.1, 'tau2': 1.0, 'e': 0}


# Stimulation parameters
netParams.stimSourceParams['background'] = {'type': 'NetStim', 'interval': 100, 'number': 1e5, 'start': 500, 'noise': 0.5} # stim using NetStims after 500ms
netParams.stimTargetParams['bkg->PYR1'] = {'source': 'background', 'conds': {'popLabel': 'PYR1'}, 'sec':'soma', 'loc': 0.5, 'weight': 0.5, 'delay': 1}


# Cell parameters
## PYR cell properties
cellParams = Dict()
cellParams.secs.soma.geom = {'diam': 18.8, 'L': 18.8, 'Ra': 123.0}
cellParams.secs.soma.mechs.hh = {'gnabar': 0.12, 'gkbar': 0.036, 'gl': 0.003, 'el': -70}
cellParams.conds = {'cellType': 'PYR'}
netParams.cellParams['PYR'] = cellParams


# Connections
netParams.connParams['artif1->PYR1'] = {
'preConds': {'popLabel': 'artif1'}, 'postConds': {'popLabel': 'PYR1'},
'convergence': 8,
'weight': 0.005,
'synMech': 'AMPA',
'delay': 'uniform(1,5)'}

netParams.connParams['PYR1->artif2'] = {
'preConds': {'popLabel': 'PYR1'}, 'postConds': {'popLabel': 'artif2'},
'probability': 0.2,
'weight': 0.2,
'delay': 'uniform(1,5)'}

netParams.addConnParams('artif2->artif3',
{'preConds': {'popLabel': 'artif2'}, 'postConds': {'popLabel': 'artif3'},
'divergence': 20,
'weight': 0.05,
'delay': 3})


###############################################################################
# SIMULATION PARAMETERS
###############################################################################

# Simulation parameters
simConfig.duration = 1*1e3 # Duration of the simulation, in ms
simConfig.dt = 0.1 # Internal integration timestep to use
simConfig.createNEURONObj = 1 # create HOC objects when instantiating network
simConfig.createPyStruct = 1 # create Python structure (simulator-independent) when instantiating network
simConfig.verbose = 0 #False # show detailed messages

# Recording
simConfig.recordTraces = {'Vsoma':{'sec':'soma','loc':0.5,'var':'v'}}

# # Analysis and plotting
simConfig.analysis['plotRaster'] = True


###############################################################################
# RUN SIM
###############################################################################

sim.createSimulateAnalyze()


Loading

0 comments on commit 23c0b32

Please sign in to comment.