Description Usage Arguments Details Value Author(s) Examples
View source: R/plotSignatures.R
Find enriched markers per identified cluster and visualise these as a custom corrplot.
1 2 3 4 5 6 7 8 9 10 11 | plotSignatures(
indata,
assay = "scaled",
clusterAssign = metadata(indata)[["Cluster"]],
funcSummarise = function(x) mean(x, na.rm = TRUE),
col = colorRampPalette(brewer.pal(9, "RdPu"))(100),
labCex = 1,
legendCex = 1,
labDegree = 90,
verbose = TRUE
)
|
indata |
A data-frame or matrix, or |
assay |
Name of the assay slot in |
clusterAssign |
A vector of cell-to-cluster assignments. This can be
from any source but must align with your cells / variables. There is no
check to ensure this when |
funcSummarise |
A mathematical function used to summarise expression per marker, per cluster. |
col |
colorRampPalette to be used for shading low-to-high expression. |
labCex |
cex (size) of the main plot labels. |
legendCex |
cex (size) of the legend labels. |
labDegree |
Rotation angle of the main plot labels. |
verbose |
Boolean (TRUE / FALSE) to print messages to console or not. |
Find enriched markers per identified cluster and visualise these as a custom corrplot. plotSignatures
first collapses your input data's expression profiles from the level of cells to the level of clusters based on a mathematical function specified by funcSummarise
. It then centers and scales the data range to be between -1 and +1 for visualisation purposes.
A corrplot
object.
Kevin Blighe <kevin@clinicalbioinformatics.co.uk>
1 2 3 4 5 6 7 8 9 10 11 12 13 | # create random data that follows a negative binomial
mat <- jitter(matrix(
MASS::rnegbin(rexp(1000, rate=.1), theta = 4.5),
ncol = 20))
colnames(mat) <- paste0('CD', 1:ncol(mat))
rownames(mat) <- paste0('cell', 1:nrow(mat))
u <- umap::umap(mat)$layout
colnames(u) <- c('UMAP1','UMAP2')
rownames(u) <- rownames(mat)
clus <- clusKNN(u)
plotSignatures(t(mat), clusterAssign = clus)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.