as.SpatialExperiment: Convert Object to SpatialExperiment

View source: R/coercions.R

as.SpatialExperimentR Documentation

Convert Object to SpatialExperiment

Description

Convert Object to SpatialExperiment

Convert GeoMxSet Object to SpatialExperiment

Usage

as.SpatialExperiment(x, ...)

## S3 method for class 'NanoStringGeoMxSet'
as.SpatialExperiment(
  x,
  normData = NULL,
  coordinates = NULL,
  forceRaw = FALSE,
  ...
)

Arguments

x

GeoMxSet object to convert

...

Arguments passed to other methods

normData

assay containing normalized data

coordinates

X and Y coordinates of each ROI, format: c(X,Y)

forceRaw

should raw data be forced into SpatialExperiment, not recommended

Value

SpatialExperiment containing GeoMx data

Examples

datadir <- system.file("extdata", "DSP_NGS_Example_Data", 
                       package = "GeomxTools")
demoData <- readRDS(file.path(datadir, "/demoData.rds"))

target_demoData <- aggregateCounts(demoData[1:1000,1:10])

target_demoData <- normalize(target_demoData, "quant")

seurat_demoData <- as.SpatialExperiment(target_demoData, 
                                        normData = "exprs_norm", 
                                        forceRaw = FALSE)


Nanostring-Biostats/GeomxTools documentation built on Sept. 24, 2024, 4:51 p.m.