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

potential error in partition asymmetry #777

Closed
carshadi opened this issue Oct 30, 2019 · 14 comments
Closed

potential error in partition asymmetry #777

carshadi opened this issue Oct 30, 2019 · 14 comments
Assignees

Comments

@carshadi
Copy link

carshadi commented Oct 30, 2019

Hello, I am trying to get the partition asymmetry of this test tree (red circle indicates Soma point):
pa_test
I chose this morphology as it mirrors the example on the L-measure page for partition asymmetry: http://cng.gmu.edu:8080/Lm/help/Partition_asymmetry.htm

From my understanding, the returned values should be [1.0, 1.0, 0.0] if going by the formula:
abs(n1 - n2) / (n1 + n2 - 2)
where n1 is the number of tips on the left and n2 is the number of tips on the right. However, running partition_asymmetries = nm.get('partition_asymmetry', nrn, neurite_type=nm.AXON) returns the list [0.66666667 0.5 0. ]. I am not sure if the error is in my interpretation.

@mgeplf
Copy link
Collaborator

mgeplf commented Oct 31, 2019

I don't see the '- 2' in the code:
https://github.com/BlueBrain/NeuroM/blob/master/neurom/fst/_bifurcationfunc.py#L102

Maybe @lidakanari can comment.

@lidakanari
Copy link
Contributor

Indeed, our formula does not include the -2. That is because we are not replicating this measurement from L-measure, but we rather needed a value that goes from 0 (when the tree is symmetric) to 1 when all branches belong to one tree. This is not the case in this example. In your example for instance the two first bifurcations have the same value for asymmetry while the tree is "more" asymmetric on the first bifurcation (3/4 vs 2/3). We wanted to discriminate between these two cases. Sorry for the confusion. Maybe a more detailed description or a different naming would be useful.

@carshadi
Copy link
Author

I see, that makes sense.
Thanks!

@mgeplf
Copy link
Collaborator

mgeplf commented Nov 5, 2019

Following the docstring reference (https://www.ncbi.nlm.nih.gov/pubmed/18568015), it leads me to https://jvanpelt.nl/papers/Uylings_Network_13_2002_397-414.pdf where eq 1 has the - 2 offset, so I don't think it's just an L-measure thing - it seems to be the standard. Given that, I think the function with this name should return the standard, or we need to make it much more clear that this includes a slightly different interpretation.

@mgeplf mgeplf reopened this Nov 5, 2019
@lidakanari
Copy link
Contributor

I completely agree with @mgeplf because indeed this term refers to a specific measurement. However, because we also needed the current computation for validations I would rename this function and correct the partition asymmetry to the expected formula.

@lidakanari
Copy link
Contributor

Actually I just realized that in the code we provide as reference the "standard" definition of partition taken from this paper: https://www.nature.com/articles/nrn2402.

'''Calculate the partition asymmetry at a bifurcation point
as defined in https://www.ncbi.nlm.nih.gov/pubmed/18568015"

According to the petilla terminology and figure 2 (https://www.nature.com/articles/nrn2402/figures/2) the partition asymmetry does not include this "-2" that is found in other references provided in this issue. Apparently the literature is not consistent on this, but I think we should stick to the definition and references provided in the code.

@lidakanari
Copy link
Contributor

What is peculiar is that this is inconsistent with the reference mentioned by @mgeplf (https://jvanpelt.nl/papers/Uylings_Network_13_2002_397-414.pdf) so I am not sure how to proceed with this one because the terminology paper does not agree with the one they cite.

@mgeplf
Copy link
Collaborator

mgeplf commented Nov 21, 2019

In that article, it references Uylings, H. B. M. & van Pelt, J. Measures for quantifying dendritic arborizations. Netw. Comput. Neural Syst. 13, 397–414 (2002). (footnote 26), which has the -2:
image

@lidakanari
Copy link
Contributor

lidakanari commented Nov 21, 2019

Yes but in the paper we refer to (The petilla terminology: https://www.ncbi.nlm.nih.gov/pubmed/18568015) they define asymmetry as follows:
image
I assume that was the one we used in the code.

@mgeplf
Copy link
Collaborator

mgeplf commented Nov 21, 2019

But the reference they make is to the Uylings et al 2002 paper, which is more focused on tree properties than the Petilla terminology one - doesn't it make sense to follow the primary source?

@lidakanari
Copy link
Contributor

lidakanari commented Nov 21, 2019

I am not sure what is optimal (apparently there is an inconsistency in literature for this). If we modify the measurement we should also change the reference to the original paper from the Petilla one. But as mentioned in my previous comment the "new" version was more meaningful for validations. So I would still like to keep this feature, but possibly under a different name. The only problem is they use the same name for a different measurement in these two papers.

@mgeplf
Copy link
Collaborator

mgeplf commented Nov 22, 2019

my previous comment the "new" version was more meaningful for validations

That makes sense, and why I'm pretty on the fence about what should be done. I'd like to understand go through the Uylings (?) 1999 paper that the 2002 one references, to see if they develop the idea further. I find it weird that they also didn't want to discriminate between the cases like you mentioned.

At the least, I think we should add a comment in the docstring saying that this differs from Uylings and L-Measure, and give the reason.

@lidakanari
Copy link
Contributor

I was thinking that it is maybe meaningful to have both implementations. Could we have:

  1. partition_asymmetry (as in the Uylings ref)
  2. partition_asymmetry_petilla (as in the Petilla terminology paper)

My impression is Uylings, Van Pelt et al were the first to introduce the idea and until the Petilla work this has evolved and "updated". I guess each measurement is useful for different use-cases. For example (1) will cluster all "very asymmetric" trees together and that can be meaningful for some analysis. On the other hand, some analysis might need to separate between a (10,1) and (5,1) asymmetric tree and in this case (2) would be more appropriate.

@asanin-epfl
Copy link
Contributor

@lidakanari for backward compatibility I propose to keep the single function partition_asymmetry that would calculate as before by Petilla. With additional argument method='uylings' it would calculate by Uylings.

What do you think?

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

No branches or pull requests

4 participants