火山图

作者

不止BI

R语言图表

在线练习

下面的代码输入框可以在线运行R代码,如需安装R包请使用webr::install("packagename"),例如安装ggplot2需要执行webr::install("ggplot2"),安装速度取决于网络与包大小

火山图

代码
library(ggVolcano)

data(deg_data)


data <- add_regulate(deg_data,
  log2FC_name = "log2FoldChange",
  fdr_name = "padj", log2FC = 1, fdr = 0.05
)


ggvolcano(data,
  x = "log2FoldChange", y = "padj",
  label = "row", label_number = 10, output = FALSE
) +
  ggsci::scale_color_aaas() +
  ggsci::scale_fill_aaas()

代码
data("term_data")

# plot
term_volcano(deg_data, term_data,
  x = "log2FoldChange", y = "padj",
  label = "row", label_number = 10, output = FALSE
)

代码
library(RColorBrewer)

# Change the fill and color manually:
deg_point_fill <- brewer.pal(5, "RdYlBu")
names(deg_point_fill) <- unique(term_data$term)

term_volcano(data, term_data,
  x = "log2FoldChange", y = "padj",
  normal_point_color = "#75aadb",
  deg_point_fill = deg_point_fill,
  deg_point_color = "grey",
  legend_background_fill = "#deeffc",
  label = "row", label_number = 10, output = FALSE
)

回到顶部