Beispiel #1
0
}
libraryName = '/library'
compType = 'Compartment'

# Create the compartment
neuron = moose.Neutral('/neuron')
squid = u.createCompartment(neuron, 'HHsquidswag', squid_l, squid_rad, RM, CM,
                            RA, initVm, Em)

# Set the axial resistance to match the one in the ionchannel.py file
# and set the container to be used for channel creation
squid.Ra = 1
container = squid.parent.path

# Create the external current to be applied to the compartment
squid_pulse = u.createPulse(squid, 'rollingWave', pulse_dur, pulse_amp,
                            pulse_delay1, pulse_delay2)

# Create the data tables necessary to run the model
data = moose.Neutral('/data')
squid_Vm, squid_current = u.createDataTables(squid, data, squid_pulse)

# Create the channels necessary for the giant squid axon and place them in a library
u.createChanLib(libraryName, chan_set, rateParams, CaParams)

# Create copies of the prototype channels and connect them to the
# compartment, along with their conductances
u.addChannelSet(cond_set, libraryName, neuron, compType)
u.add_calcium(libraryName, neuron, Ca_pool_params, compType)
for key in chan_set.keys():
    if ("Ca" in key):
        u.connect_cal2chan(chan_set[key].name, chan_set[key].chan_type, neuron,
Beispiel #2
0
soma_rad = 10e-6
RM = 1
CM = 0.01
RA = 1
Em = -65e-3
pulse_dur = 100e-3
pulse_amp = 0.1e-9
pulse_delay1 = 50e-3
pulse_delay2 = 1e9

# Create a neutral directory for the neuron
neuron = moose.Neutral('/neuron')

# Create the soma and connect a pulse to it
l = u.createCompartment(neuron,'swagginWagon',soma_l,soma_rad,RM,CM,RA,Em)
n = u.createPulse(l,'rollingWave',pulse_dur,pulse_amp,pulse_delay1,pulse_delay2)

# Create a neutral directory for the data and create data tables for the soma
data = moose.Neutral('/data')
m = u.createDataTables(l,data)

# Set the clock so that all components of the simulation run           appropriately
moose.setClock(4, simDt)

# Run the experiment
moose.reinit()
moose.start(simTime)

# Compute delta VM at the steady state
delta_Vm = l.Rm*n.level[0]*(1-np.exp(-0.3/(l.Rm*l.Cm)))
print delta_Vm
Beispiel #3
0
swcfile = '72-1.CNG.swc'
container = 'cell1'
sd_cell = moose.loadModel(swcfile, container)

# Compute specific resistivity, capacitance, and axial resistance for swc
# (p files already have this computed upon load if specified at top of pfile)
u.setCompParameters(sd_cell, 'Compartment', RM, CM, RA, Em)

# Re-define the cell variables so that they just include compartments
# (i.e. exclude spines)
sd_cell = moose.wildcardFind('/cell1/#[TYPE=Compartment]')

# Create data hierarchies for the two different cells
sd_data = moose.Neutral('/gran_data')

sd_soma_pulse = u.createPulse(sd_cell[0], 'rollingWave', pulse_dur, pulse_amp,
                              pulse_delay1, pulse_delay2)

# Create data tables for the membrane potential for each compartment
sd_tables = []
for comp in sd_cell:
    sd_tables.append(u.createDataTables(comp, sd_data))

# Choose the soma and a representative dendrite to view how voltage changes
# for the granule cell
sd_soma0_Vm = sd_tables[0]

# Run the experiment and plot the results for both neurons
moose.setClock(4, simDt)
moose.reinit()
moose.start(simTime)
CAMAX = 40e-3
channelList = ('kAf','kAs','kIR','Krp','naF')

# Graph the curves
for chan in channelList:
        libchan=moose.element('/library/'+chan)
        pc.plot_gate_params(libchan,plot_powers, VMIN, VMAX, CAMIN, CAMAX)


# Re-create the python variable pointing to the MS cell to limit results just to 
# type compartment (excludes the spines and allows for createDataTables function to
# work properly)
MS_cell = moose.wildcardFind('/library/MScell/#[TYPE=SymCompartment]')

# Create the pulse and apply it to the MS cell's soma
MS_soma_pulse = u.createPulse(MS_cell[0], 'rollingWave', pulse_dur, pulse_amp, 
                           pulse_delay1, pulse_delay2)

# Create a neutral object to store the data in
MS_data = moose.Neutral('/MS_data')
MS_tables = []
for comp in MS_cell:
    MS_tables.append(u.createDataTables(comp,MS_data,MS_soma_pulse))

# Create a variable for the table recording the voltage for the MS cell's soma
MS_soma_Vm = MS_tables[0][0]

# Define variables needed for running the simulation, and set the clocks for all the channels, compartments,
# and tables recording voltage and current during the simulation
simTime = 400e-3
simdt = 10e-6
plotdt = 0.2e-3
Beispiel #5
0
# Create a neutral directory for the neuron
neuron = moose.Neutral('/neuron')

# Create the soma under the neuron directory
soma = u.createCompartment(neuron, 'swagginSoma', soma_l, soma_rad, RM, CM, RA,
                           Em)

# Create the dendritic compartments under the neuron directory
dend_branch = u.discretize(neuron, numDends, dend_l, dend_rad, RM, CM, RA, Em)

# Connect the soma to the first element of the dendritic branch
moose.connect(soma, 'axialOut', dend_branch[0], 'handleAxial')

# Create a pulse and connect it to the soma
soma_pulse = u.createPulse(soma, 'rollingWave', pulse_dur, pulse_amp,
                           pulse_delay)

# Create data tables to store the voltage for the soma and each compartment
# making up the dendritic branch
data = moose.Neutral('/data')
soma_Vm = u.createDataTables(soma, data)
dend_tables = []
for dend in dend_branch:
    dend_tables.append(u.createDataTables(dend, data))

# Store the location of the middle dendrite so that it can be accessed
# for plotting purposes
mid_dend = len(dend_branch) // 2

# Run the experiment and plot the results
moose.setClock(4, simDt)
Beispiel #6
0
# Compute specific resistivity, capacitance, and axial resistance for swc
# (p files already have this computed upon load if specified at top of pfile)
u.setCompParameters(gran_cell,'Compartment',RM,CM,RA,Em)

# Re-define the cell variables so that they just include compartments
# (i.e. exclude spines)
l2_cell = moose.wildcardFind('/l2_cell/#[TYPE=SymCompartment]')
gran_cell = moose.wildcardFind('/gran_cell/#[TYPE=Compartment]')

# Create data hierarchies for the two different cells
l2_data = moose.Neutral('/l2_data')
gran_data = moose.Neutral('/gran_data')

# Create pulses and connect them to each neuron's soma
l2_soma_pulse = u.createPulse(l2_cell[0], 'rollingWave', pulse_dur, pulse_amp, 
                           pulse_delay1, pulse_delay2)
g_soma_pulse = u.createPulse(gran_cell[0], 'rollingWave', pulse_dur, pulse_amp, 
                           pulse_delay1, pulse_delay2)

# Create data tables for the membrane potential for each compartment
l2_tables = []
gran_tables = []
for comp in l2_cell:
    l2_tables.append(u.createDataTables(comp,l2_data))
for comp in gran_cell:
    gran_tables.append(u.createDataTables(comp,gran_data))
    
# Choose the soma and a representative dendrite to view how voltage changes
# for the layer 2 cell
l2_soma_Vm = l2_tables[0]
l2_ap2_Vm = l2_tables[2]