Esempio n. 1
0
def inject_soma(mycell):
    """ calculate the AP attenuation vs distance after
    somatic injection 
    """
    stim = h.IClamp(0.5, sec = mycell.soma)
    stim.delay = 0.1
    stim.dur = 2.5
    stim.amp = 4.0

    # set zero distance
    h.distance(sec = mycell.soma)

    # Recording: AP waveforms from basal and apical sections 
    basal_seg = list()
    for sec in mycell.allbasalsec:
        for seg in sec:
            basal_seg.append(seg)
    myvectors_basal = simulate_voltage(5, basal_seg)

    apical_seg = list()
    for sec in mycell.allapicalsec:
        for seg in sec:
            apical_seg.append(seg)
    myvectors_apical = simulate_voltage(5, apical_seg)
    
    # Plotting  peak vs distance

    peak, dist = list(), list()
    for sec, vectors  in izip(mycell.allbasalsec, myvectors_basal):
        voltage = vectors.voltage
        peak.append(np.max(voltage) - voltage[0])
        dist.append(-h.distance(0, sec=sec))

    peaka, dista = list(), list()
    for sec, vectors  in izip(mycell.allapicalsec, myvectors_apical):
        voltage = vectors.voltage
        peak.append(np.max(voltage) - voltage[0])
        dist.append(h.distance(0, sec=sec))

    plt.plot(dist, peak,'o', markerfacecolor='red')
    plt.plot(dista, peaka, 'o', markerfacecolor='red')
    #plt.xlim(xmin=-100, xmax=400)
    #plt.ylim(ymax=110, ymin=0)
    plt.show()
Esempio n. 2
0
def get_peak(gnabar_hh):
    """ this functions returns the peak of the AP in the soma as a function
    of gnabar_hh in a CA3 neuron
    if gnabar_hh = 0.12 then peak is 96.881
    """
    mycell.soma.gnabar_hh = float(gnabar_hh)
    spike = simulate_voltage(5, [mycell.soma(0.5)]) 
    # voltage is HocVector obj (see CA3simulations.py)
    voltage = spike[0].voltage 
    peak = np.max(voltage) - voltage[0]
    return peak
    def get_peak(self, gnabar_hh, sec):
        """ returns the AP peak in the cell as a function
        of the gnabar_hh in the current section"""

        sec.gnabar_hh = float(gnabar_hh)
        # attach a simulator to section
        stim = self._stimulator(sec = sec)
        spike = simulate_voltage(5, [sec(0.5)])
        del stim
        # voltage is a HocVector obj (see CA3simulations.py)
        voltage = spike[0].voltage
        peak = np.max(voltage) - voltage[0]
        return peak
Esempio n. 4
0
# let fdistance to take the segment as an argument
fsec_apical = lambda section : fdistance( h.distance(0, sec=section) )

#fsec_basal = lambda sec: 0.01
fsec_basal = lambda sec: 0.02


# morphology and biophysics
neuron = Neuron(ApicalBasalActive)
h.distance(sec=neuron.soma)
neuron.get_Active().activatedendrites(fsec_apical, fsec_basal)
neuron.soma.gnabar_hh = 0.0

#=========================================================================
# Instrumentation:  current injection
#=========================================================================
stim = h.IClamp(0.5, sec = neuron.dend[112])
stim.delay = 2 
stim.dur = 0.3
stim.amp = 0.5


#=========================================================================
# Recording: AP waveforms from soma and apical dendrite 
#=========================================================================
soma, apical_dend = simulate_voltage(12, [neuron.soma, neuron.dend[112] ])

plt.plot(soma.get_time(), soma.get_voltage(), 'k', lw=1)
plt.plot(apical_dend.get_time(), apical_dend.get_voltage(), 'r', lw=1)
plt.show()
Esempio n. 5
0
h.distance(sec=neuron.soma)
neuron.get_Active().activatedendrites(fapical = fsec_apical, fbasal=fsec_basal)

#=========================================================================
# Instrumentation: Somatic current injection
#=========================================================================
stim = h.IClamp(0.5, sec = neuron.soma)
stim.delay = 0.1
stim.dur = 2.5
stim.amp = 4.0


#=========================================================================
# Recording: AP waveforms from basal and apical sections 
#=========================================================================
myvectors_basal = simulate_voltage(5, neuron.allbasalsec)
myvectors_apical = simulate_voltage(5, neuron.allapicalsec)
    
#=========================================================================
# Plotting  peak vs distance
#=========================================================================

peak, dist = list(), list()
for sec, vectors  in izip(neuron.allbasalsec, myvectors_basal):
    voltage = vectors.voltage
    peak.append(np.max(voltage) - voltage[0])
    dist.append(-h.distance(0, sec=sec))

peaka, dista = list(), list()
for sec, vectors  in izip(neuron.allapicalsec, myvectors_apical):
    voltage = vectors.voltage