Plot the results (heatmap) contained in a ClusterSet object.

plot_ggheatmap(
  object,
  to_log2 = FALSE,
  use_top_genes = TRUE,
  ident = NULL,
  panel_spacing = 0.05,
  colors = colors_for_gradient("Ju1"),
  standardizing = FALSE,
  color_ident = NULL,
  ceil = 1,
  floor = -1,
  centering = TRUE,
  xlab = "Genes",
  ylab = "Spots",
  hide_gene_name = TRUE,
  hide_col_name = TRUE,
  pseudocount = 0.1
)

Arguments

object

A ClusterSet object.

to_log2

Whether data should be transform in logarithm base 2 (+ 1 as a pseudocount).

use_top_genes

A logical to indicate whether to use highly similar genes in the slot top_genes of ClusterSet.

ident

A named vector containing the cell type identities for each cell. Typically the result from the Idents() function on a Seurat object (see Seurat library). Lists are also accepted which will results in multi-level facets.

panel_spacing

Spacing between facets/panels ("line" units).

colors

A vector of colors for the gradient.

standardizing

Whether rows should be divided by standard deviation.

color_ident

A vector containing colors for the cell classes as. also accepted which will results in multi-level facets.

ceil

A value for ceiling (NULL for no ceiling). Ceiling is performed after log transformation, centering and standardization.

floor

A value for flooring (NULL for no flooring). Flooring is performed after log transformation, centering and standardization.

centering

Whether rows should be centered.

xlab

A name for the x axis.

ylab

A name for the y axis.

hide_gene_name

Whether to hide gene names.

hide_col_name

Whether to hide column names.

Value

A ggplot diagram.

Examples

library(Seurat)
# Load datasets
load_example_dataset('7871581/files/pbmc3k_medium_clusters')
#> |-- INFO :  Dataset 7871581/files/pbmc3k_medium_clusters was already loaded. 
load_example_dataset('7871581/files/pbmc3k_medium')
#> |-- INFO :  Dataset 7871581/files/pbmc3k_medium was already loaded. 

# rename clusters
new_obj <- rename_clust(pbmc3k_medium_clusters, new_name=sprintf("M%02d", as.integer(clust_names(pbmc3k_medium_clusters))))

# Use plot_ggheatmap
ident_pbmc3k <- sort(Seurat::Idents(pbmc3k_medium))
new_obj <- top_genes(new_obj)
#> |-- INFO :  Number of top genes is greater than the number of genes in cluster 6. All genes will be used. 
#> |-- INFO :  Number of top genes is greater than the number of genes in cluster 7. All genes will be used. 
#> |-- INFO :  Number of top genes is greater than the number of genes in cluster 8. All genes will be used. 
#> |-- INFO :  Number of top genes is greater than the number of genes in cluster 9. All genes will be used. 
#> |-- INFO :  Number of top genes is greater than the number of genes in cluster 10. All genes will be used. 
#> |-- INFO :  Number of top genes is greater than the number of genes in cluster 11. All genes will be used. 
#> |-- INFO :  Number of top genes is greater than the number of genes in cluster 12. All genes will be used. 
#> |-- INFO :  Number of top genes is greater than the number of genes in cluster 13. All genes will be used. 
#> |-- INFO :  Number of top genes is greater than the number of genes in cluster 14. All genes will be used. 
#> |-- INFO :  Number of top genes is greater than the number of genes in cluster 15. All genes will be used. 
#> |-- INFO :  Results are stored in top_genes slot of ClusterSet object. 
plot_ggheatmap(new_obj[,names(ident_pbmc3k)], ident=ident_pbmc3k)