SCI论文图表复现-1

SCI论文图表复现-1

这是来到CSDN的第一篇文章,是一个生信小白,关于R和Linux语言懂得不多,想从模仿大神开始学习…

模仿论文中的图表

MiDAS: A global catalogue of full-length 16S rRNA gene sequences and taxonomy for studies of bacterial communities in wastewater treatment plants

  1. 论文地址
  2. 数据链接
  3. 代码链接

图表复现 Figure4a

Alt
论文中没有直接提供这个作图数据,需要运行一系列代码获得,感兴趣的可以自己去找来代码试试,如果运行的话需要比较大的内存。

作图数据部分截图

在这里插入图片描述

读取数据
library(ggplot2)
library(ggrepel)
library(ggtext)
library(tidyverse)

gV134 <- read_csv("fig4a.csv")

作图代码

小明数据分析笔记本
p <- ggplot(gV134,
aes_string(x = "V13_mean_abundance",y = "V4_mean_abundance", fill = "Bias"),
color = "black")+
geom_point(size = 2,shape = 21)+
geom_abline(size = 0.5) #对角线
geom_text_repeal(data = filter(gV134, gV134$FC > 1 & gV134$V4_mean_abundance > 0.1),
aes(label = Genus),
colour = "grey30,
vjust = 1.5)+
geom_text_repeal(data = filter(gV134, gV134$FC < (-1) & gV134$V13_mean_abundance > 0.1),
aes(label = Genus),
colour = "grey30",
vjust = 1.5)+
xlab("Mean V1-V3 amplication genus read abundance (%)")+
ylab("Mean V4 amplication genus read abundance (%)")+
scale_x_log10(limits = c(0.001,2))+
scale_y_log10(limits = c(0.001,2))+
theme_bw()+
theme(legend.position = "none",
plot.title = element_markdown())+
scale_fill_manual(values = c("Equally detected" = "##898989",
"More abundant with V1-V3" = "#2a7cb6",
"More abundant with V4" = "#d41b21"))+
labs(title="352 genera equally abundant <span style = 'color:#898989;'>(gray)</span><br/>
       112 genera more abundant with V4 <span style = 'color:#d41b21;'>(red)</span><br/>
       111 genera more abundant with V1-V3 <span style = 'color:#2a7cb6;'>(blue)</span>"))
论文作者
#Create scatter plot
p <- ggplot(gV134, aes_string(x = "V13_mean_abundance", y= "V4_mean_abundance", color="Bias")) + 
  geom_point(size = 2) +
  geom_abline(size = 0.5) +
  geom_text(data = filter(gV134, gV134$FC>1 & gV134$V4_mean_abundance>0.1), aes(label = Genus), vjust = 1.5, colour="grey30", size = 3) +
  geom_text(data = filter(gV134, gV134$FC<(-1) & gV134$V13_mean_abundance>0.1), aes(label = Genus), vjust = 1.5, colour="grey30", size = 3) +            
  xlab("Mean V13 amplicon genus read abundance (%)") + 
  ylab("Mean V4 amplicon genus read abundance (%)") +
  scale_x_log10(limits=c(0.001,2)) +
  scale_y_log10(limits=c(0.001,2)) +
  theme_bw() +
  theme(legend.position = "none")
ggsave(filename="output/Figure4a_V13_vs_V4_genus_abundance.pdf", plot=p, width=6, height=4, useDingbats=FALSE, limitsize=FALSE)

可以看出,两者在添加数据标签上有所不同,除此之外,小明数据分析笔记本还添加了文章的标题,而作者可能是使用AI进行添加Figure4a标题

完结,撒花~

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值