Closed kuanawanda closed 3 years ago
Hi. Yes, looking at the code this would create an issue. I will have a think about how to fix this but in the meantime you could just assign unique IDs to your fragments. For example:
axon = n.prune_proximal(...)
dend = n.prune_distal(...)
axon.id = f'{axon.id}_axon'
dend.id = f'{dend.id}_dendrite'
ol = navis.cable_overlap(...)
In case you want to try it: I pushed an improved version of cable_overlap
to the dev branch of navis (see the commit).
Notably it now is independent of the neurons' IDs (i.e. duplicate IDs are no longer an issue. There are also two new methods
- 'forward'
and 'reverse'
- which always give you the overlap from the perspective of neuron a
->b
and a
<-b
, respectively. So if you want the overlap to always be e.g. from the perspective of the dendrites, you could run something like this: navis.cable_overlap(nl_axon, nl_dendrites, method='reverse')
.
As I said, these changes live on the dev branch of navis. So to install them you would need to run this:
pip3 uninstall navis -y
pip3 install git+git://github.com/schlegelp/navis@dev
The dev version of cable_overlaps seems to fix the problem. And the new overlap methods are also really great, exactly what I wanted to try actually. Thanks so much for you rapid update!
Sweet! I will close this issue then.
Hi Philipp - wondering if you could help me figure out how to do the following:
I want to calculate the cable overlaps between the axons and dendrites of a group of neurons. The source and target pools include the same neurons.
The process is basically: 1) Use Navis.TreeNeuron.prune_proximal_to and prune_distal_to to create axon and dendrite neuron fragments 2) Use Navis.cable_overlap to calculate overlaps.
However, when I do this I get some erroneous overlaps of 0. I think this has to do with the axon and dendrite fragments having duplicate IDs. I was wondering what your advice would be to deal with this issue.
Thanks! Aaron