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 group or by group+block (if the block variable is present). The dashed lines represent the median by group or by group+block (if the block 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_group <- lefser(zeller14tn_ra,
                    groupCol = "study_condition")
# (2) Using classes and sub-classes
res_block <- lefser(zeller14tn_ra,
                    groupCol = "study_condition",
                    blockCol = "age_category")
plot_group <- lefserPlotFeat(res_group, res_group$features[[1]])
plot_block <- lefserPlotFeat(res_block, res_block$features[[2]])


waldronlab/lefser documentation built on Sept. 24, 2024, 9:29 a.m.