View source: R/lefserPlotFeat.R
lefserPlotFeat | R Documentation |
lefserPlotFeat
plots the abundance data of a DA feature across all
samples.
lefserPlotFeat(res, fName, colors = "colorblind")
res |
An object of class lefser_df,
output of the |
fName |
A character string. The name of a feature in the lefser_df object. |
colors |
Colors corresponding to class 0 and 1. Options: "c" (colorblind), "l" (lefse), "g" (greyscale). Defaults to "c". This argument also accepts a character(2) with two color names. |
The solid lines represent the mean by class or by class+subclass (if the subclass variable is present). The dashed lines represent the median by class or by class+subclass (if the subclass variable is present).
A ggplot object.
data(zeller14)
zeller14 <- zeller14[, zeller14$study_condition != "adenoma"]
tn <- get_terminal_nodes(rownames(zeller14))
zeller14tn <- zeller14[tn,]
zeller14tn_ra <- relativeAb(zeller14tn)
# (1) Using classes only
res_class <- lefser(zeller14tn_ra,
classCol = "study_condition")
# (2) Using classes and sub-classes
res_subclass <- lefser(zeller14tn_ra,
classCol = "study_condition",
subclassCol = "age_category")
plot_class <- lefserPlotFeat(res_class, res_class$features[[1]])
plot_subclass <- lefserPlotFeat(res_subclass, res_subclass$features[[2]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.