Plot embedding

plot_embedding(
  matrix,
  labels = NULL,
  method = "pca",
  colors = RColorBrewer::brewer.pal(length(unique(labels)), "Set1"),
  seed = 1,
  point_size = 1,
  cores = 1
)

Arguments

matrix

Input matrix.

labels

Input labels.

method

Method to use for dimensionality reduction.

colors

Colors to use for the plot.

seed

Seed for the random number generator.

point_size

Size of the points.

cores

Set the number of threads when setting method to umap and Rtsne.

Value

An embedding plot

Examples

data("example_matrix")
samples_use <- 1:200
plot_data <- example_matrix[samples_use, ]
labels <- sample(
  c("A", "B", "C", "D", "E"),
  nrow(plot_data),
  replace = TRUE
)

plot_embedding(
  plot_data,
  labels,
  method = "pca",
  point_size = 2
)
plot_embedding( plot_data, labels, method = "tsne", point_size = 2 )