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

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.

Value

A ggplot object.

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

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")
#> The outcome variable is specified as 'study_condition' and the reference category is 'CRC'.
#>  See `?factor` or `?relevel` to change the reference category.
# (2) Using classes and sub-classes
res_subclass <- lefser(zeller14tn_ra,
                    classCol = "study_condition",
                    subclassCol = "age_category")
#> The outcome variable is specified as 'study_condition' and the reference category is 'CRC'.
#>  See `?factor` or `?relevel` to change the reference category.
plot_class <- lefserPlotFeat(res_class, res_class$features[[1]])
#> Using palette: colorblind
plot_subclass <- lefserPlotFeat(res_subclass, res_subclass$features[[2]])
#> Using palette: colorblind