Description Usage Arguments Value Author(s) Examples
View source: R/markerExpression.R
Generate an dotplot of a dimensionality reduction with marker expression overlaid as a heat dimension.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | markerExpression(
indata,
layout = NULL,
assay = "scaled",
reducedDim = "UMAP",
dimColnames = colnames(as.data.frame(reducedDim(indata, reducedDim))),
markers = sample(rownames(indata), 6),
ncol = 3,
nrow = 2,
col = c("darkblue", "yellow"),
colMidpoint = 0,
alpha = c(0, 1),
pointSize = 0.5,
legendPosition = "right",
legendLabSize = 12,
legendIconSize = 5,
legendKeyHeight = 2.5,
xlim = NULL,
ylim = NULL,
celllab = NULL,
labSize = 3,
labhjust = 1.5,
labvjust = 0,
drawConnectors = TRUE,
widthConnectors = 0.5,
colConnectors = "black",
xlab = dimColnames[1],
xlabAngle = 0,
xlabhjust = 0.5,
xlabvjust = 0.5,
ylab = dimColnames[2],
ylabAngle = 0,
ylabhjust = 0.5,
ylabvjust = 0.5,
axisLabSize = 16,
stripLabSize = 16,
title = "Individual marker expression",
subtitle = "",
caption = ifelse(is(indata, "SingleCellExperiment"), paste0("Total cells, ",
nrow(as.data.frame(reducedDim(indata, reducedDim))[!is.na(reducedDim(indata,
reducedDim)[, 1]), ])), paste0("Total cells, ", nrow(layout))),
titleLabSize = 16,
subtitleLabSize = 12,
captionLabSize = 12,
hline = NULL,
hlineType = "longdash",
hlineCol = "black",
hlineWidth = 0.4,
vline = NULL,
vlineType = "longdash",
vlineCol = "black",
vlineWidth = 0.4,
gridlines.major = FALSE,
gridlines.minor = FALSE,
borderWidth = 0.8,
borderColour = "black"
)
|
indata |
a |
assay |
the SCE assay to choose from. |
reducedDim |
a sting representing the dimensionality reduction stored in the SCE to plot |
markers |
a sting or vecotor of stings representing the markers to select for plotting |
ncol |
a numeric representing the number of colums to arrange the plots into |
nrow |
a numeric representing the number of rows to arrange the plots into |
col |
a vector of two strings representing the colour gradient to be used as the heat component on the expression plot |
colMidpoint |
a numeric representing the midpoint of the colour gradient specified in 'col', the default is 0 |
pointSize |
a numeric specifying the point size of the dots on the plot, default is 0.5 |
plotting_options |
The rest of the options can all found in the ggplot2 documentation. These options control various elements of the ggplot2 output. |
a SingleCellExperiment
object.
Kevin Blighe, James Opzoomer james.opzoomer@kcl.ac.uk
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # Download complete ImmunoCluster SCE object from zenodo
sce_gvhd = readRDS(url("https://zenodo.org/record/3801882/files/sce_gvhd.rds"))
# Run UMAP and store in sce object
sce_gvhd = performUMAP(sce_gvhd)
expression_markers = c('CD3', 'CD4', 'CD8a', 'CD11b', 'CD19', 'CD56')
exp_plot_umap = markerExpression(sce_gvhd,
markers = expression_markers,
reducedDim = 'UMAP',
title = 'UMAP',
nrow = 1, ncol = 6,
pointSize = 0.05,
legendKeyHeight = 1.0,
legendLabSize = 14,
stripLabSize = 20,
axisLabSize = 18,
titleLabSize = 20,
captionLabSize = 22)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.