Skip to contents

#' Generates a correlation heatmap from expression data to visualize similarity across sample groups. Allows customization of plot type, correlation method, and color scaling using the ggcorrplot2 and ggplot2 architectures. Ideal for comparing transcriptional profiles between conditions or clusters.

Usage

DO.Correlation(
  Seu_obj,
  group_by = "orig.ident",
  assay = "RNA",
  features = NULL,
  method = "spearman",
  plotdesign = "square",
  plottype = "full",
  auto_limits = TRUE,
  outline.color = "white",
  colormap = c("royalblue4", "royalblue2", "firebrick", "firebrick4"),
  lab_size = 10,
  lab = TRUE,
  lab_col = "white",
  ...
)

Arguments

Seu_obj

Seurat Object

group_by

Column to aggregate the expression over it, default "orig.ident"

assay

Assay in object to use, default "RNA"

features

What genes to include by default all, default "None"

method

Correlation method, default "spearman"

plotdesign

Plot design, default "circle"

plottype

Show the full plot or only half of it, default "full"

auto_limits

Automatically rescales the colour bar based on the values in the correlation matrix, default "TRUE"

outline.color

the outline color of square or circle. Default value is "white".

colormap

Defines the colormap used in the plot, default c("royalblue4", "royalblue2","firebrick","firebrick4")

lab_size

Size to be used for the correlation coefficient labels. used when lab = TRUE.

lab

logical value. If TRUE, add correlation coefficient on the plot.

lab_col

color to be used for the correlation coefficient labels. used when lab = TRUE.

...

Additionally arguments passed to ggcorrplot function

Value

ggplot2

Author

Mariano Ruz Jurado

Examples

if (FALSE) { # \dontrun{
DO.Correlation(
  Seu_obj = seurat_object,
  group_by = "orig.ident",
  assay = "RNA",
  features = NULL,
  method = "spearman",
  plotdesign = "square",
  plottype = "full",
  auto_limits = TRUE,
  outline.color = "white",
  colormap = c("royalblue4", "royalblue2", "firebrick", "firebrick4"),
  lab_size = 10,
  lab = TRUE,
  lab_col = "white"
)
} # }