compareVarFeaturesAndRanks: Compare variable features and their ranks in two Seurat...

View source: R/Seurat.Utils.R

compareVarFeaturesAndRanksR Documentation

Compare variable features and their ranks in two Seurat objects.

Description

This function compares variable features (genes) between two Seurat objects, reporting the number of genes in each, the percentage of common genes, the percentage of unique genes in each object, and the similarity in the ranking of overlapping genes using Spearman's rank correlation coefficient. Optionally, it can also generate a scatterplot of the ranks of common genes using ggpubr's ggscatter. The function returns the common genes and the Spearman's rank correlation coefficient.

Usage

compareVarFeaturesAndRanks(
  obj1 = NULL,
  obj2 = NULL,
  cor.plot = TRUE,
  save.plot = TRUE,
  plot_venn = TRUE,
  suffix = NULL,
  ...
)

Arguments

obj1

The first Seurat object for comparison. Default: NULL.

obj2

The second Seurat object for comparison. Default: NULL.

cor.plot

An optional boolean indicating whether to generate a scatterplot of the ranks of common genes. Default: FALSE.

save.plot

save.plot

plot_venn

plot_venn

suffix

suffix

Value

A list containing the common genes and Spearman's rank correlation coefficient. If cor.plot is TRUE, a scatterplot is also generated.

Examples

# Assuming obj1 and obj2 are Seurat objects
result <- compareVarFeaturesAndRanks(obj1, obj2, cor.plot = TRUE)

vertesy/Seurat.utils documentation built on Dec. 4, 2024, 5:20 p.m.