Exemplo n.º 1
0
    def _prepare_epsp_protocol(self, epsp: EpspProtocol, global_time):
        synapse = epsp.syn
        current_time = global_time + epsp.init

        netstim = NetStimCell(name="stim")
        self.netstims.append(netstim)

        stim = netstim.add_netstim(start=current_time, number=epsp.num, interval=epsp.int)
        synapse.add_netcon(source=stim, weight=epsp.w, threshold=epsp.thr, delay=epsp.delay)
        current_time += epsp.int * epsp.num

        return current_time
Exemplo n.º 2
0
from neuronpp.utils.record import Record
from neuronpp.utils.iclamp import IClamp
from neuronpp.utils.utils import make_shape_plot
from neuronpp.core.cells.netstim_cell import NetStimCell

# Create cell
cell = Cell(name="cell")
path = os.path.dirname(os.path.abspath(__file__))
morpho_path = os.path.join(path, "..", "commons/morphologies/asc/cell2.asc")
cell.load_morpho(filepath=morpho_path)
cell.insert("pas")
cell.insert("hh")

# Create stim and synapses
ns_cell = NetStimCell("stim_cell")
ns = ns_cell.add_netstim(start=30, number=5, interval=10)

syns = cell.add_random_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
Exemplo n.º 3
0
from neuronpp.cells.ebner2019_ach_da_cell import Ebner2019AChDACell

path = os.path.dirname(os.path.abspath(__file__))

WEIGHT = 0.0035  # µS, conductance of (single) synaptic potentials
WARMUP = 200

if __name__ == '__main__':
    # define cell
    cell = Ebner2019AChDACell(name="cell")
    filepath = os.path.join(path, "..", "commons/morphologies/asc/cell1.asc")
    cell.load_morpho(filepath=filepath)

    # make NetStim stims
    ns_cell = NetStimCell("netstim_cell")
    stim1 = ns_cell.add_netstim(start=WARMUP + 1, number=1)

    # make VecStim
    vs_cell = VecStimCell("vecstim_cell")
    stim2 = vs_cell.make_vecstim(np.array([WARMUP + 50]))

    # make synapses with spines
    syns_4p, heads = cell.add_random_synapses_with_spine(source=None,
                                                         secs=cell.secs,
                                                         number=100,
                                                         netcon_weight=WEIGHT,
                                                         mod_name="Syn4PAChDa",
                                                         delay=1,
                                                         **cell.params_4p_syn)
    for s, h in zip(syns_4p, heads):
        syn_ach = cell.add_synapse(source=stim1,
Exemplo n.º 4
0
path = os.path.dirname(os.path.abspath(__file__))
model_path1 = os.path.join(path, "..", "commons/mods/ebner2019")
model_path2 = os.path.join(path, "..", "commons/morphologies/swc/my.swc")

# Prepare cell
cell = Cell(name="cell", compile_paths=model_path1)
cell.load_morpho(filepath=model_path2)
cell.add_sec("dend[1]", diam=10, l=10, nseg=10)
cell.connect_secs(child="dend[1]", parent="soma")
cell.insert("pas")
cell.insert("hh")

# Two examples of synapses with NetStim:
stim_cell = NetStimCell("stim_cell")
stim = stim_cell.add_netstim(start=250, number=30, interval=1)
soma = cell.filter_secs("soma")

# 1) Hoc-style synapse
pp = cell.add_point_process(mod_name="ExpSyn", seg=soma(0.5))
cell.add_netcon(source=stim, point_process=pp, netcon_weight=0.01, delay=1)

# 2) Recommended synapse
syn1 = cell.add_synapse(source=stim,
                        seg=soma(0.5),
                        netcon_weight=0.01,
                        mod_name="Syn4P",
                        delay=1)

# 3) Event synapse
syn2 = cell.add_synapse(source=None,