当前位置:首页>java>「编程虚拟生物」R包gganatogram绘制20+常见模式动植物

「编程虚拟生物」R包gganatogram绘制20+常见模式动植物

  • 2026-10-21 13:28:14
「编程虚拟生物」R包gganatogram绘制20+常见模式动植物
「编程虚拟器官」R包gganatogram填充器官
其他生物(即2级生物)
表达图谱(Expression Atlas)包含人类和小鼠以外的其他生物,但这些生物的注释不够完善。
所有表达图谱的解剖图谱均可通过链接获取:https://ebi-gene-expression-group.github.io/anatomogram/
为绘制这些图表,新增了2个对象:other_key和other_list。
2者均为嵌套列表,若要绘制某生物的所有器官,需以other_key[["organism"]]作为数据,且将「生物名称」指定为organism参数。
此外,目前的器官名称是UBERON术语与植物本体ID的混合形式。
library(gganatogram)library(dplyr)library(viridis)library(gridExtra)length(other_key)#> [1] 24names(other_key)
🍀 绘制牛(bos_taurus)的图表
other_key[["bos_taurus"]]gganatogram(data=other_key[["bos_taurus"]], outline = T,             fillOutline='white', organism="bos_taurus",            sex='female', fill="colour")  +  theme_void() +  ggtitle("bos_taurus") +   theme(plot.title = element_text(hjust=0.5)) +   coord_fixed()
🍀 提取属于12生肖的物种(对应牛、鸡、猴、鼠):
# 定义生肖对应的物种列表chinese_zodiac <- c("bos_taurus",  # 牛                    "gallus_gallus", # 鸡                    "macaca_mulatta", # 猴                    "rattus_norvegicus") # 鼠# 筛选出属于12生肖的物种zodiac_species <- names(other_key)[names(other_key) %in% chinese_zodiac]zodiac_key <- other_key[names(other_key) %in% chinese_zodiac]plotList <- list()for (organism in zodiac_species) {  plotList[[organism]] <- gganatogram(data=zodiac_key[[organism]], outline = T, fillOutline='white', organism=organism, sex='female', fill="colour")  +    theme_void() +    ggtitle(organism) +     theme(plot.title = element_text(hjust=0.5, size=9)) +     coord_fixed()}do.call(grid.arrange,  c(plotList[1:4], ncol=2))
🍀 遍历所有其他生物并绘制其器官
plotList <- list()for (organism innames(other_key)) {  plotList[[organism]] <- gganatogram(    data=other_key[[organism]], outline = T,     fillOutline='white', organism=organism,     sex='female', fill="colour")  +    theme_void() +    ggtitle(organism) +     theme(plot.title = element_text(hjust=0.5, size=9)) +     coord_fixed()}# 将网格排列转换为图形对象grob_plot <- do.call(arrangeGrob,  c(plotList[1:24], ncol=4))# 用ggsave保存为PDFggsave(  filename = "other_key_ggsave.pdf",  plot = grob_plot,  width = 10,  height = 15,  device = "pdf",  bg = "white")
从左到右、从上往下的物种中文名依次为:

🐎马上有福🧧

1年系统教学,实打实包教包会

每月中、月底共24节,全年无休1对1答疑

含代码、数据等完整资料包,限50人

参考

https://github.com/jespermaag/gganatogram

最新文章

随机文章