Skip to contents

This function is designed to run Robust Cell Type Deconvolution (RCTD) on spatial transcriptomics data using a single-cell RNA-seq reference. It filters cells based on transcript counts, prepares the data, runs RCTD. From the RCTD metric, it then calculates the maximum cell type weight for each spatial location, indicating the most prevalent cell type. The results include sample identifiers, platforms, and the corresponding maximum weight values, rounded to three decimal places.

Usage

getMaxRCTD(seu_obj, ref)

Arguments

seu_obj

A Seurat object containing spatial transcriptomics data.

ref

A Seurat object containing single-cell RNA-seq data used as a reference for deconvolution.

Details

Initially, the function prepares the reference data from a Seurat object by extracting RNA counts, cell types, and UMI counts to create a reference object for RCTD. Spatial data is also preprocessed by filtering cells with low transcript counts and preparing coordinates. RCTD is then executed to deconvolve cell types. Post RCTD, the function extracts the maximum weight for each cell type across spatial locations, which can be used to identify dominant cell types in specific areas. The approach ensures a focus on significant cell type contributions, enhancing the interpretation of spatial transcriptomics data.