microbiome / mia

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

Integrate agglomerateBy* functions #554

Closed TuomasBorman closed 1 month ago

TuomasBorman commented 1 month ago

agglomerateByRank() uses agglomerateByVariable() internally. However, for instance tree agglomeration was done separately in Rank function, and Rank and *Variable used different methods to agglomerate trees.

--> Take into account this. Do all the agglomeration steps in Variable function, and leave only rank-specific functionality in Rank function.

Moreover, *Variable() function's tree agglomeration method did not take into account the problem described here https://github.com/microbiome/mia/pull/548. It used node numbers instead of labels, but when TreeSE is created nodes are matched with rows/cols based on the label. This means that label found in row/colLinks matches with the tree (no need to make things more complex with node numbers).