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

Indices - implement exact NTI expected values for ultrametric trees #790

Closed
shawnlaffan opened this issue May 5, 2021 · 1 comment
Closed
Assignees
Labels
Milestone

Comments

@shawnlaffan
Copy link
Owner

As described in Tsirogiannis et al. (2014) https://doi.org/10.1007/978-3-662-44753-6_15

Related to #789 and #786

@shawnlaffan shawnlaffan added this to the Release_4.0 milestone May 5, 2021
@shawnlaffan shawnlaffan self-assigned this May 5, 2021
shawnlaffan added a commit that referenced this issue May 12, 2021
shawnlaffan added a commit that referenced this issue May 12, 2021
Uses the slower variant, so is O(n^2).
The faster implementation
can be done at a later date.

Code includes much debugging for purposes of posterity.
This will be cleaned up next.

Updates #790
shawnlaffan added a commit that referenced this issue May 12, 2021
Also return 0 for the SD when the requested
sample count equals the number of terminals.

Updates #790, and a late update to #789
shawnlaffan added a commit that referenced this issue May 12, 2021
Neglected to take the sqrt

Updates #790
shawnlaffan added a commit that referenced this issue May 12, 2021
shawnlaffan added a commit that referenced this issue May 12, 2021
If all goes well we will soon not need it...

Updates #790
shawnlaffan added a commit that referenced this issue May 12, 2021
Binomials can be expressed using logs
generated from a cache of precalculated
values.

We lose some precision, but the results are
generally the same to 7dp, which is still
better than the permutation approach.

Math::AnyNum has several external dependencies
which it is simpler to avoid.

Updates #790
shawnlaffan added a commit that referenced this issue May 12, 2021
shawnlaffan added a commit that referenced this issue May 12, 2021
It is not supported until perl 5.28.

Updates #790
shawnlaffan added a commit that referenced this issue May 13, 2021
shawnlaffan added a commit that referenced this issue May 13, 2021
These are faster to generate than
descendent hashes.  They are also
are cached by default since they
do not contain circular references
(which can mess up serialisation).

Updates #790
shawnlaffan added a commit that referenced this issue May 13, 2021
With some judicious rearrangement we
can do just the lower left of the
pairwise matrix.

A full speedup would use
the algorithm in PhyloMeasures.

Updates #790
shawnlaffan added a commit that referenced this issue May 13, 2021
Avoids many repeated method calls
to get the same answer.

Updates #790
shawnlaffan added a commit that referenced this issue May 13, 2021
GUI only, and only for reasonable numbers of nodes.

This stops the GUI locking up.

Updates #790
shawnlaffan added a commit that referenced this issue May 13, 2021
shawnlaffan added a commit that referenced this issue May 13, 2021
shawnlaffan added a commit that referenced this issue May 13, 2021
shawnlaffan added a commit that referenced this issue May 13, 2021
Also avoids a list slice, which can become expensive.

Updates #790
shawnlaffan added a commit that referenced this issue May 18, 2021
sum_subtract is a work in progress,
possibly to do with the bnok ratios.

Updates #790
shawnlaffan added a commit that referenced this issue May 18, 2021
At least in comparison with PhyloMeasures outputs

Updates #790
shawnlaffan added a commit that referenced this issue May 18, 2021
shawnlaffan added a commit that referenced this issue May 18, 2021
shawnlaffan added a commit that referenced this issue May 18, 2021
shawnlaffan added a commit that referenced this issue May 18, 2021
shawnlaffan added a commit that referenced this issue May 18, 2021
shawnlaffan added a commit that referenced this issue May 18, 2021
Also reduces the calcs somewhat as we
index by tip count, so get some aggregations.

Updates #790
shawnlaffan added a commit that referenced this issue May 18, 2021
Difference is at fifth decimal place,
where 3dp should be sufficent in most cases.

Updates #790
shawnlaffan added a commit that referenced this issue May 18, 2021
shawnlaffan added a commit that referenced this issue May 18, 2021
shawnlaffan added a commit that referenced this issue May 18, 2021
shawnlaffan added a commit that referenced this issue May 18, 2021
shawnlaffan added a commit that referenced this issue May 18, 2021
@shawnlaffan
Copy link
Owner Author

Mark as fixed.

There are still sections of the code that can be modified. For example recursive algorithms in TreeNode.pm can be linearised and moved into Tree.pm, and the bnok ratio code can be refactored to use callbacks or similar. These can be done under separate issues, though.

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

No branches or pull requests

1 participant