Simon-at-Ely / NML2_Test

Repository for experimenting with NeuroML2
0 stars 0 forks source link

NeuroML2 Conversion of Accessory Olfactory Bulb Model produces faster Inter-Burst Intervals #2

Open Simon-at-Ely opened 8 years ago

Simon-at-Ely commented 8 years ago

The AOB Mitral cell Model https://github.com/Simon-at-Ely/Channel_Kinetics/tree/master/AccessoryOlfactoryBulb/MitralCell/neuroConstruct/AOB_MC_Single_Channel_Tests produces spontaneous intrinsic burst firing. Here is a screen shot of the generatedNeuron version: aobmc1_genneuron When the model is then generated as NeuroML2 the inter-burst interval is significantly reduced: aobmc1_gennml2 I used pynml -channelanalysis to generate plots of all the channel variables: https://github.com/Simon-at-Ely/NML2_Test/blob/master/iAMC_Fig10H3T/channel_summary/README.md Then I tested all the generated plots against the equations using numpy/matplotlib in an ipython notebook: https://github.com/Simon-at-Ely/NML2_Test/blob/master/iAMC_Fig10H3T/generated_NML2_gate_variables.ipynb Most of the channels produced exact matches except the Maex and De Schutter 1998 BK channel and the Migliore et al 2005 Sodium Channels. I will raise separate issues for these anomalies. As yet I do not know if these are the reason for the faster inter burst interval or some other part of the model is responsible.

pgleeson commented 8 years ago

@Simon-at-Ely, I've tried running this from the nC project here: https://github.com/Simon-at-Ely/Channel_Kinetics/tree/master/AccessoryOlfactoryBulb/MitralCell/neuroConstruct/AOB_MC_Single_Channel_Tests and while the version generating Neuron from nC works, it produces different behaviour (a 40s burst), and the nml2 version gives an error. Have you committed the latest nc project?

Also, I just noticed that the simulation is over 60 seconds... I don't think I've ever got a model converted between any 2 formats to match well over that time period, it's usually max 1-2 seconds. There are small differences in the way the mod files are generated between the nml1 version and nml2, but these are usually negligible over ~2seconds. Over a longer period small differences will build up. A more relevant source of difference is in dt (smaller dt will decrease the differences between mod impls). Try changing the dt in the neuron version to 0.01 and see whether the bursts change (in my example the burst of 40s changed to 60sec). Ideally you should compare the nml1 and nml2 versions at a smaller dt and over ~2sec. 10 sec might be possible too.

Simon-at-Ely commented 8 years ago

@pgleeson, Thanks for your message, I have committed a newer version nCproject that I have cloned and modified locally as my working copy here: https://github.com/Simon-at-Ely/NML2_Test/tree/master/AOB_MC_neuroConstruct you should not have the problems that you described as I have just used it to generate comparisons at a dt = 0.01. I have continued with the 60 second comparison as the phenomenon that I am interested in is the inter-burst intervals. There is a subset of mitral cells in the accessory olfactory bulb that I was modelling that exhibit very slow intrinsic rhythmogenesis http://jneurosci.org/content/36/11/3127. At a dt of 0.01 the generatedNeuron model has a bit longer bursts... aobmc1_genneuron_dt_0_01 While the generatedNeuroML2 now has longer inter-burst intervals aobmc1_gennml2_dt_0_01 They are still not perfect matches, but are certainly much closer and considering your caveat that matching over shorter periods is possible while small differences add up over longer periods. I will do a comparison over 2 seconds next and post when I have done it.

Simon-at-Ely commented 8 years ago

generatedNeuron 2 seconds dt = 0.01 aobmc1_genneuron_dt_0_01_2s generatedNeuroML2 2 seconds dt = 0.01 aobmc1_gennml2_dt_0_01_2s Looks pretty close at the 2 second time span, I will try superimposing them in matplotlib tomorrow...

Simon-at-Ely commented 8 years ago

Here is the comparison of Neuron versus NeuroML2 in matplotlib: neuron_nml2_comp_2s @pgleeson if I leave this issue open for the moment, if progress is made with the BK channel or the sodium channels I can post the new comparisons here. Also in your comment you say "There are small differences in the way the mod files are generated between the nml1 version and nml2" is there a know list of differences, or are you just referring to the kind of issues that I have raised for the BK channel and sodium channels?

Simon-at-Ely commented 8 years ago

I have now done a comparison of generated Neuron versus NeuroML2 in matplotlib after changing the model parameters to those used to produce the other model Figure in the http://jneurosci.org/content/36/11/3127 (Figure 10 H (ii) top):

neuron_nml2_2s

The model can be found here: https://github.com/Simon-at-Ely/NML2_Test/tree/master/iAMC_Fig10H2T/AOB_MC_neuroConstruct

and the difference in parameters between the two Figures can be found here: https://github.com/Simon-at-Ely/Channel_Kinetics/blob/master/AccessoryOlfactoryBulb/MitralCell/ipython/MultipleChannelModel/iAMT_model_specification.ipynb