jonescompneurolab / hnn-core

Simulation and optimization of neural circuits for MEG/EEG source estimates
https://jonescompneurolab.github.io/hnn-core/
BSD 3-Clause "New" or "Revised" License
54 stars 52 forks source link

Incompatible cell positions and morphological extents #342

Open cjayb opened 3 years ago

cjayb commented 3 years ago

As discussed in many-a PR, cell positions and orientations need to be formalised.

A related and more pressing matter is that the in-plane distances between pyramidal cells (10 x 10 grid with 1 um spacing) are inconsistent with the physical extents of the sections:

        'L5Pyr_soma_diam': 28.9,
        'L5Pyr_apicaltrunk_diam': 10.2,
        'L5Pyr_apical1_diam': 7.48,   #etc

The packing density of cells in cortex is insane, but real cells don't intersect, as ours do ;)

I don't know of a principled way to deal with this, since our "cells" aren't really cells, but models of (multiple) cells. But let's say we defined the cell-to-cell lateral distance in HNN to be 30 um. The somas would be 1 um apart, which is quite realistic, and the cortical "column" we model would be 300 um a side. This is still tiny in MEG-terms, but not totally outrageous.

The lamtha-parameter would have to be recast with a new physical identity, but in terms of implementation it would just amount to a scaling (from units of 1 um to 30 um).

I don't think our simulated LFP-values will be physically meaningful until this matter has been resolved (even though qualitatively they might be reasonable). Certainly not for shanks inside the cortical column.

@stephanie-r-jones @jasmainak @ntolley @rythorpe

jasmainak commented 3 years ago

I think this might be a good opportunity to revisit the Bush and Sejnowski paper from which the HNN model neurons are inspired

stephanie-r-jones commented 3 years ago

Clarification: The cells in the model are in fact meant to represent single cell activity, not multiple cells, and were tuned to single neuron firing properties. The morphology came from bush and Sejnowski paper who developed a principled way to collapses neural models that were build with hundreds of compartments based on stained cells, to a reduced number of comportments. The goal in their reduction was to have a smaller number of compartments to work with, while maintaining the axial resistance within the cells. Importantly, Bush and Sejnowski only modeled single neurons not networks AND the neurons were purely passive without any active currents in the soma or dendrite. I added active conductances in the soma and dendrites based on literature and tuned the cells to produce "realistic" spiking patterns in an un-connected network, as shown in the Jones et al J. Neurosci. 2007 paper. The network in the 2007 paper was simple a line of cells. In the 2009 Jones et al J. Neurophys paper, we expanded the network to a 10x10 grid of cells.

jasmainak commented 3 years ago

Wonderful, thanks for the historical note and clarification @stephanie-r-jones !

@cjayb the reason I reference the Sejnowski paper is because I noticed this:

image

that is to say, the incompatibility with cell-to-cell distance is probably due to this ...

cjayb commented 3 years ago

Thanks for the detailed account @stephanie-r-jones ! I keep on stepping into this model cells-matter. Clearly our cells have identities as biophysical cells: they fire and have subthreshold dynamics! They mimic some aspects of more realistic models, but not all, and your work over the past 10+ years has been to show the links to MEG.

My concern here is mostly wrt LFP, where distances to active elements can be very short. I think increasing the distance might "help" in the sense that more sections would contribute to the field (not just the closest one), creating a more biologically realistic smoothness to the signal.

cjayb commented 3 years ago

@jasmainak I'll be the first one admit a less-than-thorough reading of the paper :) As pointed out above though, the concern/objective there was a single cell, right?

But to your point, I guess?, the section diameters should perhaps not be taken to be physically meaningful (literal). (This is actually related to my earlier comment about these not "really" being cells, but I won't labor that point!) As it is now, however, section-to-section distances are 1 um, which in the LFP calculations is taken very literally indeed.

jasmainak commented 3 years ago

I'm also thinking what happens to the LFP signal of a single cell with the reduction process. As you noted before, the transmembrane currents have to be taken for each segment individually for the LFP calculation. If we do the PSA, then it probably doesn't matter as the reduced cell probably gives a sum of the transmembrane currents (to be verified though?) from individual dendrites. Not sure what happens with LSA. Might be worth thinking this through carefully

cjayb commented 3 years ago

I think both PSA and LSA will be affected. The reduced number of sections means that the membrane currents are discretized very crudely, leading to large "errors" at close range. maybe slightly less for LSA, you're right.

cjayb commented 3 years ago

Based on our discussion today, I propose we consider taking our somatic diameter literally, even though the dendritic equivalents are abstractions. This would mean placing our cells 30 um apart in a 300 x 300 um grid.

Wrt. LFPs, we should consider what distance limitations we would like to impose. Perhaps the most intuitive is to insist on electrodes staying "out" of our model cells, including the dendrites? So in fact using the dendritic diameters literally, too.

For reference, this is the paper I mentioned introducing 'Neuron_reduce' (find it right here on GH!). I agree that we don't want to be too general, but it's nice to see HNN-like cells outside of HNN :)

Amsalem, O. et al. An efficient analytical reduction of detailed nonlinear neuron models. Nat Commun 11, 288 (2020).

jasmainak commented 3 years ago

I dug up a few references and the most straightforward is Hari et al., 1997 which has the following figure:

image

which translates to ~10^5 neurons / mm^2. Depending on who you ask and what paper you refer to, this number can go up and down by an order of magnitude. Here are two more references, if you want to dig:

[1]R. A. Sweet, S. E. Bergen, Z. Sun, A. R. Sampson, J. N. Pierri, and D. A. Lewis, “Pyramidal cell size reduction in schizophrenia: evidence for involvement of auditory feedforward circuits,” Biological Psychiatry, vol. 55, no. 12, pp. 1128–1137, Jun. 2004, doi: 10.1016/j.biopsych.2004.03.002. [2]B. Pakkenberg and H. J. G. Gundersen, “Neocortical neuron number in humans: Effect of sex and age,” Journal of Comparative Neurology, vol. 384, no. 2, pp. 312–320, 1997.

I was told [1] is more reliable since it's considering only Pyramidal neurons. But let's work with 10^5.

10^5 neurons -> 1000 um x 1000 um means we have, 10^5 * (3 / 10)^2 neurons -> 300 um x 300 um

that is 9000 neurons in that area. We have only 100. So, our cell-spacing is off by almost two orders? I guess the question is: are we comfortable scaling the LFP signal same way we scale the dipole signal? Do we scale both by the same amount? I can see how the scaling is legit if you go far from the cells, but will it be legit close by?

cjayb commented 3 years ago

I find this really hard to rationalise. However, recall that the 1mm^2 refers to surface area. The cells are arranged in depth, so the real question is: how many cells per unit volume? I guess taking the thickness to be on the order 10^3 um is about right.

The theoretical maximum packing density of spheres is about 0.74, which is biologically unrealistic/irrelevant. But that's approximately what would be needed to fit 1e5 cells (20 um diameter spheres) into a 1mm3 cylindrical volume. We could also consider hexagonal packing of circles in a plane that achieves a 0.91 area fraction. According to my very rough calculation, using hexagonal packing I can fit 322 circles of 30 um diameter into a total area of 1mm2 (or 760 circles of 20 um diameter).

Again, I'm not sure these numbers are very useful... The actual packing is probably somewhere in between (neither volume- nor area-filling, but probably closer to the former). And there's the whole laminar distribution matter to consider. As for a scaling parameter, I don't think we should have one. The LFP is supposed to be "local", and our dendrites a thick (=lots of current=large potentials). A related topic is the number of cells that contribute to M/EEG due to various forms of cancellation and asynchrony: as low as 0.1-1% of the total. There's a few orders of magnitude right there :)

jasmainak commented 3 years ago

You're right this is a hard problem, but one that is probably worth thinking through :) Also right that the important question is how many cells per unit volume ... but if you assume that the cortex is 1 mm thick, then the numbers are roughly equal. But this also points to another important point: the packing is in 3 dimensions and you can stagger the neurons to fit more than the packing density allows, particularly since the apical dendrites are only around 1 um thick compared to the 20 um for the soma? (old trick we use in India to fit 8 people in a car of 4 :-P) I wonder what's the number of circles you can fit in your calculations if you use 1 um?

One practical thing we could try is to see what is the impact on the simulated-measured LFP if we change the spacing or add more neurons to our network. How does it scale etc. for the different kinds of simulations we have done (evoked, gamma)? To understand how much we can generalize. I'm happy to help explore this as well!

cjayb commented 3 years ago

I just thought of that staggering-idea on my walk! Didn't associate it with anything in India, but hey :) Actually our apical dendrites are on the order of 10 um at the base, but your basic argument is precisely what I came to as well: by staggering the soma by some small amount, we can pack all 100 of them in a 100 x 100 um square (if we don't allow the apical trunks to overlap). This would not affect the dipole in any way, of course.

And ditto to your second point too: let's simulate what happens. I think it'll be important to low-pass filter the LFP traces, though. I think our LFP will only really be meaningful in the <200 Hz range. What about distance limitations? I'm inclined to say that unless the user explicitly says otherwise:

net.add_electrode_array(..., exact_position=True)

electrodes placed "inside" the network should be shifted to never come within, say, 1 um of a segment center point (extracellular current source). Issue a warning that the move has taken place, and proceed. WDYT?

jasmainak commented 3 years ago

I guess we need to be extra careful with the LFP implementation since it's going to be used for validating HNN models. I think it might be helpful to pick Matti's brain about this. I need to look more closely at the equations, I am not sure if the LFP voltage (across cells) adds up linearly as the current dipole does. For a linear system:

image

with

image

applies. What happens when the spacing is changed and the voltages add up (non?)-linearly? This may not be such a concern if the LFP signal in the proximity of different cells are similar (to be verified for the class of simulations we are performing in HNN) such that non-linear addition is also a scaling.

Actually our apical dendrites are on the order of 10 um at the base

That's true, but the dendrite is tuned to represent firing rates and somatic voltages of a neuron that has apical dendrites of 1 um. Thus, presumably you'd want to measure LFP of a neuron that is actually having dendrites of 1 um? This also comes down to the question of biological realism in the validation. How are you going to compare it to a real LFP signal?

What about distance limitations?

Agree with you on this. And for our plots and repr, we can show the true positions used.

cjayb commented 3 years ago

I'm pretty sure the system is linear. Neuron gives the net transmembrane current (resistive + capacitive), and we're not modelling "ephaptic" interactions.

If our large-calliper dendrites sport larger intracellular currents than the biological cells they are approximations of, the transmembrane currents (and hence LFPs) will be correspondingly larger. Since Bush & Sejnowski explicitly constrained the total Ri to be "biological", the current may indeed be the same. However, that current will disperse into the extracellular medium at orders of magnitude fewer locations compared with a cylinder of tissue (our segment junctions; the longest sections have 13). This means that the precise location of an electrode would have a huge impact on the detected voltage.

It could be interesting to take a, say, NetPyNe model (M1?) to compare with. The fine-grained cellular models there should lead to more smoothly-varying voltages.

jasmainak commented 3 years ago

that current will disperse into the extracellular medium at orders of magnitude fewer locations compared with a cylinder of tissue (our segment junctions; the longest sections have 13).

yes that is a consideration too! Would be interesting to compare against fine-grained cellular models but I wouldn't consider it a show-stopper. We'd probably have to do some low-pass filtering when comparing the signals anyway.

But also, I was talking about this:

image

However, after thinking a bit more, even if it's not linear in r, you can indeed apply a scaling to the result if the cell-to-cell distance scales by a certain factor.

EDIT: is this the case for LSA too though?

cjayb commented 3 years ago

Yeah, it's linear in current. It's analogous to the lead field: for a fixed set of locations you can define a a linear system PHI=Lx. In cortically constrained MNE as well as our LFP calculations, the x are the source space locations. The lead field encapsulates all nonlinearities. So for a fixed set of electrode locations and segment centers, PHI is linear in the transmembrane currents. And yes: scaling the distances will amount to a scaling of L.

The LSA also goes as 1/R. I think there'll be differences when electrodes are inside the network, and the position is close to a segment boundary. Otherwise not.

As for filtering... The LFPy group belong to the camp of "cortex is a linear conductor with a flat impedance spectrum". They (and others) have shown that (realistic) dendritic trees lead to bandpass-properties of the LFP. Destexhe and colleagues, on the other hand, argue that cortex acts like an RC lowpass filter due to the capacitive properties of the manymanymany cells in tissue (this is the 3rd option in the Parasuram-paper). I don't think temporal filtering will make our LFPs "more realistic". Spatial smoothing might (to mitigate the coarse steps our dendrite segments have), but that's a very dodgy thing to start doing ;)

We should have a discussion about what we expect to see in the evoked-example. I think we might at first be a little disappointed, but it shouldn't really come as a great surprise. The 'dipole' is only interpretable at mm-scales and larger, and so, I think, might the LFP be too.

jasmainak commented 3 years ago

The 'dipole' is only interpretable at mm-scales and larger, and so, I think, might the LFP be too.

indeed, but that might defeat the purpose of LFP validation since you're only verifying electromagnetic equations at that point (i.e., what is the transformation to go from LFP to current dipole rather than connecting the mesoscale and macroscale) ... lots of things to think through! We should also find out what Blake has done so far.

cjayb commented 3 years ago

I'm reopening this since I think #370 didn't completely remove the need to discuss it.