Closed christian-oreilly closed 1 year ago
@pgleeson : this one looks like one for you :)
(Note: probably belongs to one of the java packages, probably org.neuroml.export---this does the writing to NEURON, but we can move it there later)
Yes, since there are different pieces of software interacting (pyNeuroML, libNeuroML, java backend, ...) I was not completely sure where to submit this. The issue seemed to me to be due to LEMSSimulation
which is part of pyNeuroML
but I did not look further to see if the issue was in an underlying lib.
Good point. Will look into this...
@christian-oreilly As you guessed, the issue is down to ik, ina being used to record the current, which works fine if there is just one K or Na based channel (e.g. classic HH), but fails if there are 2 or more (just returns the sum). This will require an update of the mod file generated bu jnml from NML channels (which needs to be updated for other changes) and will be worked on over the next 1-2 weeks. Hope this is ok.
Sure, @pgleeson, that would actually be more than OK but great!
@christian-oreilly I have a local version of this working, see below where different K currents are plotted independently. I need to do a few more tests to make sure it doesn't break anything else, and will make a new release of pynml in the next few days.
Sorry for the delay in getting back about this @christian-oreilly, but the latest pyNeuroML should support this now: https://pypi.org/project/pyNeuroML/#history
See this example for multiple K currents which can be recorded/plotted independently: https://github.com/NeuroML/NeuroML2/blob/development/LEMSexamples/LEMS_NML2_Ex15_CaDynamics.xml#L365
Note though, the units for the current have been corrected to use consistent units in NEURON: https://github.com/NeuroML/org.neuroml.export/pull/89/files#diff-64ca13373b09c711e7b7a15647df2c332806b9bb9f02d230e8bc51543bdecc78, and when they're saved to file they're still saved in SI units.
Note also, that the direction of the current being saved is reversed, i.e. currents into the cell like Na are now positive, to match the default behaviour in jLEMS (as the current handling is defined in the LEMS language).
Let me know if you have questions or issues.
@pgleeson That looks great! Thanks for having a look at that. It will be very useful to debug models with multiple currents.
When creating two different types of channels using the same variety of ions ion, e.g.,
and then trying to plot the current density for these channels, e.g.,
the entity recorded is specified as the channel type (as specified in the
quantity
argument), not the ion variety. The NeuroML file is created accordinglybut when simulated with NEURON, it ends up recording the currents that are ion-specific (i.e, potassium), not channel-specific (i.e., Kdrfast_soma, KvAolm_soma):
and, sure enough, the two recorded signals for Kdrfast_soma and KvAolm_soma end up being identical! I assume this is a bug and not intentional behavior.