Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
46575c2
new model with mod files
katduecker Jan 23, 2025
52bc675
updated t shifts (different for l5 and l23)
katduecker Mar 12, 2025
3913dd2
don't include arm64
katduecker Mar 12, 2025
84f6aae
tuning new L23 cells, new L5 cells
katduecker Mar 24, 2025
3f32086
add bsl correction, updated mod files, default params
katduecker Apr 2, 2025
11f443f
tune conn
katduecker Apr 17, 2025
9d2199a
resolve merge conflict
katduecker Apr 17, 2025
d8ae520
different weights gabaa and gabab, change EI conn
katduecker Apr 17, 2025
fee2f09
update calcium decay
katduecker Apr 29, 2025
3124207
update connectivity
katduecker May 1, 2025
d0aa7e4
update conn
May 7, 2025
4b49ab5
update bsl correction
katduecker May 7, 2025
4a645c2
update conn
May 9, 2025
ff1e7c6
tune connectivity
May 9, 2025
b4895f7
tune connectivity
May 9, 2025
fcaf9ca
Merge branch 'new_model' of https://github.com/katduecker/hnn-core in…
katduecker May 30, 2025
69c1c9d
update model name
katduecker Jun 15, 2025
e80d28f
store params in json file
katduecker Jun 15, 2025
b077d59
create default json for human ET model
katduecker Jun 15, 2025
2ae06c5
update ERP drives of ET model in json
katduecker Jun 15, 2025
d2949a1
add hierarchical network params
katduecker Jul 2, 2025
fef148e
change model name
katduecker Jul 17, 2025
9095a3c
change basal Ra
katduecker Jul 20, 2025
843e038
basal dendrite Ra ack to 200OHM
katduecker Jul 31, 2025
e10f04d
hotzone top apical_2
katduecker Aug 14, 2025
a3679be
update leak model
katduecker Aug 15, 2025
a3585f3
update L5
katduecker Aug 23, 2025
b28173d
update default file
katduecker Sep 14, 2025
0e90e93
new model
katduecker Sep 16, 2025
956f143
increase conductance basal dendrite L2/3
katduecker Sep 16, 2025
d0d2ee5
update basal L2/3
katduecker Sep 16, 2025
31b0f3b
tune connectivity new model
katduecker Sep 17, 2025
d842c18
tune connectivity
katduecker Sep 17, 2025
c44c0d3
update conn
katduecker Sep 17, 2025
05d67e3
update connectivity
Sep 19, 2025
9ef8037
update cells
katduecker Sep 19, 2025
3fd8efc
Merge branch 'l23_hotzone' of https://github.com/katduecker/hnn-core …
katduecker Sep 19, 2025
deddfbd
starting point gamma simulations
katduecker Sep 23, 2025
5cd060d
update connectivity
Sep 24, 2025
025a0b7
update baseline corr
katduecker Sep 25, 2025
747bb6a
baseline corr
katduecker Sep 25, 2025
a9ab5fb
use exponential function for baseline correction to speed up
katduecker Sep 25, 2025
dfb64a6
update connectivity
Sep 30, 2025
2198b7f
tune connectivity for ERP
katduecker Oct 14, 2025
60141f5
update L5 conductances ...
katduecker Oct 14, 2025
3aefa6e
new model with mod files
katduecker Jan 23, 2025
4d1fbbb
updated t shifts (different for l5 and l23)
katduecker Mar 12, 2025
27a998e
don't include arm64
katduecker Mar 12, 2025
e141f70
tuning new L23 cells, new L5 cells
katduecker Mar 24, 2025
c330554
add bsl correction, updated mod files, default params
katduecker Apr 2, 2025
ea20c43
tune conn
katduecker Apr 17, 2025
bea09c3
resolve merge conflict
katduecker Apr 17, 2025
ae2dba2
different weights gabaa and gabab, change EI conn
katduecker Apr 17, 2025
b40ae24
update calcium decay
katduecker Apr 29, 2025
d25e254
update connectivity
katduecker May 1, 2025
1cca49b
tune connectivity
May 9, 2025
1c816c7
update conn
May 7, 2025
e6bfbad
update bsl correction
katduecker May 7, 2025
8a643fa
update conn
May 9, 2025
3babd57
tune connectivity
May 9, 2025
4408e20
update model name
katduecker Jun 15, 2025
b0331ca
store params in json file
katduecker Jun 15, 2025
fc1b68f
create default json for human ET model
katduecker Jun 15, 2025
bf56963
update ERP drives of ET model in json
katduecker Jun 15, 2025
bafca69
add hierarchical network params
katduecker Jul 2, 2025
179cc9d
change model name
katduecker Jul 17, 2025
a477f26
change basal Ra
katduecker Jul 20, 2025
63075bf
basal dendrite Ra ack to 200OHM
katduecker Jul 31, 2025
4fd0b07
hotzone top apical_2
katduecker Aug 14, 2025
0506d59
update leak model
katduecker Aug 15, 2025
465f871
update L5
katduecker Aug 23, 2025
dbb061b
update default file
katduecker Sep 14, 2025
980720f
new model
katduecker Sep 16, 2025
6178a08
increase conductance basal dendrite L2/3
katduecker Sep 16, 2025
0b384f6
update basal L2/3
katduecker Sep 16, 2025
90e5874
tune connectivity new model
katduecker Sep 17, 2025
e3b00fc
tune connectivity
katduecker Sep 17, 2025
53ca6f7
update conn
katduecker Sep 17, 2025
ca68860
update cells
katduecker Sep 19, 2025
177d6b1
update connectivity
Sep 19, 2025
69a65e8
starting point gamma simulations
katduecker Sep 23, 2025
a342b85
update connectivity
Sep 24, 2025
b5cf71a
update baseline corr
katduecker Sep 25, 2025
da46d27
baseline corr
katduecker Sep 25, 2025
eaf7a03
use exponential function for baseline correction to speed up
katduecker Sep 25, 2025
64435cb
update connectivity
Sep 30, 2025
8a3a4b6
tune connectivity for ERP
katduecker Oct 14, 2025
c6f500c
update L5 conductances ...
katduecker Oct 14, 2025
249fc56
update baseline correction
katduecker Oct 22, 2025
d3a1f6f
conflicts
katduecker Oct 22, 2025
c15e520
update merge conflicts
Oct 22, 2025
fced9fd
update free calcium
katduecker Oct 22, 2025
f36d912
gamma sim and a little conn tuning
katduecker Oct 27, 2025
e06ade4
change connectivity
katduecker Oct 29, 2025
2023dff
change param back to last week
katduecker Oct 30, 2025
0b70458
calcium dyn back to settings last week
katduecker Oct 30, 2025
5fda75a
change back to good beta events
katduecker Oct 30, 2025
66049fd
bug fix objective_functions
katduecker Oct 30, 2025
c7a374a
handtune multiple trials
katduecker Oct 31, 2025
73ba60c
bug fix and re-update conn
katduecker Nov 3, 2025
6ba40fa
update conn
katduecker Nov 3, 2025
a0b2de9
update conn and interneuron soma v_init
katduecker Nov 12, 2025
f0b8ad3
update normalization
katduecker Nov 12, 2025
428a3a8
rename model to duecker_ET_model
katduecker Nov 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hnn_core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
)
from .params import Params, read_params, convert_to_json
from .network import Network, pick_connection
from .network_models import jones_2009_model, law_2021_model, calcium_model
from .network_models import jones_2009_model, law_2021_model, calcium_model, duecker_ET_model
from .cell import Cell
from .cell_response import CellResponse, read_spikes
from .cells_default import pyramidal, basket
Expand Down
76 changes: 61 additions & 15 deletions hnn_core/cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,20 @@ class Section:
membrane capacitance in micro-Farads.
Ra : float
axial resistivity in ohm-cm.
v : float
start value for membrane potential.
v : float
start value for membrane potential.
nseg : int
Number of segments in the section
"""
def __init__(self, L, diam, Ra, cm, v=-65, end_pts=None):

def __init__(self, L, diam, Ra, cm, 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
Expand All @@ -221,7 +226,7 @@ def __init__(self, L, diam, Ra, cm, end_pts=None):
self.nseg = _get_nseg(self.L)

def __repr__(self):
return f"L={self.L}, diam={self.diam}, cm={self.cm}, Ra={self.Ra}"
return f'L={self.L}, diam={self.diam}, cm={self.cm}, Ra={self.Ra}, v={self.v}'

def __eq__(self, other):
if not isinstance(other, Section):
Expand Down Expand Up @@ -260,12 +265,13 @@ def to_dict(self):
dictionary form of an object of Section class.
"""
section_data = dict()
section_data["L"] = self.L
section_data["diam"] = self.diam
section_data["cm"] = self.cm
section_data["Ra"] = self.Ra
section_data["end_pts"] = self.end_pts
section_data["nseg"] = self.nseg
section_data['L'] = self.L
section_data['diam'] = self.diam
section_data['cm'] = self.cm
section_data['Ra'] = self.Ra
section_data['end_pts'] = self.end_pts
section_data['nseg'] = self.nseg
section_data['v'] = self._v
# Need to solve the partial function problem
# in mechs
section_data["mechs"] = self.mechs
Expand All @@ -287,6 +293,10 @@ def cm(self):
@property
def Ra(self):
return self._Ra

@property
def v(self):
return self._v

@property
def end_pts(self):
Expand Down Expand Up @@ -571,16 +581,18 @@ def _set_biophysics(self, sections):
# SECTION!!!
h.distance(sec=self._nrn_sections["soma"])
for sec_name, section in sections.items():
sec = self._nrn_sections[sec_name]
sec = self._nrn_sections[sec_name]

for mech_name, p_mech in section.mechs.items():
sec.insert(mech_name)
setattr(sec, 'v', section.v)
for attr, val in p_mech.items():
if isinstance(val, list):
seg_xs, seg_vals = val[0], val[1]
for seg, seg_x, seg_val in zip(sec, seg_xs, seg_vals):
setattr(seg, attr, seg_val)
else:
setattr(sec, attr, val)
setattr(sec, attr, val)

def _compute_section_mechs(self):
sections = self.sections
Expand All @@ -607,7 +619,13 @@ def _create_synapses(self, sections, synapses):
for receptor in sections[sec_name].syns:
syn_key = f"{sec_name}_{receptor}"
seg = self._nrn_sections[sec_name](0.5)
self._nrn_synapses[syn_key] = self.syn_create(seg, **synapses[receptor])

if receptor == 'gabab':
self._nrn_synapses[syn_key] = self.syn_create(
seg, **synapses[receptor])
else:
self._nrn_synapses[syn_key] = self.syn_create(
seg, **synapses[receptor])

def _create_sections(self, sections, cell_tree):
"""Create soma and set geometry.
Expand Down Expand Up @@ -642,6 +660,7 @@ def _create_sections(self, sections, cell_tree):
sec.Ra = sections[sec_name].Ra
sec.cm = sections[sec_name].cm
sec.nseg = sections[sec_name].nseg
sec.v = sections[sec_name].v

if cell_tree is None:
cell_tree = dict()
Expand Down Expand Up @@ -850,14 +869,37 @@ def syn_create(self, secloc, e, tau1, tau2):
A two state kinetic scheme synapse.
"""
if not isinstance(secloc, nrn.Segment):
raise TypeError(
f"secloc must be instance ofnrn.Segment. Got {type(secloc)}"
)
raise TypeError(f'secloc must be instance of'
f'nrn.Segment. Got {type(secloc)}')
syn = h.Exp2Syn(secloc)
syn.e = e
syn.tau1 = tau1
syn.tau2 = tau2
return syn

# GABAB synapse
def syn_create_gabab(self, secloc, e, tau1, tau2):
if not isinstance(secloc, nrn.Segment):
raise TypeError(f'secloc must be instance of'
f'nrn.Segment. Got {type(secloc)}')
syn = h.GABAB(secloc)
syn.e = e
syn.tau1 = tau1
syn.tau2 = tau2

return syn

# GABAB synapse
def syn_create_gabab(self, secloc, e, tau1, tau2):
if not isinstance(secloc, nrn.Segment):
raise TypeError(f'secloc must be instance of'
f'nrn.Segment. Got {type(secloc)}')
syn = h.GABAB(secloc)
syn.e = e
syn.tau1 = tau1
syn.tau2 = tau2

return syn

def setup_source_netcon(self, threshold):
"""Created for _PC.cell and specifies SOURCES of spikes.
Expand Down Expand Up @@ -1062,7 +1104,7 @@ def _update_end_pts(self):
# of sections.
self.define_shape(("soma", 0))

def modify_section(self, sec_name, L=None, diam=None, cm=None, Ra=None):
def modify_section(self, sec_name, L=None, diam=None, cm=None, Ra=None, v=None):
"""Change attributes of section specified by `sec_name`

Parameters
Expand Down Expand Up @@ -1100,5 +1142,9 @@ def modify_section(self, sec_name, L=None, diam=None, cm=None, Ra=None):
if Ra is not None:
_validate_type(Ra, (float, int), "Ra")
self.sections[sec_name]._Ra = Ra

if v is not None:
_validate_type(v, (float, int), 'v')
self.sections[sec_name]._v = v

self._update_end_pts()
Loading
Loading