| runCollapseCellTypes,NanoStringGeoMxSet-method {SpatialDecon} | R Documentation |
Given the input of an SpatialDecon result output and a list of which cell types to combine, returns a reshaped deconvolution result object with the specified cell types merged.
## S4 method for signature 'NanoStringGeoMxSet' runCollapseCellTypes(object, matching = NULL)
object |
A NanostringGeomxSet object returned by the SpatialDecon algorithm |
matching |
A list object holding the mapping from beta's cell names to official cell names. See str(safeTME.matches) for an example. |
A reshaped deconvolution result object
library(GeomxTools)
datadir <- system.file("extdata", "DSP_NGS_Example_Data", package = "GeomxTools")
demoData <- readRDS(file.path(datadir, "/demoData.rds"))
demoData <- shiftCountsOne(demoData)
target_demoData <- aggregateCounts(demoData)
target_demoData <- normalize(target_demoData, "quant")
# run basic decon:
res0 <- runspatialdecon(object = target_demoData,
norm_elt = "exprs_norm",
raw_elt = "exprs")
# run reverse decon:
target_demoData <- runReverseDecon(object = target_demoData,
norm_elt = "exprs_norm",
beta = pData(res0)$beta)