View source: R/plotting_functions.R
PlotRelativeExpressionUMAP | R Documentation |
Given two or more peaks to plot, calculate a relative expression score and plot on UMAP coordinates
PlotRelativeExpressionUMAP(
peaks.object,
peaks.to.plot,
do.plot = FALSE,
figure.title = NULL,
return.plot = TRUE,
pt.size = 0.5,
txt.size = 14,
legend.position = "right",
use.facet = TRUE,
p.count = 1
)
peaks.object |
Seurat object |
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. Default 0.5 |
txt.size |
size of text. Default 14 |
legend.position |
position of the legend (right, left, bottom or top) |
use.facet |
Whether to plot peaks using ggplot facets. If set to FALSE will use cowplot to plot each peak |
p.count |
Pseudo count |
a ggplot2 object
## 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
## Note, for this example we are recycling t-SNE coordinates to demonstrate running of the function
peaks.sce <- NewPeakSCE(peak.data = peak.counts,
annot.info = peak.annotations,
cell.idents = tip.populations,
umap.coords = tip.tsne.coordinates,
min.cells = 0, min.peaks = 0)
## Plot relative expression of example peaks on t-SNE coordinates
PlotRelativeExpressionUMAP(peaks.object = peaks.sce,
peaks.to.plot = c("Cxcl12:6:117174603-117175050:1", "Cxcl12:6:117180974-117181367:1"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.