Skip to contents

calculate_niche_de_targets Calculate differential expression of receiver cell type in one niche versus all other niches of interest: focus on finding DE genes

Usage

calculate_niche_de_targets(seurat_obj, niches, expression_pct, lfc_cutoff, assay_oi = "SCT")

Arguments

seurat_obj

Seurat object

niches

a list of lists/niches giving the name, senders and receiver celltypes for each nice. Sender and receiver cell types should be part of Idents(seurat_obj).

expression_pct

input of `min.pct` of `Seurat::FindMarkers`

lfc_cutoff

input of `logfc.threshold` of `Seurat::FindMarkers`

assay_oi

Which assay need to be used for DE calculation via `FindMarkers`. Default SCT, alternatives: RNA.

Value

A tibble containing the DE results of the niches versus each other.

Examples

if (FALSE) { # \dontrun{
seurat_obj <- readRDS(url("https://zenodo.org/record/5840787/files/seurat_obj_subset_integrated_zonation.rds"))
niches <- list(
  "KC_niche" = list(
    "sender" = c("LSECs_portal", "Hepatocytes_portal", "Stellate cells_portal"),
    "receiver" = c("KCs")
  ),
  "MoMac2_niche" = list(
    "sender" = c("Cholangiocytes", "Fibroblast 2"),
    "receiver" = c("MoMac2")
  ),
  "MoMac1_niche" = list(
    "sender" = c("Capsule fibroblasts", "Mesothelial cells"),
    "receiver" = c("MoMac1")
  )
)
calculate_niche_de_targets(seurat_obj, niches, expression_pct = 0.10, lfc_cutoff = 0.15)
} # }