Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default alpha diversity indices #713

Merged
merged 4 commits into from
Mar 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: mia
Type: Package
Version: 1.15.34
Version: 1.15.35
Authors@R:
c(person(given = "Tuomas", family = "Borman", role = c("aut", "cre"),
email = "[email protected]",
Expand Down
30 changes: 16 additions & 14 deletions R/addAlpha.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#' whether to remove internal nodes when Faith's index is calculated.
#' When \code{only.tips=TRUE}, those rows that are not tips of tree are
#' removed. (Default: \code{FALSE})
#'
#'
#' \item \code{threshold}: (Coverage and all evenness indices).
#' \code{Numeric scalar}.
#' From \code{0 to 1}, determines the threshold for coverage and evenness
Expand Down Expand Up @@ -76,6 +76,13 @@
#'
#' @details
#'
#' Different diversity metrics considers different aspects of microbial
#' community. Cassol et al. (2025) categorized alpha diversity metrics into four
#' categories: richness, dominance, information, and phylogenetic. These
#' categories provide complementary information, and by default, \code{*Alpha}
#' function return indices from each category: observed richness, Berger-Parker
#' dominance, Shannon index for "information", and Faith phylogenetic index.
#'
#' ## Diversity
#'
#' Alpha diversity is a joint quantity that combines elements or community
Expand All @@ -96,7 +103,7 @@
#' implementation is based on the Stacked Faith's Phylogenetic Diversity (SFPhD)
#' algorithm (Armstrong et al. 2021), which produces values equivalent to
#' \code{\link[picante:pd]{picante::pd}} with the parameter
#' \code{include.root=TRUE}. Using this index requires a rowTree.
#' \code{include.root=TRUE}. Using this index requires a rowTree.
#'
#' If the data includes features that are not in tree's tips but in
#' internal nodes, there are two options. First, you can keep those features,
Expand Down Expand Up @@ -344,7 +351,7 @@
#' Refer to Schloss (2024) for more details on rarefaction.
#'
#' @references
#'
#'
#' Armstrong G. et al. (2021)
#' Efficient computation of Faith's phylogenetic diversity with applications
#' in characterizing microbiomes.
Expand All @@ -368,6 +375,10 @@
#' communities.
#' _Bull. Environ. Contam. Toxicol._ 48:428--434.
#'
#' Cassol, I. (2025) Key features and guidelines for the application of
#' microbial alpha diversity metrics.
#' _Sci. Rep._ 15:622. doi: 10.1038/s41598-024-77864-y
#'
#' Chao A. (1984)
#' Non-parametric estimation of the number of classes in a population.
#' _Scand J Stat._ 11:265–270.
Expand Down Expand Up @@ -496,17 +507,8 @@ setMethod("addAlpha", signature = c(x = "SummarizedExperiment"),
setMethod("getAlpha", signature = c(x = "SummarizedExperiment"),
function(
x, assay.type = "counts",
index = c(
"coverage_diversity", "fisher_diversity", "faith_diversity",
"gini_simpson_diversity", "inverse_simpson_diversity",
"log_modulo_skewness_diversity", "shannon_diversity",
"absolute_dominance", "dbp_dominance",
"core_abundance_dominance", "gini_dominance",
"dmn_dominance", "relative_dominance",
"simpson_lambda_dominance", "camargo_evenness",
"pielou_evenness", "simpson_evenness",
"evar_evenness", "bulla_evenness", "ace_richness",
"chao1_richness", "hill_richness", "observed_richness"),
index = c("dbp_dominance", "faith_diversity", "observed_richness",
"shannon_diversity"),
name = index, niter = NULL, BPPARAM = SerialParam(), ...){
############################## Input check #############################
# Support altExp hiddenly
Expand Down
2 changes: 1 addition & 1 deletion R/getCrossAssociation.R
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@
#' # col.var from colData.
#' result <- getCrossAssociation(
#' mae[[1]], assay.type1 = "counts",
#' col.var2 = c("shannon_diversity", "coverage_diversity"),
#' col.var2 = c("shannon_diversity", "dbp_dominance"),
#' test.signif = TRUE, show.warnings = FALSE, verbose = FALSE)
#'
#' # If your data contains TreeSE with alternative experiment in altExp,
Expand Down
18 changes: 11 additions & 7 deletions man/addAlpha.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/getCrossAssociation.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading