Add cluster labels to a tSNE ggplot2 plot

addLabels(centers, label_repel = FALSE, label_size = 4,
  label_short = FALSE, clusters = NULL)

Arguments

centers

Data frame with at least three columns: "mean_x", "mean_y", and "Cluster", as returned by clusterCenters

label_repel

Logical, whether to plot cluster labels repelled from the center, on a slightly transparent white background and with an arrow pointing to the cluster center. If FALSE, simply plot the cluster label at the cluster center. Default: TRUE.

label_size

Numeric, controls the size of text labels. Default: 4.

label_short

(Optional/Experimental!!) Logical, if TRUE, assumes clusters (at seurat@ident) consist of a prefix and a suffix separated by a non-alpha numeric character ("[^[:alnum:]]+"), and tries to separate these names and only plot the prefix, for shorter labels and a cleaner plot. Default: FALSE.

clusters

(Optional) Clusters for which labels should be plot (if only a subset of clusters should be labelled). Default: NULL (Label all clusters).