Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hard-coded initial membrane potentials #996

Open
katduecker opened this issue Feb 14, 2025 · 0 comments
Open

Hard-coded initial membrane potentials #996

katduecker opened this issue Feb 14, 2025 · 0 comments

Comments

@katduecker
Copy link
Collaborator

[adding this for documentation purposes]

state_init() in network_bulder.py hard codes the initial membrane potentials for each cell. https://github.com/jonescompneurolab/hnn-core/blob/master/hnn_core/network_builder.py#L611

This leads to issues for new models with different resting membrane potentials.

I think it was implemented in this way, instead of setting the initial values when creating the sections, based on the assumption that h.finitialize resets the starting membrane potential to -65 mV https://github.com/jonescompneurolab/hnn-core/blob/master/hnn_core/network_builder.py#L67

It turns out that h.finitialize does not reset the membrane potential to a default value, so the initial values can be implemented when creating the cell (I have tested this).

I cannot upload my .py files so I'll just briefly describe my current work around:

I pass a v_init dictionary to _get_dends in cells_default.py

  v_init = {'apical_1': -71.32,
            'apical_2': -69.08,
            'apical_tuft': -67.30,
            'apical_trunk': -72,
            'soma': -72.0,
            'basal_1': -72,
            'basal_2': -72,
            'basal_3': -72,
            'apical_oblique': -72}

  sections = _get_dends(p_all, cell_type='L5Pyr',
                        section_names=section_names, v_init=v_init)

add value v to the section class

 def __init__(self, L, diam, Ra, cm, v=-65, end_pts=None):

      self._L = L
      self._diam = diam
      self._Ra = Ra
      self._cm = cm
      self._v = v             # initial voltage for each section
      if end_pts is None:
          end_pts = list()
      self._end_pts = end_pts

      self.mechs = dict()
      self.syns = list()

      # For distance functionality
      self.nseg = _get_nseg(self.L)

and then I set v to the initial value in _set_biophysics in cell.py
setattr(sec, 'v', section.v)

I'm working on a new model in local copy of HNN, but let me know if and how soon we'd want this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant