
Plot cell-type deconvolution heatmap
get_celltype_heatmap.RdPlot cell-type deconvolution heatmap
Arguments
- x
A VISTA object.
- group_column
Optional grouping column from
sample_info(x). If provided andcluster_columns = FALSE, samples are ordered by this group.- samples
Optional character vector of samples to include.
- cell_types
Optional character vector of cell types to include.
- top_n
Number of top cell types by mean score when
cell_typesisNULL.- transform
One of
"none","zscore", or"log1p".- cluster_rows
Logical; hierarchical cluster cell types.
- cluster_columns
Logical; hierarchical cluster samples.
- show_values
Logical; overlay numeric values on tiles.
- font_size
Base font size.
- return_type
One of
"plot","matrix", or"both".
Examples
mat <- matrix(rpois(20, lambda = 20), nrow = 5)
rownames(mat) <- paste0("gene", seq_len(5))
colnames(mat) <- paste0("sample", seq_len(4))
se <- SummarizedExperiment::SummarizedExperiment(
assays = list(norm_counts = mat),
colData = S4Vectors::DataFrame(
cond = c("A", "A", "B", "B"),
row.names = colnames(mat)
),
rowData = S4Vectors::DataFrame(
gene_id = rownames(mat),
row.names = rownames(mat)
)
)
v <- as_vista(se, group_column = "cond")
md <- S4Vectors::metadata(v)
md$cell_fractions <- data.frame(
fibroblast = c(0.2, 0.3, 0.4, 0.5),
epithelial = c(0.8, 0.7, 0.6, 0.5),
row.names = colnames(mat)
)
S4Vectors::metadata(v) <- md
get_celltype_heatmap(v, group_column = "cond")