Learn R Programming

CAESAR.Suite (version 0.1.0)

CAESAR.CTDEP: Test Cell Type Differentially Enriched Pathways

Description

This function tests whether specific pathways are differentially enriched in particular cell types with cell types stored in a Seurat object. The function applies the Wilcoxon rank-sum test to compare the pathway scores between cells of a given cell type and all other cells. It supports parallel computation to speed up the testing process.

Usage

CAESAR.CTDEP(
  seu,
  pathway_scores,
  ident = NULL,
  cts = NULL,
  parallel = TRUE,
  ncores = 10,
  seed = 1
)

Value

A matrix of p-values where rows represent the pathways and columns represent the tested cell types.

Arguments

seu

A Seurat object containing the single-cell RNA-seq data.

pathway_scores

A matrix of pathway scores where rows represent cells and columns represent different pathways.

ident

A character string specifying the column name in the Seurat object's metadata to use as the cell type labels. If NULL, the default identities (Idents(seu)) will be used. Default is NULL.

cts

A character vector specifying the cell types to test. If NULL, the function will test all unique cell types present in ident or Idents(seu). Default is NULL.

parallel

Logical, indicating whether to run the computation in parallel. Default is TRUE.

ncores

An integer specifying the number of cores to use for parallel computation. Default is 10.

seed

An integer specifying the random seed for reproducibility in parallel computation. Default is 1.

See Also

wilcox.test for the Wilcoxon rank-sum test. CAESAR.enrich.score for spot level pathway enrich scores.

Examples

Run this code
data(toydata)

seu <- toydata$seu
pathway_list <- toydata$pathway_list
cts <- levels(seu)[1:2]

enrich.score <- CAESAR.enrich.score(seu, pathway_list)
dep.pvals <- CAESAR.CTDEP(seu, enrich.score, cts = cts)
print(dep.pvals)

Run the code above in your browser using DataLab