featurebox: featurebox boxplot expression/abundance values of a...

View source: R/featurebox.R

featureboxR Documentation

featurebox boxplot expression/abundance values of a feature(s) of interest from a matrix

Description

featurebox boxplot expression/abundance values of a feature(s) of interest from a matrix

Usage

featurebox(abundance_matrix, metadata = NULL, features = NULL, group_by = NULL)

Arguments

abundance_matrix

dataframe; samples are columns and features are rows

metadata

dataframe; samples are rows and rownames should match those in abundance_matrix

features

vector; character vector of features to plot i.e. a feature(s) in rownames of abundance_matrix

group_by

character; grouping variable for boxplot. If set then variable must be present in metadata. If NULL each sample is plotted separately.

Value

grob

Examples

abundance_matrix <- data.frame(matrix(rnorm(1000), ncol=20, nrow=50))
colnames(abundance_matrix) <- LETTERS[1:20]
metadata <- data.frame(group = c(rep("group1", 5), rep("group2", 5),
                                 rep("group3", 5), rep("group4", 5)))
rownames(metadata) <- LETTERS[1:20]
featurebox(abundance_matrix, metadata=metadata, features="10", group_by="group")

# multiple features
featurebox(abundance_matrix, metadata=metadata, features=c("10", "20", "30", "40"))

OxfordCMS/OCMSutility documentation built on Feb. 27, 2025, 8:19 p.m.