runCollapseCellTypes,NanoStringGeoMxSet-method {SpatialDecon} | R Documentation

## Collapse related cell types within a deconvolution result

### Description

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

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

### Arguments

`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.

### 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)

[Package SpatialDecon version 1.4.3 Index]