Ejemplo n.º 1
0
    def build_hoc_for_instance(self, instance, hocfile_obj):
        
        params = instance.get_resolved_parameters()
        tau_open = params['tau_open']
        tau_close = params['tau_close']
        e_rev = params['e_rev']
        popening = params['popening']
        vdep = params['vdep']
        
        cell = instance.cell_location.cell
        section = instance.cell_location.morphlocation.section
        syn_name_post = instance.synapse.get_name() + 'Post'
        hoc_data_cell = hocfile_obj[MHocFileData.Cells][cell]
        data = {
            'synnamepost': syn_name_post,
            'cell': cell,
            'cellname': hoc_data_cell['cell_name'],
            'sectionindex': hoc_data_cell['section_indexer'][section],
            'sectionpos': instance.cell_location.morphlocation.sectionpos,
            'tau_open': tau_open,
            'tau_close': tau_close,
            'e_rev': e_rev,
            'pOpening': popening,
               'random_seed': MFRandom.get_seed(),
            'is_vdep_on': (1.0 if vdep else 0.0),
               }

        hocfile_obj.add_to_section(MHOCSections.InitSynapsesChemPost,
                                   Template(exp2HOCTmpl, data).respond())

        hocfile_obj[MHocFileData.Synapses][instance.synapse] = {}
        hocfile_obj[MHocFileData.Synapses][instance.synapse]['POST'] = data
Ejemplo n.º 2
0
    def build_hoc_for_instance(self, instance, hocfile_obj):

        params = instance.get_resolved_parameters()
        tau_open = params['tau_open']
        tau_close = params['tau_close']
        e_rev = params['e_rev']
        popening = params['popening']
        vdep = params['vdep']

        cell = instance.cell_location.cell
        section = instance.cell_location.morphlocation.section
        syn_name_post = instance.synapse.get_name() + 'Post'
        hoc_data_cell = hocfile_obj[MHocFileData.Cells][cell]
        data = {
            'synnamepost': syn_name_post,
            'cell': cell,
            'cellname': hoc_data_cell['cell_name'],
            'sectionindex': hoc_data_cell['section_indexer'][section],
            'sectionpos': instance.cell_location.morphlocation.sectionpos,
            'tau_open': tau_open,
            'tau_close': tau_close,
            'e_rev': e_rev,
            'pOpening': popening,
            'random_seed': MFRandom.get_seed(),
            'is_vdep_on': (1.0 if vdep else 0.0),
        }

        hocfile_obj.add_to_section(MHOCSections.InitSynapsesChemPost,
                                   Template(exp2HOCTmpl, data).respond())

        hocfile_obj[MHocFileData.Synapses][instance.synapse] = {}
        hocfile_obj[MHocFileData.Synapses][instance.synapse]['POST'] = data
Ejemplo n.º 3
0
    def build_hoc_for_instance(self, instance, hocfile_obj):

        params = instance.get_resolved_parameters()
        tau_open = params["tau_open"]
        tau_close = params["tau_close"]
        e_rev = params["e_rev"]
        popening = params["popening"]
        vdep = params["vdep"]
        limit_conductance = params["limit_conductance"]
        peak_conductance = params["peak_conductance"]

        gamma = params["gamma"]
        eta = params["eta"]
        mg2conc = params["mg2conc"]

        cell = instance.cell_location.cell
        section = instance.cell_location.morphlocation.section
        syn_name_post = instance.name + "Post"
        hoc_data_cell = hocfile_obj[MHocFileData.Cells][cell]
        data = {
            "synnamepost": syn_name_post,
            "cell": cell,
            "cellname": hoc_data_cell["cell_name"],
            "sectionindex": hoc_data_cell["section_indexer"][section],
            "sectionpos": instance.cell_location.morphlocation.sectionpos,
            "tau_open": tau_open,
            "tau_close": tau_close,
            "e_rev": e_rev,
            "pOpening": popening,
            "random_seed": MFRandom.get_seed(),
            "is_vdep_on": (1.0 if vdep else 0.0),
            "is_conductance_limited_on": (1.0 if limit_conductance not in [None, False] else 0.0),
            "conductance_limit": (limit_conductance if limit_conductance not in [None, False] else -1.0),
            "peak_conductance": peak_conductance,
            "gamma": gamma,
            "eta": eta,
            "mg2conc": mg2conc,
        }

        hocfile_obj.add_to_section(MHOCSections.InitSynapsesChemPost, Template(exp2HOCTmpl, data).respond())

        assert not instance in hocfile_obj[MHocFileData.Synapses]
        hocfile_obj[MHocFileData.Synapses][instance] = data