View source: R/color_mapping_functions.R
prep_mdf | R Documentation |
This function agglomerates a phyloseq object at a specified level and transforms counts to relative abundance. This function also melts the phyloseq object into a melted data frame which is used to apply microshades colors and organization to.
prep_mdf(
ps,
subgroup_level = "Genus",
as_relative_abundance = TRUE,
remove_na = FALSE
)
ps |
phyloseq-class object |
subgroup_level |
string of smaller taxonomic group |
as_relative_abundance |
transform counts to relative abundance |
remove_na |
remove NA values during taxa agglomeration |
Notes:
This normalizes the phyloseq object to relative abundance
This agglomerates to the smaller taxonomic group subgroup_level
data.frame, a melted phyloseq object from psmelt()
library(phyloseq)
library(speedyseq)
data(GlobalPatterns)
# Use defaults
mdf <- prep_mdf(GlobalPatterns)
# Subgroup as "Family"
mdf_fam <- prep_mdf(GlobalPatterns, subgroup_level = "Family")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.