lefserPlotFeat: Plot Feature

View source: R/lefserPlotFeat.R

lefserPlotFeatR Documentation

Plot Feature

Description

lefserPlotFeat plots the abundance data of a DA feature across all samples.

Usage

lefserPlotFeat(res, fName, colors = "colorblind")

Arguments

res

An object of class lefser_df, output of the lefser function.

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.

Details

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).

Value

A ggplot object.

Examples


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]])


waldronlab/lefser documentation built on Nov. 1, 2024, 9:02 p.m.