PlotRelativeExpressionViolin: Generate a violin plot plot using relative expression

View source: R/plotting_functions.R

PlotRelativeExpressionViolinR Documentation

Generate a violin plot plot using relative expression

Description

Given two or more peaks to plot, a relative expression score and generate a violin plot according to cell identities

Usage

PlotRelativeExpressionViolin(
  peaks.object,
  peaks.to.plot,
  do.plot = FALSE,
  figure.title = NULL,
  return.plot = TRUE,
  pt.size = 0.5,
  col.set = NULL,
  txt.size = 14,
  add.jitter = TRUE,
  jitter.pt.size = 0.25,
  p.count = 1
)

Arguments

peaks.object

Peak object of either Seurat or SCE class

peaks.to.plot

Set of peaks to plot

do.plot

Whether to plot to output (TRUE by default)

figure.title

Optional figure title

return.plot

Boolean of whether to return plot (default TRUE)

pt.size

size of the points on the t-SNE plot

col.set

default NULL

txt.size

size of text. Default 14

add.jitter

whether to add a geom_jitter to the plot (default: TRUE)

jitter.pt.size

size of point for geom_jitter (default = 0.25)

p.count

Pseudo count

Value

a ggplot2 object

Examples


## Load example data for two peaks from the Cxcl12 gene
extdata_path <- system.file("extdata",package = "Sierra")
load(paste0(extdata_path, "/Cxcl12_example.RData"))
load(paste0(extdata_path, "/TIP_cell_info.RData"))

## Create an SCE object holding the peak data
peaks.sce <- NewPeakSCE(peak.data = peak.counts, 
                        annot.info = peak.annotations, 
                        cell.idents = tip.populations, 
                        tsne.coords = tip.tsne.coordinates,
                        min.cells = 0, min.peaks = 0)
                        
## Plot relative expression of example peaks on t-SNE coordinates
PlotRelativeExpressionViolin(peaks.object = peaks.sce, 
      peaks.to.plot = c("Cxcl12:6:117174603-117175050:1", "Cxcl12:6:117180974-117181367:1"))


VCCRI/Sierra documentation built on July 3, 2023, 6:39 a.m.