Environmental factors shaping the gut microbiome in a Dutch population
https://github.com/GRONINGEN-MICROBIOME-CENTRE/DMP
https://zenodo.org/record/5910709#.YmAcp4VBzic
今天的推文重复一下论文中的figure1b
image.png
image.png
这里误差线的范围是平均值加减标准差,数据提前算好,整理到csv文件中
library(readr)
dat01<-read_csv("newdataset/MockData_Fig_1B_microbiome_rarefaction_datatable.csv")
head(dat01)
library(ggplot2)
ggplot(data=dat01,aes(x=nr,y=spec.nr.mn,color=Taxon))+
geom_line(size=1.5,linetype=dat01$linetype)
image.png
ggplot(data=dat01,aes(x=nr,y=spec.nr.mn,color=Taxon))+
geom_line(size=1.5,linetype=dat01$linetype)+
geom_errorbar(aes(ymin=spec.nr.mn-spec.nr.sd,
ymax=spec.nr.mn+spec.nr.sd),
size=1.05, colour="black")
image.png
ggplot(data=dat01,aes(x=nr,y=spec.nr.mn,color=Taxon))+
geom_line(size=1.5,linetype=dat01$linetype)+
geom_errorbar(aes(ymin=spec.nr.mn-spec.nr.sd,
ymax=spec.nr.mn+spec.nr.sd),
size=1.05, colour="black")+
geom_point(shape=21,size=1.75,fill="white")
image.png
ggplot(data=dat01,aes(x=nr,y=spec.nr.mn,color=Taxon))+
geom_line(size=1.5,linetype=dat01$linetype)+
geom_errorbar(aes(ymin=spec.nr.mn-spec.nr.sd,
ymax=spec.nr.mn+spec.nr.sd),
size=1.05, colour="black")+
geom_point(shape=21,size=1.75,fill="white")+
xlab("Number of samples") + ylab("Number of features")
ggplot(data=dat01,aes(x=nr,y=spec.nr.mn,color=Taxon))+
geom_line(size=1.5,linetype=dat01$linetype)+
geom_errorbar(aes(ymin=spec.nr.mn-spec.nr.sd,
ymax=spec.nr.mn+spec.nr.sd),
size=1.05, colour="black")+
geom_point(shape=21,size=1.75,fill="white")+
xlab("Number of samples") + ylab("Number of features")+
scale_color_manual(values = c("#56B4E9", "#009E73", "#0072B2", "#D55E00", "#CC79A7", "#E69F00"))+
theme_bw()+
theme(text = element_text(size = 17))
image.png
ggplot(data=dat01,aes(x=nr,y=spec.nr.mn,color=Taxon))+
geom_line(size=1.5,linetype=dat01$linetype)+
geom_errorbar(aes(ymin=spec.nr.mn-spec.nr.sd,
ymax=spec.nr.mn+spec.nr.sd),
size=1.05, colour="black")+
geom_point(shape=21,size=1.75,fill="white")+
xlab("Number of samples") + ylab("Number of features") -> p1
print(p1)
ggplot(data=dat01,aes(x=nr,y=spec.nr.mn,color=Taxon))+
geom_line(size=1.5,linetype=dat01$linetype)+
geom_errorbar(aes(ymin=spec.nr.mn-spec.nr.sd,
ymax=spec.nr.mn+spec.nr.sd),
size=1.05, colour="black")+
geom_point(shape=21,size=1.75,fill="white")+
xlab("Number of samples") + ylab("Number of features")+
scale_color_manual(values = c("#56B4E9", "#009E73", "#0072B2", "#D55E00", "#CC79A7", "#E69F00"))+
theme_bw()+
theme(text = element_text(size = 17)) -> p2
print(p2)
library(patchwork)
p1+p2
image.png