Reduces data to two dimensions using PCA, tSNE, and UMAP. Adds the sample embeddings of each dimensional reduction technique to the input object (phenoData) and plots them on 2D scatter plots.

dimReduct(
  object,
  color.variable1,
  assay.data = "q_norm",
  do.log = TRUE,
  color.variable2 = NULL,
  shape.variable = NULL,
  point.size = 1,
  point.alpha = 1,
  symbol.size = 2,
  text.size = 16,
  print.plots = FALSE
)

Arguments

object

of class NanoStringGeoMxSet

color.variable1

categorical variable to be used for coloring points

assay.data

assayDataElement of the NanoStringGeoMxSet-class object to be used for dimensional reductions

do.log

boolean to apply log2 transformation to the data to be used in the dimensional reduction algorithms (TRUE by default)

color.variable2

categorical variable to be used for coloring points (optional)

shape.variable

categorical variable to be used for the shape of points (optional)

point.size

point size

point.alpha

point color transparency

symbol.size

symbols size in legends

text.size

base font size

print.plots

boolean to display plots or set to FALSE otherwise; ggplot objects are returned in either case

Value

A named list containing the NanoStringGeoMxSet-class object with the dimensional reduction coordinates added ("object") and a list of ggplot

objects ("plot")

Details

If both color.variable1 and color.variable2 are defined, points in the scatter plots are colored by a factor which combines the levels of these two variables.

Examples

if (FALSE) {
# Default plots
output <- dimReduct(object = object, color.variable1="region", 
print.plots=TRUE)
# Plot tSNE
output <- dimReduct(object = object, color.variable1="region",
print.plots = FALSE)
figure <- output$plot$tSNE
print(figure)
# Color by two variables
output <- dimReduct(object = object, color.variable1="region",
color.variable2="class")
}