Skip to contents

Thin R-only wrapper around Seurat::LoadNanostring() that validates the bundle layout, sets the scConvert spatial-technology tag, and returns a Seurat object ready for conversion to h5ad / h5Seurat / Zarr via scConvert.

Usage

LoadCosMx(data.dir, fov = "cosmx", assay = "Nanostring", verbose = TRUE)

Arguments

data.dir

Path to the CosMx bundle directory

fov

FOV (field-of-view) name attached to the resulting Seurat object (default "cosmx")

assay

Seurat assay name (default "Nanostring")

verbose

Print progress messages

Value

A Seurat object with an FOV slot containing cell centroids, segmentation boundaries, and transcript molecules

Details

The bundle directory must contain the canonical NanoString CosMx CSV files (*exprMat_file*.csv, *metadata_file*.csv, *fov_positions_file*.csv) and optionally *tx_file*.csv and polygon files. These are the files produced by NanoString's AtoMx export.

The *metadata_file*.csv is read and attached to the Seurat object after construction. This populates cell morphology columns (Area, AspectRatio, Width, Height, CenterX_global_px, CenterY_global_px) and co-registered immunofluorescence intensity columns (Mean.PanCK, Mean.CD45, Mean.CD3, Mean.MembraneStain, etc.) that are not returned by Seurat::ReadNanostring() alone.

Examples

if (FALSE) { # \dontrun{
seurat_obj <- LoadCosMx("/path/to/cosmx_nsclc/")
scConvert(seurat_obj, "cosmx_nsclc.h5ad")
} # }