Skip to contents

Reads data from either imaging based spatial transcriptomic (CosMx, MERSCOPE, Xenium) and outputs a seurat object(seu_obj) with some common metadata for downstream comparison.

Usage

readSpatial(sample_id, path, platform = NULL, seurat = FALSE)

Arguments

sample_id

Identifier for the sample being processed.

path

The file path from which to load the spatial transcriptomics data.

platform

The platform from which the data originates. Valid options are 'Xenium', 'CosMx', and 'Merscope'.

seurat

Return a seurat object or not.

Value

Returns a Seurat object containing the loaded and processed spatial transcriptomics data, including sample metadata, cell metadata, and embeddings for tissue coordinates. The structure and content of the returned object vary depending on the platform.

Details

Reads and preprocesses spatial transcriptomics data from a specified path for a given platform. The function supports 'Xenium' and 'CosMx' platforms, performing platform-specific loading and preprocessing steps. This includes loading the data, annotating it with sample metadata, and processing cell metadata. For 'Xenium', it adds additional cell metadata and tissue coordinates as an embedding for custom plotting. For 'CosMx', it fixes assays to separate targeting and non-targeting probes, adds additional cell metadata, and includes tissue coordinates as an embedding.