Beispiel #1
0
    def cell_description(self, gid):
        """A high level description of the cell with global identifier gid.

        For example the morphology, synapses and ion channels required
        to build a multi-compartment neuron.
        """
        assert gid in [0, 1]

        tree = arbor.segment_tree()

        tree.append(arbor.mnpos,
                    arbor.mpoint(0, 0, 0, self.radius),
                    arbor.mpoint(self.length, 0, 0, self.radius),
                    tag=1)

        labels = arbor.label_dict({
            'cell': '(tag 1)',
            'gj_site': '(location 0 0.5)'
        })

        decor = arbor.decor()
        decor.set_property(Vm=self.Vms[gid])
        decor.set_property(cm=self.cm)
        decor.set_property(rL=self.rL)

        # add a gap junction mechanism at the "gj_site" location and label that specific mechanism on that location "gj_label"
        junction_mech = arbor.junction('gj', {"g": self.gj_g})
        decor.place('"gj_site"', junction_mech, 'gj_label')
        decor.paint('"cell"',
                    arbor.density(f'pas/e={self.Vms[gid]}', {'g': self.g}))

        if self.cv_policy_max_extent is not None:
            policy = arbor.cv_policy_max_extent(self.cv_policy_max_extent)
            decor.discretization(policy)
        else:
            decor.discretization(arbor.cv_policy_single())

        return arbor.cable_cell(tree, labels, decor)
# Paint density mechanisms.

decor.paint('"all"', 'pas')
decor.paint('"custom"', 'hh')
decor.paint('"dend"', mech('Ih', {'gbar': 0.001}))

# Place stimuli and spike detectors.

decor.place('"root"', arbor.iclamp(10, 1, current=2), "iclamp0")
decor.place('"root"', arbor.iclamp(30, 1, current=2), "iclamp1")
decor.place('"root"', arbor.iclamp(50, 1, current=2), "iclamp2")
decor.place('"axon_terminal"', arbor.spike_detector(-10), "detector")

# Set cv_policy

soma_policy = arbor.cv_policy_single('"soma"')
dflt_policy = arbor.cv_policy_max_extent(1.0)
policy = dflt_policy | soma_policy
decor.discretization(policy)

# Create a cell

cell = arbor.cable_cell(morph, labels, decor)

# (2) Declare a probe.

probe = arbor.cable_probe_membrane_voltage('"custom_terminal"')

# (3) Create a recipe class and instantiate a recipe