correlation_heatmap: This function returns a correlation heatmap matrix between...

View source: R/correlation_matrix.R

correlation_heatmapR Documentation

This function returns a correlation heatmap matrix between the features of interest specified including genes and or metadata features.

Description

This function returns a correlation heatmap matrix between the features of interest specified including genes and or metadata features.

Usage

correlation_heatmap(
  se,
  genes = NULL,
  feats = NULL,
  assay = "Spatial",
  slot = "data",
  cor_method = "pearson",
  ...
)

Arguments

se

Spatial Seurat object we want to assess.

genes

vector with genes that we want to build the correlation heatmap with.

feats

vector with metadata features that we want to build the correlation heatmap with.

assay

assay from where we want to extract the gene expression.

slot

slot from where we want to extract the gene expression.

cor_method

Method to use for correlation: c("pearson", "kendall", "spearman"). By default pearson.

...

Further arguments to pass to ggcorrplot::ggcorrplot

Value

Correlation matrix heatmap

Examples

## Not run: 
library(Seurat)
library(SeuratData)
sp_obj <- SeuratData::LoadData(ds = "stxBrain", type = "posterior1")
correlation_heatmap(
  se = sp_obj,
  slot = "counts",
  assay = "Spatial",
  genes = c("Ms4a1", "Cd79a", "Cd3d", "Cd3e", "Cd8a"),
  feats = NULL,
  cor_method = "pearson",
  title = "Gene-Gene correlation heatmap")

## End(Not run)


Single-Cell-Genomics-Group-CNAG-CRG/SCrafty-package documentation built on Aug. 20, 2022, 9:29 a.m.