-
Notifications
You must be signed in to change notification settings - Fork 53
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
[MRG] Record calcium concentration #792
Conversation
hnn_core/cell.py
Outdated
if 'ca' in self.sections[sec_name].mechs: | ||
self.ca[sec_name] = h.Vector() | ||
self.ca[sec_name].record( | ||
self._nrn_sections[sec_name](0.5)._ref_cai) # there may be an issue here with referencing mod file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep or remove?
@@ -348,6 +348,11 @@ class Cell: | |||
by synapse type (keys can be soma_gabaa, soma_gabab etc.). | |||
Must be enabled by running simulate_dipole(net, record_isec=True) | |||
or simulate_dipole(net, record_isoma=True) | |||
ca : dict | |||
Contains recording of section speicifc calcium concentration. | |||
Must be enabled by running simulate_dipole(...) with record_ca |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must be enabled by running simulate_dipole(...) with record_ca | |
Must be enabled by running simulate_dipole(net, record_ca) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we tell the user what to do? Because "True" won't work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @jasmainak is copying that from the docstring above for record_isoma
, which is out of date.
But yes the docstring should read Must be enabled by running simulate_dipole(..., record_ca='all')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just wanted to say that use the function signature rather than using words to explain it.
hnn_core/tests/test_dipole.py
Outdated
assert len(mpi_net.cell_response.vsec) == n_trials | ||
assert len(mpi_net.cell_response.isec) == n_trials | ||
assert len(mpi_net.cell_response.vsec[trial_idx][gid]) == 8 # num sec | ||
assert len(mpi_net.cell_response.isec[trial_idx][gid]) == 1 | ||
assert len(mpi_net.cell_response.isec[trial_idx][gid]) == 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this must be a pep8 issue
@ntolley monthly issue metrics fails ! |
Fixed! |
@@ -37,6 +37,9 @@ def simulate_dipole(net, tstop, dt=0.025, n_trials=None, record_vsec=False, | |||
record_isec : 'all' | 'soma' | False | |||
Option to record voltages from all sections ('all'), or just | |||
the soma ('soma'). Default: False. | |||
record_ca : 'all' | 'soma' | False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can actually just copy the docstring here to the one in cell.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also replace the incorrect record isoma/vsoma docstrings in cell.py
with the isec/vsec docstrings here?
|
||
if record_ca: | ||
for sec_name in self.ca: | ||
if 'ca' in self.sections[sec_name].mechs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if 'ca' in self.sections[sec_name].mechs: | |
if hasattr(self._nrn_sections[sec_name](0.5), '_ref_cai):: |
Your suggestion! Just making sure we don't forget
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR looks clean to me. I leave it to @ntolley to check and merge :) Don't forget to update whats_new !
Here's the plot with the spikes/Ca overlaid. At first I thought something was wrong but realized I hadn't set the times correctly. Very nice work @katduecker! This definitely looks good from hnn_core import simulate_dipole, jones_2009_model
import numpy as np
import matplotlib.pyplot as plt
net = jones_2009_model()
net.add_evoked_drive('evprox', mu=20.0, sigma=2.0, numspikes=1,
location='proximal', weights_ampa={'L5_pyramidal': 0.1})
plt.figure()
fig, ax = plt.subplots(2, 1, figsize=(5, 4), sharex=True, tight_layout=True)
plot_data = np.array([net.cell_response.ca[0][gid]['soma'] for gid in net.gid_ranges['L5_pyramidal']]).T
ax[0].plot(dpl[0].times, plot_data)
ax[0].set_title('Somatic Ca$^{2+}$')
ax[1].set_title('Spike Raster')
net.cell_response.plot_spikes_raster(ax=ax[1]) |
Thanks both! I haven't managed to look at the rest of this yet, as I have been busy with the NEURON workshop. One thing I learned today at the workshop is that calcium concentration should be at the order a few hundred nM, but our calcium concentration is at the order of 0.1 mM (mod file of ca shows that cai is in mM). This is 1000 times too high... Am I missing something obvious with a conversion of the units? |
We use reduced neurons acc to Bush and Sejnowski 93, so do we actually
expect physical units?
…Sent from my iPhone
On Tue 18 Jun 2024 at 21:24, Katharina Duecker ***@***.***> wrote:
Thanks both! I haven't managed to look at the rest of this yet, as I have
been busy with the NEURON workshop. One thing I learned today at the
workshop is that calcium concentration should be at the order a few hundred
nM, but our calcium concentration is at the order of 0.1 mM (mod file of ca
shows that cai is in mM). This is 1000 times too high... Am I missing
something obvious with a conversion of the units?
—
Reply to this email directly, view it on GitHub
<#792 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADY6FIUFFDSYUXZ36CR7SHLZIDMVTAVCNFSM6AAAAABJHDF536VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZXGM2DOOJRGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I asked Stephanie about this and she said that it may be possible that the conductance had to be scaled up to get the desired dynamics. To confirm this, I will read out the concentration for sodium and potassium as well, to see if they are in a similar regime. I remember @ntolley saying that an option to read out concentrations for all ions may not be a useful functionality in general, but if it allows sanity checks of the scale of the conductance, couldn't it be helpful for users to have access to this? I'd be happy to write a tutorial on this if we decide to integrate. |
Recording calcium concentration in all sections of the L5 pyramidal neurons