Skip to contents

This function can recover SEs from Visium, scRNA-seq data or single-cell spatial data.

Usage

RecoverSE(dat, scale = TRUE, Ws = NULL, celltypes = NULL, se_results = NULL)

Arguments

dat

A numeric matrix of gene expression data, from single-cell spatial transcriptomics, scRNA-seq or spot-resolution spatial transcriptomics data.

scale

Logical indicating whether to scale the input data for predictions.

Ws

A list of cell-type-specific W matrices used to recover SE-specific cell states. Each element in the list should be named after the corresponding cell type and contain a W matrix from an NMF model.

celltypes

Character string specifying the cell type annotations, which is required for scRNA-seq or single-cell spatial data.

se_results

A list including a seurat object and a metadata with spatial cluster annotations (SE column) returned by SpatialEcoTyper. When supplied, the `dat` should be single cell gene expression data used for the SpatialEcoTyper analysis.

Value

Depending on the input data: - For single-cell data: A vector of predicted SEs for each cell. - For spot-resolution data (e.g., Visium): A matrix of SE abundances across spots.

Examples

# see https://digitalcytometry.github.io/spatialecotyper/articles/Recovery_scRNA.html
# see https://digitalcytometry.github.io/spatialecotyper/articles/Recovery_Spatial.html