论文
The slow-evolving Acorus tatarinowii genome sheds light on ancestral monocot evolution
https://www.nature.com/articles/s41477-022-01187-x#Sec21
本地pdf s41477-022-01187-x.pdf
论文中的数据根本都公开了,我们可以使用论文中的数据模仿论文中的图,本日的推文模仿一下论文中Figure1c 和 figure1f
figure1c
部分示例数据截图
读取数据并作图
library(readxl)datf3c<-read_excel("data/20220807/41477_2022_1187_MOESM4_ESM.xlsx", sheet = "Fig.1C", skip = 1)head(datf3c)library(tidyverse)datf3c %>% select(-'4dTV_1') %>% pivot_longer(-'4dTV_2') %>% mutate(name = fct_relevel(name,c("Acorus-Acorus", "Acorus-Zostera", "Acorus-Oryza", "Acorus-Asparagus"))) -> new.datf3c#install.packages("latex2exp")library(latex2exp)ggplot(data=new.datf3c, aes(x=`4dTV_2`,y=value,color=name))+ geom_line(size=1)+ scale_color_manual(values = c("#ff0000","#7030a0", "#00b050","#5b9bd5"), name=NULL)+ theme_classic()+ theme(legend.position = c(0.8,0.8), legend.text = element_text(face = "italic"))+ scale_x_continuous(expand = expansion(mult = c(0,0)), limits = c(0,2), breaks = seq(0,2,0.2))+ scale_y_continuous(expand = expansion(mult = c(0,0)), limits = c(0,300))+ labs(x="4dTV",y="No.of gene pairs") -> p1p1figure1f
部分示例数据截图
读取数据并作图
datf3f<-read_excel("data/20220807/41477_2022_1187_MOESM4_ESM.xlsx", sheet = "Fig.1F", skip = 1)head(datf3f)datf3f %>% pivot_longer(-"Distance to Gene Start") %>% ggplot(aes(x=`Distance to Gene Start`, y=value, color=name))+ geom_line()+ scale_color_manual(values = c("#ff0000","#00b0f0"))+ theme_classic()+ theme(legend.position = c(0.9,0.2), plot.margin = unit(c(0.1,0.5,0.1,0.1),'cm'), legend.title = element_blank())+ scale_x_continuous(expand = expansion(mult = c(0,0)), labels = c("-2 kb","Start","", "Stop","+2 kb"))+ scale_y_continuous(expand = expansion(mult = c(0,0)), limits = c(0,0.4))+ labs(x=NULL,y="Ratio of TEs") -> p2p2末了是拼图
p1+p2+ plot_annotation(tag_levels = list(c("c","f")))
示例数据可以在论文中去下载,代码直接在推文中复制,假如必要我整理好的数据和代码可以给推文打赏1元获取
接待各人关注我的公众号
小明的数据分析条记本
小明的数据分析条记本 公众号 重要分享:1、R语言和python做数据分析和数据可视化的简朴小例子;2、园艺植物相干转录组学、基因组学、群体遗传学文献阅读条记;3、生物信息学入门学习资料及本身的学习条记!
|