Question about using LFPsim from modelDB(#190140)

Discussions about LFPsim, a tool for simulating local field potentials

Moderator: tom_morse

Post Reply
breakwave922
Posts: 72
Joined: Mon May 19, 2014 10:39 pm

Question about using LFPsim from modelDB(#190140)

Post by breakwave922 » Fri Jul 22, 2016 10:17 pm

I'm trying to implement the LFPsim tool which can record the LFP from the single neuron into my own neuron model. LFPsim is just developed and published by Parasuram et al., 2016 http://journal.frontiersin.org/article/ ... 0065/full#, and can be downloaded from modelDB https://senselab.med.yale.edu/modeldb/s ... 140#tabs-1.
I'm aware of Ted have one model example recording LFP also http://www.neuron.yale.edu/ftp/ted/neur ... nd_rec.zip, so before I tested LFPsim on my own model, I tested it on Ted's example and compare the results. I expect the LFPsim should give me same results, but there seems to be a significant differences:I set the electrodes in LFPsim at the same locations as in Ted's example which is (XE=50,YE=0,ZE=0), but the readings from LFP trace (for example, Point Source Approximation in LFPsim) shows opposite polarity, i.e. when LFP in Ted's example being negative, LFPsim shows positive, or the other way around. Couldn't figure this out for couple of days.
I know that in Ted's example, calculation like the contribution of i_membrane to LFP was done by BEFORE AFTER SOLVE block in mod file, whereas LFPsim doesn't use any of these. Does this cause the polarity differences in LFP results?

ted
Site Admin
Posts: 5106
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Question about using LFPsim from modelDB(#190140)

Post by ted » Sat Jul 23, 2016 3:18 pm

breakwave922 wrote:in Ted's example, calculation like the contribution of i_membrane to LFP was done by BEFORE AFTER SOLVE block in mod file
Not quite right. Membrane current density is calculated during fadvance(). xtra.mod merely converts current density in mA/cm2 to absolute current in nA. This has nothing to do with the polarity difference you observed.

Suggest you do a simple test with a model axon 1 um diameter x 2000 um long, Ra 100 ohm-cm, cm 1 uf/cm2, nseg 71, with the hh mechanism. Trigger a spike at the 0 end and observe extracellular potential at a point that is 100 um from the axon and lies in the plane that is perpendicular to the middle of the axon. You should see a triphasic response that consists of an initial small, brief positivity followed by a large negativity after which there is a small but longer lasting positivity. If LFPsim shows a triphasic response that has opposite polarity, then you'll have to scour their documentation to discover why--or maybe just ask the developers of LFPsim.

I should mention that some experimentalists plot extracellular potential with negative up and positive down. I do not know the origins of that convention or its rationale.

breakwave922
Posts: 72
Joined: Mon May 19, 2014 10:39 pm

Re: Question about using LFPsim from modelDB(#190140)

Post by breakwave922 » Sun Jul 31, 2016 10:19 pm

Ted,

Thanks a lot for the reply.

I was able to record the LFP with the same properties you expected when checking the simple test example.

In this simple test model, I have another questions: the distance r from each segment to electrode is supposed to be calculated according to segment's and electrode's coordinates, so the r for each segment varies when segment changes. This is how I got the expected LFP waveform. However, if I set all the r to a same value for all segments, the computed LFP is just the scale version of current injection, with scale factor depending on the set value of r, i.e. the LFP waveform is just like rectangular function, reflecting current on and off time. From my understanding, from checking the point source approximation equation (PSA) for LFP which is LFP=sum((i_membrane(j)/(4*pi*sigma*rj))), where j denotes for different segments or sections, if rj is the same, this equation can be expressed as (4*pi*sigma*rj)*(sum(i_membrane(j))) and it is equal to (4*pi*sigma*ri)*Iinject, because the summed-up i_membrane from all segments or sections is Iinject. However, in the real case, rj cannot be the same for all locations, then we have the right LFP waveform. Is my understanding correct?

I also checked the pilot LFP computing example,http://www.neuron.yale.edu/ftp/ted/neur ... nd_rec.zip, and if I set r to be constant for all segments/sections, in calcrxc.hoc, the recorded vrec's (LFP) waveform is just the scale version of current injections.

Please correct me if I'm wrong.

ted
Site Admin
Posts: 5106
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Question about using LFPsim from modelDB(#190140)

Post by ted » Mon Aug 01, 2016 2:54 pm

breakwave922 wrote:I was able to record the LFP with the same properties you expected when checking the simple test example.
I'm not sure what your sentence means. Are you saying that LFPsim produced a waveform that has the properties I described?
if I set all the r to a same value for all segments, the computed LFP is just the scale version of current injection, with scale factor depending on the set value of r
That is to be expected. It has nothing to do with your original observation.
in the real case, rj cannot be the same for all locations, then we have the right LFP waveform.
"rj cannot be the same . . ." is true. The calculated LFP is "correct" if the rj values are correct.

breakwave922
Posts: 72
Joined: Mon May 19, 2014 10:39 pm

Re: Question about using LFPsim from modelDB(#190140)

Post by breakwave922 » Mon Aug 01, 2016 3:29 pm

ted wrote:
breakwave922 wrote:I was able to record the LFP with the same properties you expected when checking the simple test example.
I'm not sure what your sentence means. Are you saying that LFPsim produced a waveform that has the properties I described?
No, LFPsim produced differently. I already contact the developer to discuss. What I meant is, I developed a code based on the techniques from http://www.neuron.yale.edu/ftp/ted/neur ... nd_rec.zip, and got the expected results, but when I used LFPsim to check on this simple model, I had totally different result.
ted wrote:
breakwave922 wrote:in the real case, rj cannot be the same for all locations, then we have the right LFP waveform.
"rj cannot be the same . . ." is true. The calculated LFP is "correct" if the rj values are correct.
Imagine we have two-compartment cell model with single segment in each compartment, and each compartment has the same length and diameter, if we set the electrode and observe the extracellular potential at any point lies in the plane that is perpendicular to the middle of the cell, will the recorded LFP be just the scaled version of current injection, due to the fact that the distance from the testing point to each compartment is the same in this particular case?

I know it's not true that I set the distance to the same values by force to multi-compartment cell, but in this two-compartment cell case, the same distance is what we will have from calculation in this middle plane for testing.

ted
Site Admin
Posts: 5106
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Question about using LFPsim from modelDB(#190140)

Post by ted » Tue Aug 02, 2016 11:02 am

Imagine we have two-compartment cell model with single segment in each compartment, and each compartment has the same length and diameter, if we set the electrode and observe the extracellular potential at any point lies in the plane that is perpendicular to the middle of the cell, will the recorded LFP be just the scaled version of current injection
Only if each compartment has the same membrane current. This will happen only if
1. the current is injected at the node that connects the 1 end of the parent compartment to the 0 end of the child compartment,
or
2. identical currents are injected into both compartments simultaneously

breakwave922
Posts: 72
Joined: Mon May 19, 2014 10:39 pm

Re: Question about using LFPsim from modelDB(#190140)

Post by breakwave922 » Wed Aug 03, 2016 3:48 pm

ted wrote:
Imagine we have two-compartment cell model with single segment in each compartment, and each compartment has the same length and diameter, if we set the electrode and observe the extracellular potential at any point lies in the plane that is perpendicular to the middle of the cell, will the recorded LFP be just the scaled version of current injection
Only if each compartment has the same membrane current. This will happen only if
1. the current is injected at the node that connects the 1 end of the parent compartment to the 0 end of the child compartment,
or
2. identical currents are injected into both compartments simultaneously
Ted, thanks for the response.

About the second requirement, "identical currents are injected into both compartments simultaneously", do you mean the electrode current injection into both compartments, or it just means the transmembrane currents (i_membrane from extracellular mechanism) into both compartments?

Regarding the LFP computing on two-compartment cell model, I have a two-compartment model, where soma has nseg=1, L=15, diam=15, and dend has nseg=1, L=150, diam=10; Na,K, and leak channels are present in both soma and dend with different conductance densities.
When I recorded the LFP at any point in the middle plane of the cell (so, to each compartment, the distance r is always the same), I always got the scaled version of current injection, regardless of current injection's position onto the cell, either onto soma or dend.

In this two-compartment case, do "each compartment has the same membrane current" and "identical currents are injected into both compartments simultaneously"mean because the axial current flows into one compartment has the same magnitude as the axial current flow out of another compartment but with opposite sign, which would result in the zero sum-up membrane currents; then, given the same distance to each compartment in the middle plane, the computed LFP in this plane will just be the scaled version of external current injection?

ted
Site Admin
Posts: 5106
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Question about using LFPsim from modelDB(#190140)

Post by ted » Thu Aug 04, 2016 11:46 am

Sorry, my reply from 8/2 is incorrect. Given a multicompartmental model, it is easy to show that
if there is any point P that satisfies the condition
"all transfer resistances between P and the model's compartments are identical"
then the field potential observed at P will equal Rx*Iinj
where Rx is the transfer impedance between P and any compartment
and
Iinj is the current injected into the cell (e.g. by an electrode). Furthermore, there are no restrictions regarding compartment size. Also, if more than one electrode is attached to the cell, the field potential observed at P will equal Rx * SUMMA Iinj
where SUMMA Iinj is the sum of all injected currents.

The most direct proof involves application of Kirchhoff's current law and proceeds by induction, starting with a single compartment model, then a two compartment model, then a model with an arbitrary number of compartments.

breakwave922
Posts: 72
Joined: Mon May 19, 2014 10:39 pm

Re: Question about using LFPsim from modelDB(#190140)

Post by breakwave922 » Thu Aug 04, 2016 4:11 pm

ted wrote: Given a multicompartmental model, it is easy to show that
if there is any point P that satisfies the condition
"all transfer resistances between P and the model's compartments are identical"
then the field potential observed at P will equal Rx*Iinj
where Rx is the transfer impedance between P and any compartment
and
Iinj is the current injected into the cell (e.g. by an electrode). Furthermore, there are no restrictions regarding compartment size.


Ted, Thanks. This is exactly what I was thinking of. From Kirchhoff's current law, it's easy to prove this in computational models.

I still want to discuss with you whether this is reflecting the real case. If we test the LFP on one real cell, and assume we could find some point in the real space, where all transfer resistances to all cell's compartments locations are identical, do you think then the LFP would equal to Rx*Iinj? For example, if we put the LFP electrode very very far from the cell body, then the transfer resistances will be almost identical regardless of the compartment size, then the LFP is just Rx*Iinj?

Or, in one particular case where testing LFP on two-compartment cell, we don't need to put the electrode far away to satisfy the condition. For two-compartment cell, it's easy to find the location satisfies the requirement, like, if we test the LFP at any point in the middle perpendicular plane of the cell, will then the LFP be just equal to Rx*Iinj? Means, the LFP testing data in this plane would not have any frequency or neuronal activity information.
Maybe it's hard to find two compartment cell, but I'm just curious about this.

Post Reply