draw_boxplot: draw boxplot for expression

View source: R/1_plots.R

draw_boxplotR Documentation

draw boxplot for expression

Description

draw boxplot for expression

Usage

draw_boxplot(
  exp,
  group_list,
  method = "kruskal.test",
  sort = TRUE,
  drop = FALSE,
  width = 0.5,
  pvalue_cutoff = 0.05,
  xlab = "Gene",
  ylab = "Expression",
  grouplab = "Group",
  p.label = FALSE,
  add_error_bar = FALSE,
  color = c("#2874C5", "#f87669", "#e6b707", "#868686", "#66C2A5", "#FC8D62", "#8DA0CB",
    "#E78AC3", "#A6D854", "#FFD92F", "#E5C494", "#B3B3B3"),
  ...
)

Arguments

exp

A numeric matrix

group_list

A factor with duplicated character or factor

method

one of kruskal.test,aov,t.test and wilcox.test

sort

whether the boxplot will be sorted

drop

whether to discard insignificant values

width

width of boxplot and error bar

pvalue_cutoff

if drop = TRUE,genes with p-values below the threshold will be drawn

xlab

title of the x axis

ylab

title of the y axis

grouplab

title of group legend

p.label

whether to show p value in the plot

add_error_bar

whether to add error bar

color

color vector

...

other parameters from stat_compare_means

Value

a boxplot according to exp and grouped by group.

Author(s)

Xiaojie Sun

See Also

draw_heatmap;draw_volcano;draw_venn

Examples

draw_boxplot(t(iris[,1:4]),iris$Species)
exp <-  matrix(rnorm(60),nrow = 10)
colnames(exp) <- paste0("sample",1:6)
rownames(exp) <- paste0("gene",1:10)
exp[,4:6] = exp[,4:6] +10
exp[1:4,1:4]
group_list <- factor(rep(c("A","B"),each = 3))
draw_boxplot(exp,group_list)
draw_boxplot(exp,group_list,color = c("grey","red"))

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