draw_tsne: draw_tsne

View source: R/1_plots.R

draw_tsneR Documentation

draw_tsne

Description

draw tsne plot with annotation by ggplot2

Usage

draw_tsne(
  exp,
  group_list,
  perplexity = 30,
  color = c("#2874C5", "#f87669", "#e6b707", "#868686", "#92C5DE", "#F4A582", "#66C2A5",
    "#FC8D62", "#8DA0CB", "#E78AC3", "#A6D854", "#FFD92F", "#E5C494", "#B3B3B3"),
  color.label = "group",
  addEllipses = TRUE
)

Arguments

exp

A numeric matrix

group_list

A factor with duplicated character or factor

perplexity

numeric; perplexity parameter for Rtsne

color

color vector

color.label

color legend label

addEllipses

logical,add ellipses or not

Value

a ggplot object

Author(s)

Xiaojie Sun

Examples

exp <-  matrix(rnorm(10000),nrow = 50)
colnames(exp) <- paste0("sample",1:200)
rownames(exp) <- paste0("gene",1:50)
exp[1:4,1:4]
exp[,1:100] = exp[,1:100]+10
group_list <- factor(rep(c("A","B"),each = 100))
draw_tsne(exp,group_list)

tinyarray documentation built on Aug. 18, 2023, 9:07 a.m.