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
)
of class NanoStringGeoMxSet
categorical variable to be used for coloring points
assayDataElement of the NanoStringGeoMxSet-class object to be used for dimensional reductions
boolean to apply log2 transformation to the data to be used in the dimensional reduction algorithms (TRUE by default)
categorical variable to be used for coloring points (optional)
categorical variable to be used for the shape of points (optional)
point size
point color transparency
symbols size in legends
base font size
boolean to display plots or set to FALSE otherwise; ggplot objects are returned in either case
A named list containing the NanoStringGeoMxSet-class object with the dimensional reduction coordinates added ("object") and a list of ggplot
objects ("plot")
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.
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")
}