boxplot绘图分面

boxplot绘图分面



df=read.table("~/LUAD/data/TCGA/metadataAll.group.tsv",sep="\t",header=T,check.names = F)

df=df[,!duplicated(colnames(df))]


# "Cisplatin_1005" \

#                "Gemcitabine_1190" \

#                "Docetaxel_1007" \

#                "Paclitaxel_1080" \

#                "Irinotecan_1088"   "Vinorelbine_2048"  "Osimertinib_1919" \


df=df[,c("Cisplatin_1005","Gemcitabine_1190","Docetaxel_1007","Paclitaxel_1080","Irinotecan_1088","Vinorelbine_2048","Osimertinib_1919","riskGroup")]


library(dplyr)

#长型数据转换


score=df %>%

  pivot_longer(cols = -riskGroup, names_to = "Drug", values_to = "IC50")



ggplot(subset(score,IC50<200), aes(x = riskGroup, y = IC50, fill = riskGroup)) + 

geom_boxplot()+

#geom_jitter(width = 0.1,alpha = 0.3) +

facet_wrap(~Drug, scales = "free") +

  theme_bw()+theme(

    panel.grid.major = element_blank(),

    panel.grid.minor = element_blank(),

      strip.background = element_rect(fill = "white", colour = "black"),  # 设置小图标题背景为白色

    strip.text = element_text(colour = "black")  # 设置标题文字颜色为黑色(可选)

  )



attachments-2026-03-mguRAjug69a504a4f397b.png


  • 发表于 12小时前
  • 阅读 ( 10 )
  • 分类:转录组

你可能感兴趣的文章

相关问题

0 条评论

请先 登录 后评论
omicsgene
omicsgene

生物信息

757 篇文章

作家榜 »

  1. omicsgene 757 文章
  2. 安生水 369 文章
  3. Daitoue 167 文章
  4. 生物女学霸 120 文章
  5. xun 96 文章
  6. rzx 88 文章
  7. 红橙子 81 文章
  8. Ti Amo 76 文章