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

Define parameters for simulated experiment using jNeuroML on the command line, based on the methods that went into the figure #31

Open
slarson opened this issue Jan 18, 2015 · 19 comments

Comments

@slarson
Copy link
Member

slarson commented Jan 18, 2015

Here's the figure:

screen shot 2015-01-18 at 2 14 00 pm

Key points to test:

  • Run the muscle model in voltage clamp mode
  • modulate voltage for ~1s in a square pulse as shown.
  • should result in initial current amplitude change of ~160 pA
  • should decay to steady state of ~70 pA until voltage is released
  • time constants of decay should match both figures
  • Do the equivalent test for the impulse in the second figure on the right

It is not clear exactly what voltage to modulate to -- therefore use trial and error initially to pick a value that will result in the correct initial current amplitude and test if the other parameters are consistent. Otherwise, work out the correct voltage amount via information in the paper.

direct link to paper

This unit test should be instrumented to run in Travis-CI

FYI @rayner @VahidGh @rgerkin @ahrasheed

@rgerkin
Copy link
Member

rgerkin commented Jan 28, 2015

@slarson @pgleeson
Is there an existing procedure for regenerating the LEMS file (LEMS_NeuronMuscle.xml) with the desired parameters, other than simply editing the file, by analogy to NMLChannelAnalyse for the channel files?

@slarson
Copy link
Member Author

slarson commented Feb 2, 2015

@rgerkin I think what you are describing is what we want to do with #18 -- running the cell-level LEMS file through an optimization process to pick desired parameters.

@travs travs added this to the Validation milestone May 7, 2015
@travs travs changed the title Create unit test on the full muscle model that reproduces Figure 1A from Liu, Hollopeter, & Jorgensen 2009 Define parameters for simulated experiment using jNeuroML on the command line, based on the methods that went into the figure Jun 21, 2015
@travs
Copy link

travs commented Jun 21, 2015

This would be complete if we had the exact shell command(s) that runs the muscle model under the right set of parameters.

@pgleeson
Copy link
Member

Looking at Figure 1 more closely, isn't this more relevant to the properties of the current elicited by shining light on the channelrhodopsin expressing muscle cell? Aren't they trying to see what current that stimulation produces, rather than find the intrinsic properties of the muscle channels?

We couldn't really reproduce this in LEMS unless there was channel which would simulate the photocurrent and then it wouldn't help with tuning the rest of the cell properties...

@slarson
Copy link
Member Author

slarson commented Jun 26, 2015

I'm pretty sure the effect of activating the light sensitive channels can be modeled as a current injection.

@VahidGh
Copy link
Member

VahidGh commented Jul 1, 2015

Actually, this could be a beautiful example of proofing how traditional Hodgkin-Huxley approach fails to model such a curve for single-channel modeling!
As could be inferred from this figure, Channelrhodopsin-2 has 4 different states, that can not be modeled using 2 same exponentially-controlled states, as usually being considered in HH models.
If we can not model such a kinetic using HH models, then we should reconsider the assumption of only using HH models, at least for channel modeling, and also consider Markov models if such channels exists in C. elegans.
And if we can finally model this, as Stephen mentioned, the final result would be useful for validating existing model proposed by Boyle&Cohen.

@rgerkin
Copy link
Member

rgerkin commented Jul 1, 2015

At the timescales we are interested in, is there any evidence that the ChR2 state transitions are important for predicting the membrane potential time course? I don't want to ignore channel details when it comes to real channels, but ChR2 is a tool, not a natural part of the organism, so if modeling its response to pulses of light as a current (or conductance) injection is sufficient, then I think there's no need to go any further.

@VahidGh
Copy link
Member

VahidGh commented Jul 1, 2015

@rgerkin, As I remember the intention of this issue was to starting with a case-study for parameter optimization using voltage-clamp (assuming the initial voltage is unknown). We have the same issue for other channel types with different holding potentials, so resolving this one will lead to applying the same method for more practical cases.
I was going to start modeling this case-study, but noticed we need another state-transition (deactivation), that we do not have in HH models. So I just wanted to say if we will have the same cases for other channels in C. elegans, we should also consider Markov models.

@pgleeson
Copy link
Member

pgleeson commented Jul 1, 2015

See http://www.nature.com/srep/2014/140819/srep06125/pdf/srep06125.pdf. From Fig 1:
selection_693

a) above is current through ChR2 channels at different holding potentials. There is a peak on roughly the same time scale as above. How much of the peak in current in your figure above is from ChR2 channels and how much from intrinsic channels?

I'm not saying it's not good data, it just might not be useful for tuning the muscle cell unless a ChR2 channel mode is there too. Their intention in that paper is only to stimulate the motoneuron (and or muscle cells) to measure postsynaptic currents, not to characterize natural behaviour of the cells.

@travs
Copy link

travs commented Jul 1, 2015

Update from @rayner:

I've got the latest version of the muscle model now, and have been figuring out how to approach this using a LEMS model. It looks like we need something similar to the voltage clamp simulation defined in LEMS_Figure2B.xml, but with the addition of needing to account for the light-sensitive channels. I should be able to work on it a bit more tomorrow.

@rayner
Copy link
Contributor

rayner commented Jul 3, 2015

I've been looking at this, and I'm a bit unclear on a couple of things.

The original issue, if I understand this right, is that we want a simulation that can replicate the figure from Liu et al. (2009) using a voltage clamp model.

However, I'm not clear on why a voltage clamp on a cell that doesn't have ChR2 channels would cause equivalent behaviour to opening the ChR2 channels on a cell that has them. I'd have thought that, although stimulating the ChR2 channels causes depolarisation (and so opens the calcium channels), the ChR2 channels would also contribute to the calcium influx, and so I wouldn't necessarily expect the rate of change of the current to be the same. (@pgleeson, I think that's basically the same as your concern, right?)

It sounds like simulating ChR2 channels isn't the aim of this issue, so what's the goal we're working towards with this? We have an existing voltage clamp simulation for the muscle cell (Figure2B.xml, which aims to reproduce figure 2B from Boyle & Cohen (2008)), so is there a reason we want to test our simulated cell against Liu, Hollopeter, & Jorgensen's figure instead of Boyle & Cohen's?

@slarson
Copy link
Member Author

slarson commented Jul 21, 2015

OK really interesting points raised by all here. It has taken me a while to get to digesting it all

@VahidGh -- Interesting point on Markov based models of ion channels. I have played with these in the past, and my perspective is it is a question of trade-offs to go down to that level. In fact, there are some ion channel models that go further and have 16 or more states. This does get to a common question in computational biology of "how much detail do we need?". It is a good question and one that deserves robust debate. My perspective so far is to go to the level of simple ion channels and do a test to see how close we can get to observed data, and define some kind of a tolerance for error. In order to make the decision between a markov model approach vs. HH approach, we should try to compare them side by side and see what kind of error occurs in the HH example. However, there is obviously a cost of effort to do this, so it may just be faster for us to do a first pass with all HH channels first, identify the ones that are clearly bad, and then go back to the worst ones and look to replace with Markov. Makes sense?

@rayner -- you ask why we want to test our simulated cell against Liu et. al instead of Boyle & Cohen -- the idea isn't instead of but in addition to. The bigger goal is to have a corpus of tests that pull from a corpus of data that define c. elegans muscle cellular activity. This is very much the SciUnit idea from @rgerkin that we are trying to implement here.

@pgleeson its a good point to make that the time course of ChR2 is distinct -- brilliant find on this. The question is practically how to move forward with validating the muscle model. There are precious few papers that have data like what we find in Liu 2009. If we did take the effort to build a ChR2 channel and factored it into the test suite do you think that would resolve the concern you raised? It might not actually be that much more work given the figure you found...

@VahidGh
Copy link
Member

VahidGh commented Jul 22, 2015

@slarson, yes, makes sense. So we can have such a model, considering a time range from stimulation start time to stimulation end time, and do not struggle with deactivation tau (and everything related to transition states we don't have in HH models).

@rayner
Copy link
Contributor

rayner commented Jul 26, 2015

Okay, so if we want to do this, we definitely need to model the ChR2 channel, as without it we'll be trying to fit our cell's behaviour to the wrong curve. So that would be the next step we need to complete.

I'm currently trying to figure out if there a way to simulate a light stimulus (or other channel activation that's independent of voltage or ion concentration) in NeuroML2. If there isn't, we may be able to model it as a voltage gated channel and use the figures above to get the channel displaying the correct behaviour at the testing potential, but if at all possible I'd rather avoid doing something that's a proxy for a proxy for the muscle cell that we wanted to model in the first place.

@pgleeson
Copy link
Member

I'm still of the impression that the figure above doesn't tell us anything about the underlying cell, only the currents through the Chr2 channel... Think about it, the blue trace is light activation, not modulating voltage. The ChR2 channels open and the currents through these are counteracted by the voltage clamp current. As far as the cell and the other channels are concerned, the cell is at a constant voltage the whole time & they don't change their states...

@VahidGh
Copy link
Member

VahidGh commented Jul 30, 2015

OK, as a case-study for Vclamp optimization via cwFitter, this was really interesting for me, so I decided to take a look at this (sorry @rayner if you were working on this).

According to this paper and as suggested by @slarson, I could somehow simulate the light stimulation via voltage changes. I considered the base voltage as 0, and the stimulated light as -80 mV.

Tried different optimization algorithms in cwFitter, using Particle Swarm Optimization (some approach like what is suggested by this study) took about 10 mins with 100 swarms and 100 of max iterations, and a good result:
chr2-pso-best

Also tried using Genetics algorithm, with the same parameters and weights. needed less time with a reasonable params (2 mins), not a lovely fit!
Tried with 500 generations and 5000 population size (10 mins), the result was not again as good as the PSO:
chr2-ga

And this was the result of a blind voltage guess (from -100 to 100 mV with 20 mV steps), took about 2 hours (using PSO):
chr2-vnone-pso

Tanks to @pgleeson, for this script, I could also generate and validate the NeuroML2 file. Needs a cell file or putting conductance and e_rev in the channel file (#49) and the Lems file for running using JNeuroML.
@pgleeson, I would appreciate it if you could help on this, and paving the way for other channels.
What I get from the fitting process was: 9.5e-06 S for conductance and 1.5e-01 V for reversal potential that I'm not sure where should I put if I'm not going to generate a cell file!

@pgleeson
Copy link
Member

pgleeson commented Aug 6, 2015

@VahidGh glad that you're making progress with the fitting algorithm. Making slow steady progress myself with optimization using neurotune here and here.

I'd recommend using pynml to validate the generated NeuroML2 channel file. You're missing the instances attribute on gate for example. Also try

pynml-channelanalysis chr-2.channel.nml

This highlighted that some of the metadata was non standard (see http://co.mbine.org/standards/qualifiers).

You can use a modified version of the LEMS file generated by pynml-channelanalysis for further tests on the cell, otherwise I'd suggest manually editing https://github.com/openworm/muscle_model/blob/master/NeuroML2/SingleCompMuscle.cell.nml to insert the channel at different densities and see what happens. Alternatively, there are all the classes in libNeuroML to build a cell/network in python and a helper class LEMSSimulation for building LEMS files (see here and here and here)

I'm not sure though about modelling ChR2 activation with gates which are only voltage dependent (I haven't read the paper I'm afraid). This may be ok when the channel is being modelled in isolation in voltage clamp model, but when it's used in other cell models and the voltage is changing due to the activity of other channels, how close to a light pulse activation would that be?

@VahidGh
Copy link
Member

VahidGh commented Aug 6, 2015

@pgleeson, thanks for the links and hints, will consider for the new models.
The model also needs some improvements, considering some constraints claimed by the author, am working on this too.

There is also another useful experiment in this paper (Light-Activated Motor Neurons section), in which, the post synaptic current evoked by photo is identical to the electrical one (Fig. 2A). Here, the chr2 is expressed in motor neurons. If we could simulate this too, then this is possible to integrate this with the muscle model to simulate PSCs.

@VahidGh
Copy link
Member

VahidGh commented Aug 6, 2015

@pgleeson, Regarding the optimization process in c302 project, is there anything I can help with? That's also really interesting for me (definitely will spend some time in the near future to dive into the project).

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

No branches or pull requests

6 participants