FindAllMarkers_SubsetCoord: Subset a Seurat object by coordinates and find DE genes

View source: R/Seurat_based.R

FindAllMarkers_SubsetCoordR Documentation

Subset a Seurat object by coordinates and find DE genes

Description

This function subsets a Seurat object by the coordinates of a dimensionality reduction, such as tSNE, UMAP, or PCA, and finds differentially expressed genes in the subsetted object.

Usage

FindAllMarkers_SubsetCoord(
  SerObj,
  reduction_method = "tSNE",
  x_range = c(-1, 1),
  y_range = c(-1, 1),
  logfc.threshold = 0.25,
  test.use = "wilcox",
  layer = "data",
  min.pct = 0.65,
  min.diff.pct = 0.2,
  only.pos = T,
  savePathName = NULL
)

Arguments

SerObj

A Seurat object to subset

reduction_method

Character input for the dimensionality reduction method to subset by. Accepts "tSNE", "UMAP", or "PCA". Default is "tSNE"

x_range

A numeric vector of length 2 for the x-coordinate range to subset by

y_range

A numeric vector of length 2 for the y-coordinate range to subset by

logfc.threshold

A numeric threshold for the log fold change of genes to be considered differentially expressed. Default is 0.25

test.use

A character input for the test to use for finding differentially expressed genes. Default is "wilcox"

layer

Character input for which layer to use for finding differentially expressed genes. Default is "data"

min.pct

A numeric threshold for the minimum percentage of cells expressing a gene to be considered. Default is 0.65

min.diff.pct

A numeric threshold for the minimum difference in percentage of cells expressing a gene between groups to be considered differentially expressed. Default is 0.2

only.pos

Logical input indicating whether to only consider positively expressed genes. Default is TRUE

savePathName

A character input for the path to save the differentially expressed genes as an RDS file. Default is NULL

Value

A list of differentially expressed genes

Examples

DEgenes_unsupclusts <- SubsetSerAndFindDEGenes(SerObj = pbmc, reduction_method = "tSNE", x_range = c(-10, 10), y_range = c(-20, 20), savePathName = "DEgenes_unsupclusts.rds")

eisascience/scCustFx documentation built on June 2, 2025, 3:59 a.m.