R/ggPlotting.R
plotSCEViolin.Rd
Visualizes values stored in any slot of a SingleCellExperiment object via a violin plot.
plotSCEViolin(
inSCE,
slotName,
itemName,
feature = NULL,
sample = NULL,
dimension = NULL,
groupBy = NULL,
violin = TRUE,
boxplot = TRUE,
dots = TRUE,
plotOrder = NULL,
xlab = NULL,
ylab = NULL,
axisSize = 10,
axisLabelSize = 10,
dotSize = 0.1,
transparency = 1,
defaultTheme = TRUE,
gridLine = FALSE,
summary = NULL,
title = NULL,
titleSize = NULL,
hcutoff = NULL,
hcolor = "red",
hsize = 1,
hlinetype = 1,
vcutoff = NULL,
vcolor = "red",
vsize = 1,
vlinetype = 1,
combinePlot = "none",
plotLabels = NULL
)
Input SingleCellExperiment object with saved dimension reduction components or a variable with saved results. Required.
Desired slot of SingleCellExperiment used for plotting. Possible options: "assays", "colData", "metadata", "reducedDims". Required.
Desired vector within the slot used for plotting. Required.
Desired name of feature stored in assay of SingleCellExperiment object. Only used when "assays" slotName is selected. Default NULL.
Character vector. Indicates which sample each cell belongs to.
Desired dimension stored in the specified reducedDims. Either an integer which indicates the column or a character vector specifies column name. By default, the 1st dimension/column will be used. Only used when "reducedDims" slotName is selected. Default NULL.
Groupings for each numeric value. A user may input a vector equal length to the number of the samples in the SingleCellExperiment object, or can be retrieved from the colData slot. Default NULL.
Boolean. If TRUE, will plot the violin plot. Default TRUE.
Boolean. If TRUE, will plot boxplots for each violin plot. Default TRUE.
Boolean. If TRUE, will plot dots for each violin plot. Default TRUE.
Character vector. If set, reorders the violin plots in the order of the character vector when `groupBy` is set. Default NULL.
Character vector. Label for x-axis. Default NULL.
Character vector. Label for y-axis. Default NULL.
Size of x/y-axis ticks. Default 10.
Size of x/y-axis labels. Default 10.
Size of dots. Default 0.1.
Transparency of the dots, values will be 0-1. Default 1.
Removes grid in plot and sets axis title size to 10 when TRUE. Default TRUE.
Adds a horizontal grid line if TRUE. Will still be drawn even if defaultTheme is TRUE. Default FALSE.
Adds a summary statistic, as well as a crossbar to the violin plot. Options are "mean" or "median". Default NULL.
Title of plot. Default NULL.
Size of title of plot. Default 15.
Adds a horizontal line with the y-intercept at given value. Default NULL.
Character. A color available from `colors()`. Controls the color of the horizontal cutoff line, if drawn. Default 'black'.
Size of horizontal line, if drawn. Default 0.5.
Type of horizontal line, if drawn. can be specified with either an integer or a name (0 = blank, 1 = solid, 2 = dashed, 3 = dotted, 4 = dotdash, 5 = longdash, 6 = twodash). Default 1.
Adds a vertical line with the x-intercept at given value. Default NULL.
Character. A color available from `colors()`. Controls the color of the vertical cutoff line, if drawn. Default 'black'.
Size of vertical line, if drawn. Default 0.5.
Type of vertical line, if drawn. can be specified with either an integer or a name (0 = blank, 1 = solid, 2 = dashed, 3 = dotted, 4 = dotdash, 5 = longdash, 6 = twodash). Default 1.
Must be either "all", "sample", or "none". "all" will combine all plots into a single .ggplot object, while "sample" will output a list of plots separated by sample. Default "none".
labels to each plot. If set to "default", will use the name of the samples as the labels. If set to "none", no label will be plotted.
a ggplot of the violin plot.
data("mouseBrainSubsetSCE")
plotSCEViolin(
inSCE = mouseBrainSubsetSCE, slotName = "assays",
itemName = "counts", feature = "Apoe", groupBy = "sex"
)