CAESAR.enrich.score: Calculate Spot Level Enrichment Scores for Pathways Using...

View source: R/caesar_enrichscore.R

CAESAR.enrich.scoreR Documentation

Calculate Spot Level Enrichment Scores for Pathways Using CAESAR

Description

This function calculates spot level enrichment scores for a list of pathways based on a cell-gene distance matrix in a Seurat object. The function uses a permutation-based approach to determine the significance of the enrichment scores.

Usage

CAESAR.enrich.score(
  seu,
  pathwaylist,
  assay.dist = "distce",
  reduction.name = "caesar",
  gene.use = NULL,
  n_fake = 1001,
  seed = 1
)

Arguments

seu

A Seurat object containing the gene expression data.

pathwaylist

A list of pathways, where each pathway is represented by a vector of genes.

assay.dist

A character string specifying the assay that contains the distance matrix. Default is "distce".

reduction.name

A character string specifying the reduction method to use if the distance matrix needs to be computed. Default is "caesar".

gene.use

A character vector specifying which genes to use in the analysis. If NULL, all genes in the distance matrix will be used. Default is NULL.

n_fake

An integer specifying the number of random permutations to generate for significance testing. Default is 1001.

seed

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

Value

A matrix of enrichment scores with cells as rows and pathways as columns.

Examples

data(toydata)

seu <- toydata$seu
pathway_list <- toydata$pathway_list

enrich.score <- CAESAR.enrich.score(seu, pathway_list)
head(enrich.score)


CAESAR.Suite documentation built on April 3, 2025, 10:32 p.m.