Ejemplo n.º 1
0
 def hh_cell(name):
     cell = Cell(name=f"cell_{name}")
     soma = cell.add_sec("soma", diam=20, l=20, nseg=10)
     cell.add_sec("apic", diam=2, l=50, nseg=100)
     cell.insert("hh")
     cell.connect_secs(child="apic", parent="soma", child_loc=0, parent_loc=1)
     cell.make_spike_detector(soma(0.5))
     return cell
Ejemplo n.º 2
0
 def cell_function():
     cell = Cell(name="cell")
     morpho_path = os.path.join(path, "..", "commons/morphologies/asc/cell1.asc")
     cell.load_morpho(filepath=morpho_path)
     cell.insert("pas")
     cell.insert("hh")
     cell.make_spike_detector(seg=cell.filter_secs("soma")(0.5))
     return cell
Ejemplo n.º 3
0
def get_cell_with_iclamps_as_synapses(warmup, dur, name, input_size, low=0.08, high=0.1):
    # Create cell
    cell = Cell(name=name)
    soma = cell.add_sec("soma", diam=10, l=10, nseg=5)
    dend = cell.add_sec("dend", diam=5, l=100, nseg=50)
    cell.connect_secs(child=dend, parent=soma)
    cell.insert("hh")

    # Make synapses
    iclamp_syns = []
    for i in range(input_size):
        iclamp = IClamp(segment=dend(np.random.rand()))
        syn = iclamp.stim(delay=warmup, dur=dur, amp=UniformDist(low=low, high=high))
        iclamp_syns.append(syn)

    # Make recording
    rec = Record(elements=soma(0.5), variables='v')
    cell.make_spike_detector(seg=soma(0.5))
    return cell, iclamp_syns, rec
Ejemplo n.º 4
0
ns_cell = NetStimCell("stim_cell")
ns = ns_cell.make_netstim(start=30, number=5, interval=10)

syns = cell.add_synapses_with_spine(source=ns,
                                    secs=cell.filter_secs("apic"),
                                    mod_name="ExpSyn",
                                    netcon_weight=0.01,
                                    delay=1,
                                    number=100)
soma = cell.filter_secs("soma")

# Create IClamp
ic = IClamp(segment=soma(0.5))
ic.stim(delay=100, dur=10, amp=0.1)

# prepare plots and spike detector
rec_v = Record(soma(0.5), variables="v")
cell.make_spike_detector(soma(0.5))

# run
sim = Simulation(init_v=-65,
                 warmup=20,
                 init_sleep=2,
                 with_neuron_gui=True,
                 shape_plots=[make_shape_plot()])
sim.run(runtime=200, stepsize=1, delay_between_steps=500)

# plot
cell.plot_spikes()
rec_v.plot()
plt.show()