Agglomeration

Combining features into higher-level taxa

Monday, September 28, 2026

Why agglomerate?

  • Focus on biologically meaningful units
  • Reduce sparsity and noise
  • Improve interpretability of downstream analyses

Summing up the taxonomy

Demonstration

Agglomerate to one rank

library(mia)
data("GlobalPatterns", package = "mia")
tse <- GlobalPatterns

tse_phylum <- agglomerateByRank(tse, rank = "Phylum")
c(features = nrow(tse), phyla = nrow(tse_phylum))
features    phyla 
   19216       66 

Agglomerate to all ranks

tse <- agglomerateByRanks(tse)
sapply(altExps(tse), nrow)
Kingdom  Phylum   Class   Order  Family   Genus Species 
      2      66     139     204     341     996     944 

Exercises

OMA online book, Chapter 10: Agglomeration

microbiome.github.io/OMA › Agglomeration

Exercises 1.2, 1.3, 1.4, 1.5, 1.6

Try it on real data: GuptaA_2019 example data