Skip to contents

This function computes fold changes (FCs) for spatial transcriptomic data, comparing expression levels between spatial clusters within each cell type.

Usage

ComputeFCs(
  normdata,
  scmeta,
  cluster = "SE",
  Region = NULL,
  scale = FALSE,
  ncores = 4
)

Arguments

normdata

Numeric matrix of normalized expression data, where rows represent genes and columns represent cells.

scmeta

Data frame containing metadata associated with each cell, including spatial cluster and cell type annotations.

cluster

Character string specifying the column name in 'scmeta' containing spatial cluster annotations.

Region

Character string specifying the column name in metadata data frames containing region annotations (default: NULL).

scale

A boolean specifying whether to do univariance normalization.

ncores

Integer specifying the number of CPU cores to use for parallel processing.

Value

A matrix of fold changes (FCs), where rows represent genes and columns represent spatial clusters from the sample.