microbiome / mia

Microbiome analysis
https://microbiome.github.io/mia/
Artistic License 2.0
45 stars 25 forks source link

Remove tree rooting in calculateUnifrac #594

Closed Daenarys8 closed 2 days ago

Daenarys8 commented 6 days ago

This PR changes calculateUnifrac so it doesn't change tree(root tree) before calculating unifrac distance.

TuomasBorman commented 6 days ago

calculateUnifrac works both for rows and columns. However, the implementation could be much simpler (now the same steps are done twice (once for rows and once for columns.

Can you modify the code so that you get first the functions and then run the steps only once. Similarly to this https://github.com/microbiome/mia/blob/c17fa9f70f556458247dda22112b14c9889efd3b/R/agglomerate.R#L452