Agglomeration

Combining features into higher-level taxa

Why agglomerate?

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

Summing up the taxonomy

Alluvial diagram: species 1 to 3 flow into Genus A (total 12) and species 4 and 5 flow into Genus B (total 10).

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