runMergeTumorIntoX,NanoStringGeoMxSet-method {SpatialDecon} | R Documentation

## Run mergeTumorIntoX on a NanostringGeomxSet object

### Description

A wrapper for applying mergeTumorIntoX to a NanostringGeomxSet object.

### Usage

    ## S4 method for signature 'NanoStringGeoMxSet'
    runMergeTumorIntoX(object, X, K = 10, pure_tumor_ids = NULL, norm_elt = NULL)

### Arguments

`object` | A NanostringGeomxSet object.
`X` | The training matrix
`K` | the number of clusters to fit
`pure_tumor_ids` | Vector identifying columns of norm that are pure tumor. Can be indices, logicals or column names.
`norm_elt` | norm data element in assayData

### Value

an updated X matrix with new columns, "tumor.1", "tumor.2", ...

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

    data(safeTME)
    tumor.ids <- as.logical(sample(x = c("TRUE","FALSE"), size = 88, replace = TRUE))
    safeTME.with.tumor <- runMergeTumorIntoX(object = target_demoData,
                                             X = safeTME,
                                             K = 3,
                                             pure_tumor_ids = tumor.ids,
                                             norm_elt = "exprs_norm")

[Package SpatialDecon version 1.4.3 Index]