plotHeatmap | R Documentation |
Plot heatmap
plotHeatmap(
x,
genes = rownames(x),
color = "darkblue",
assays = colnames(x),
useFillScale = TRUE
)
## S4 method for signature 'cellSpecificityValues'
plotHeatmap(
x,
genes = rownames(x),
color = "darkblue",
assays = colnames(x),
useFillScale = TRUE
)
## S4 method for signature 'data.frame'
plotHeatmap(
x,
genes = rownames(x),
color = "darkblue",
assays = colnames(x),
useFillScale = TRUE
)
## S4 method for signature 'matrix'
plotHeatmap(
x,
genes = rownames(x),
color = "darkblue",
assays = colnames(x),
useFillScale = TRUE
)
x |
fractions for each gene |
genes |
name of genes to plot |
color |
color of heatmap |
assays |
array of assays to plot |
useFillScale |
default TRUE. add scale_fill_gradient() to plot |
heatmap
library(muscat)
library(SingleCellExperiment)
data(example_sce)
# create pseudobulk for each sample and cell cluster
pb <- aggregateToPseudoBulk(example_sce,
assay = "counts",
cluster_id = "cluster_id",
sample_id = "sample_id",
verbose = FALSE
)
# Compute cell type specificity of each gene
df <- cellTypeSpecificity(pb)
# For each cell type, get most specific gene
genes <- rownames(df)[apply(df, 2, which.max)]
# heatmap of 5 genes that are most cell type specific
dreamlet::plotHeatmap(df, genes = genes)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.