runCollapseCellTypes: Run collapseCellTypes

runCollapseCellTypesR Documentation

Run collapseCellTypes

Description

Runs collapseCellTypes from an S4 object

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.

Usage

runCollapseCellTypes(object, ...)

## S4 method for signature 'NanoStringGeoMxSet'
runCollapseCellTypes(object, matching = NULL)

Arguments

object

An S4 object such as a GeoMxSet object

...

Arguments passed to collapseCellTypes

matching

A list object holding the mapping from beta's cell names to official cell names. See str(safeTME.matches) for an example.

Value

A reshaped deconvolution result object

Examples

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)


Nanostring-Biostats/SpatialDecon documentation built on Jan. 26, 2024, 8:20 p.m.