get_alphaindex | R Documentation |
The function is to calculate alpha diversity estimates.
NOTE: You must use untrimmed datasets for meaningful results, as these estimates (and even the "observed" richness) are highly dependent on the number of singletons. You can always trim the data later on if needed, just not before using this function.
get_alphaindex(
ps,
level = c(NULL, "Kingdom", "Phylum", "Class",
"Order", "Family", "Genus",
"Species", "Strain", "unique"),
indices = c("all",
"Observed", "Chao1", "ACE", "Shannon",
"Simpson", "InvSimpson", "Fisher",
"Evenness", "TaxaNumber"),
mindepth = NULL,
force = FALSE
)
ps |
(Required). a |
level |
(Optional). character. taxonomic level to summarize,
default the top level rank of the |
indices |
(Optional). character, meaning that all available alpha-diversity indices will be included. Alternatively, you can specify one or more indices as a character vector of measure names (default: all). Values must be among those supported: c("Observed", "Chao1", "ACE", "Shannon", "Simpson", "InvSimpson", "Fisher", "Evenness", "TaxaNumber"). "Chao1", "ACE" and "Fisher" only supported by counts matrix (integers). |
mindepth |
(Optional). numeric, Subsample size for rarefying community (default: all). |
force |
(Optional). logical, whether to rarefy samples (default: FASLE). |
A data.frame of alpha index with metadata.
Created by Hua Zou (12/02/2022 Shenzhen China)
https://scienceparkstudygroup.github.io/microbiome-lesson/04-alpha-diversity/index.html
## Not run:
# relative abundance
data("enterotypes_arumugam")
get_alphaindex(
ps = enterotypes_arumugam,
level = "Genus",
indices = c("Shannon", "Observed"))
# absolute abundance
data("caporaso")
get_alphaindex(
ps = caporaso,
level = "Genus",
indices = c("Shannon", "Chao1"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.