mergeTumorIntoX: Estimate a tumor-specific profile and merge it with the...

Description Usage Arguments Value Examples

View source: R/mergeTumorIntoX.R

Description

Given the input of "tumor-only" AOI's, estimates an collection of tumor-specific expression profiles and merges them with the immune cell expression training matrix. The process:

  1. log2/normalized data from tumor-only AOIs is clustered with hclust, and cutree() is used to define clusters.

  2. 2. Each cluster's geomean profile is merged into the immune cell profile matrix.

Usage

1
mergeTumorIntoX(norm, bg, pure_tumor_ids, X, K = 10)

Arguments

norm

matrix of normalized data

bg

matrix of expected background, on the scale of norm.

pure_tumor_ids

Vector identifying columns of norm that are pure tumor. Can be indices, logicals or column names.

X

The training matrix

K

the number of clusters to fit

Value

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(mini_geomx_dataset)
data(safeTME)
mini_geomx_dataset$bg <- derive_GeoMx_background(
  norm = mini_geomx_dataset$normalized,
  probepool = rep(1, nrow(mini_geomx_dataset$normalized)),
  negnames = "NegProbe"
)
safeTME.with.tumor <- mergeTumorIntoX(
  norm = mini_geomx_dataset$norm,
  bg = mini_geomx_dataset$bg,
  pure_tumor_ids = mini_geomx_dataset$annot$AOI.name == "Tumor",
  X = safeTME,
  K = 3
)

SpatialDecon documentation built on Nov. 8, 2020, 6 p.m.