Skip to contents

Identifies common genes between a spatial transcriptomics dataset (seu_obj) and a single-cell RNA-seq reference dataset (ref). It computes the mean expression levels of these genes in both datasets while including the mean signal of control probes from seu_obj. This function is useful for preparing data for correlation analyses or visual comparison between datasets.

Usage

getCorrelationExp(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.

Value

A data frame with columns for sample_id, platform, gene, value_sample, value_ref, and neg_probe_signal.

Details

The function begins by identifying genes present in both the spatial transcriptomics dataset and the single-cell reference. For these common genes, it calculates the average expression levels in both datasets. Additionally, it computes the average signal of control probes in the spatial dataset, which can serve as a background signal reference. The resulting data frame includes sample identifiers, platforms, gene names, mean expression values in the sample and reference, and the negative control probe signal, facilitating easy comparison and correlation analysis.