Skip to contents

This function is used to visualize the clustering results generated by MICA.

Usage

MICAplot(
  input_eset,
  color_by = "clusterID",
  colors = NULL,
  do.logTransform = TRUE,
  X = "UMAP_1",
  Y = "UMAP_2",
  point.size = 0.3,
  point.alpha = 1,
  name.plot_title = NULL,
  fontsize.plot_table = 20,
  show.cluster_label = TRUE,
  fontsize.cluster_label = 12,
  legend.position = "right",
  fontsize.legend_title = 10,
  fontsize.legend_text = 8,
  fontsize.axis_title = 10,
  fontsize.axis_text = 8
)

Arguments

input_eset

The sparse eset object

color_by

Factor, character or numeric, name of the column of MICA cluster labels. Default: "clusterID".

colors

A character vector or NULL, colors of the MICA cluster labels. The length of this vector should be same as the number of groups in color_by column. If NULL, the ggplot default colors will be use. Default: NULL.

do.logTransform

Logical, whether to do the log2(value + 1) transformation. Only valid when color_by is numeric Default: TRUE.

X, Y

Character, name of the columns of x-axis and y-axis coordinates. Default: "UMAP_1", and "UMAP_2".

point.size

Numeric, size of points. Default: 0.3.

point.alpha

Numeric, transparency of points, ranging from 0 (more transparent) to 1 (less transparent). Default: 1.

name.plot_title

Character or NULL, title of the plot. Default: NULL.

fontsize.plot_table

Numeric, font size of the title. Default: 20.

show.cluster_label

Logical, whether to show labels on the plot. Ignored when color_by is numeric. Default: TRUE.

fontsize.cluster_label

Numeric, font size of the labels. Ignored when color_by is numeric. Default: 12.

legend.position

Character, position of legend: "right", "left", "top", "bottom" or "none". Default: "right".

fontsize.legend_title

Integer, font size of the legend title. Default: 10.

fontsize.legend_text

Integer, font size of the legend text. Default: 8.

fontsize.axis_title

Integer, font size of the axis title. Default: 10.

fontsize.axis_text

Integer, font size of the axis text. Default: 8.

Value

A UMAP or T-SNE plot. It also print the plot to screen.

Examples


data(pbmc14k_expression.eset)
## 1. color-coded by factor or character variable
p1 <- MICAplot(input_eset = pbmc14k_expression.eset,
               color_by = "clusterID",
               X = "UMAP_1", Y = "UMAP_2",
               point.size = 0.1,
               fontsize.cluster_label = 6)

## 2. color-coded by numeric variable
p2 <- MICAplot(input_eset = pbmc14k_expression.eset,
               color_by = "nUMI",
               do.logTransform = TRUE,
               point.size = 0.1)
#> The values in "nUMI" have been transformed by log2(value + 1). To turn transformation off, set do.logTransform = FALSE.