boxVDJ: Create a box plot for diversity measures

boxVDJR Documentation

Create a box plot for diversity measures

Description

boxVDJ creates a box plot of the specified diversity.

Usage

boxVDJ(d, ...)

## S4 method for signature 'matrix'
boxVDJ(
  d,
  sampleGroups = NULL,
  method = c("shannon", "simpson", "invsimpson", "chao1", "chaobunge"),
  title = NULL,
  legend = FALSE
)

Arguments

d

A matrix created with calculateDiversity.

...

additional arguments.

sampleGroups

A matrix or data.frame that identifies the groups that each sample belongs to. The matrix must contain two columns. The first column lists the individual samples and should be called "Sample". The second column should list the group that each sample belongs to (e.g. Normal and Tumor) and be called "Group". If no sampleGroups dataset is provided, all of the samples will be plotted in one group.

method

Identifies the type of diversity that is to be plotted.

title

Character vector with an optional title.

legend

If TRUE, a legend will be included with the plot. If FALSE, no legend is included in the plot.

Value

Returns a ggplot plot with a box plot that shows the diversity for each sample. A box plot is created for each of the grouping variables. The individual diversity measures are plotted on the box plots.

Examples

data('contigs')
x <- clonoStats(contigs)
d <- calculateDiversity(x)
sampleGroups <- data.frame(Sample = c("sample1", "sample2"), 
                           Group = c("Cancer", "Normal"))
boxVDJ(d, sampleGroups = sampleGroups, method = "shannon", 
       title = "Shannon diversity", legend = FALSE)


kstreet13/VDJdive documentation built on May 31, 2024, 1:26 p.m.