mp_aggregate_clade | R Documentation |
calculate the mean/median (relative) abundance of internal nodes according to their children tips.
mp_aggregate_clade(
.data,
.abundance = NULL,
force = FALSE,
relative = TRUE,
aggregate_fun = c("mean", "median", "geometric.mean"),
action = "get",
...
)
## S4 method for signature 'MPSE'
mp_aggregate_clade(
.data,
.abundance = NULL,
force = FALSE,
relative = TRUE,
aggregate_fun = c("mean", "median", "geometric.mean"),
action = "get",
...
)
## S4 method for signature 'tbl_mpse'
mp_aggregate_clade(
.data,
.abundance = NULL,
force = FALSE,
relative = TRUE,
aggregate_fun = c("mean", "median", "geometric.mean"),
action = "get",
...
)
## S4 method for signature 'grouped_df_mpse'
mp_aggregate_clade(
.data,
.abundance = NULL,
force = FALSE,
relative = TRUE,
aggregate_fun = c("mean", "median", "geometric.mean"),
action = "get",
...
)
.data |
MPSE object which must contain otutree slot, required |
.abundance |
the column names of abundance. |
force |
logical whether calculate the (relative) abundance forcibly when the abundance is not be rarefied, default is FALSE. |
relative |
logical whether calculate the relative abundance. |
aggregate_fun |
function the method to calculate the (relative) abundance of internal nodes according to their children tips, default is 'mean', other options are 'median', 'geometric.mean'. |
action |
character, "add" joins the new information to the otutree slot if it exists (default). In addition, "only" return a non-redundant tibble with the just new information. "get" return a new 'mpse', which the features is the internal nodes. |
... |
additional parameters, meaningless now. |
a object according to 'action' argument.
## Not run:
suppressPackageStartupMessages(library(curatedMetagenomicData))
xx <- curatedMetagenomicData('ZellerG_2014.relative_abundance', dryrun=F)
xx[[1]] %>% as.mpse -> mpse
otu.tree <- mpse %>%
mp_aggregate_clade(
.abundance = Abundance,
force = TRUE,
relative = FALSE,
action = 'get' # other option is 'add' or 'only'.
)
otu.tree
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.