"agglomerateByPrevalence" function name might be misleading - this function agglomerates features to a given rank, and then those features that are not prevalent will be agglomerated into category "Other". Logically this should be something like agglomerateNonPrevalent..?
This does agglomerate features to a given rank but we have agglomerateByRank for that. The specific aspect of this function is to group the non-prevalent groups.
library(mia)
library(dplyr)
data(peerj13075)
tse <- peerj13075
# Add relative abundance assay
tse <- transformAssay(tse, assay.type="counts", method="relabundance")
# Agglomerate features to level and merge non-prevalent groups
# Store this into altExp slot of the same data object
altExp(tse, "prevalent") <- agglomerateByPrevalence(tse, assay.names="relabundance", detection=0.1/100, prevalence=5/100, rank="genus")
"agglomerateByPrevalence" function name might be misleading - this function agglomerates features to a given rank, and then those features that are not prevalent will be agglomerated into category "Other". Logically this should be something like agglomerateNonPrevalent..?
This does agglomerate features to a given rank but we have agglomerateByRank for that. The specific aspect of this function is to group the non-prevalent groups.