Skip to contents

Identify spatially variable genes within each cell cluster

Usage

ctsvg_test(
  expr,
  coord,
  sc,
  cell.filter = TRUE,
  recluRes = NULL,
  min.cells = 0.01,
  seed = 2024,
  verbose = FALSE,
  n.permute = 100
)

Arguments

expr

The normalized gene expression matrix

coord

The matrix of spatial locations

sc

The named vector of cell cluster assignments

cell.filter

Whether to remove spatially isolated cells within each cell cluster (TRUE by default)

recluRes

The output from recluster

min.cells

The minimum proportion of cells within each cell cluster a gene is expressed in to be retained (0.01 by default)

seed

Random seed for permutation (2024 by default)

verbose

Whether to print the cell cluster in progress (FALSE by default)

n.permute

Number of permutation times (reassigned clusters with the highest Jaccard indices, 100 by default)

Value

A data frame with p-values and FDRs for each gene in each cell cluster