runMergeTumorIntoX: Run MergeTumorIntoX

runMergeTumorIntoXR Documentation

Run MergeTumorIntoX

Description

Runs mergeTumorIntoX from an S4 object

A wrapper for applying mergeTumorIntoX to a NanostringGeomxSet object.

Usage

runMergeTumorIntoX(object, ...)

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

Arguments

object

An S4 object such as a GeoMxSet object

...

Arguments passed to mergeTumorIntoX

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

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


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