-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathFig.4D.S17.S18.S19.S20.S30.EPICON.TP.S.2019.04.06.Rmd
156 lines (130 loc) · 6.22 KB
/
Fig.4D.S17.S18.S19.S20.S30.EPICON.TP.S.2019.04.06.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
---
title: "Untitled"
author: "Cheng Gao"
date: "4/6/2019"
output: html_document
---
```{r, message=FALSE, warning=FALSE, fig.height = 2.5, fig.width = 11, fig.align = "center"}
wd<- "/Users/chengg/Google Drive/EPICON/Mycobiome/Fungal ITS/statistic/Total.fungi"
setwd(wd)
rm(list = ls())
load("EPICON.data.preparation.RC.bNTI.ted.2019.04.19.Rdata")
library(vegan)
library(ggplot2)
env$S.rar362<-specnumber(fung.rar)
env$H<-diversity(fung.rar)
env$J<-env$H/log(env$S)
# TP ~ richness
#env.L$Treatment1<-factor(env.L$Treatment1, levels= c("Control", "Pre_flowering_drought", "Post_flowering_drought"))
env$Habitat<-factor(env$Habitat, levels= c("Leaf", "Root", "Rhizosphere", "Soil"))
ggplot(env, aes(x=factor(TP), y=S.rar362, color=Treatment1)) +
geom_boxplot()+
facet_wrap(~Habitat, ncol = 4,strip.position= 'top')+
labs(x="Week",y = "Richness")+
scale_color_manual(values=c("black","red", "blue"))+
theme_bw()+
guides(color=FALSE)+
theme(strip.text = element_text(size = 15,face="bold"),
panel.spacing = unit(0, "lines"),
legend.title = element_text(colour="black", size=15, face="bold"),
legend.text = element_text(colour="black", size=15, face="bold"),
axis.text=element_text(size=10,face="bold",angle = 90),
axis.title=element_text(size=15,face="bold"))
ggplot(env, aes(x=factor(TP), y=J, color=Treatment1)) +
geom_boxplot()+
facet_wrap(~Habitat, ncol = 4,strip.position= 'top')+
labs(x="Week",y = "Evenness")+
scale_color_manual(values=c("black","red", "blue"))+
theme_bw()+
guides(color=FALSE)+
theme(strip.text = element_text(size = 15,face="bold"),
panel.spacing = unit(0, "lines"),
legend.title = element_text(colour="black", size=15, face="bold"),
legend.text = element_text(colour="black", size=15, face="bold"),
axis.text=element_text(size=10,face="bold",angle = 90),
axis.title=element_text(size=15,face="bold"))
ggplot(env, aes(x=factor(TP), y=Fungi.pct, color=Treatment1)) +
geom_boxplot()+
facet_wrap(~Habitat, ncol = 4,strip.position= 'top')+
labs(x="Week",y = "Fungal ITS2 amplicon %")+
scale_color_manual(values=c("black","red", "blue"))+
theme_bw()+
guides(color=FALSE)+
theme(strip.text = element_text(size = 15,face="bold"),
panel.spacing = unit(0, "lines"),
legend.title = element_text(colour="black", size=15, face="bold"),
legend.text = element_text(colour="black", size=15, face="bold"),
axis.text=element_text(size=10,face="bold",angle = 90),
axis.title=element_text(size=15,face="bold"))
```
```{r, message=FALSE, warning=FALSE, fig.height = 3, fig.width = 6, fig.align = "center"}
ggplot(env[env$qPCR>0,], aes(x=factor(TP), y= log(qPCR+1), color=Treatment1)) +
geom_boxplot()+
facet_wrap(~Habitat, ncol = 2,strip.position= 'top')+
labs(x="Week",y = "Log(Fungal 18S qPCR %)")+
scale_color_manual(values=c("black","red", "blue"))+
theme_bw()+
guides(color=FALSE)+
theme(strip.text = element_text(size = 15,face="bold"),
panel.spacing = unit(0, "lines"),
legend.title = element_text(colour="black", size=15, face="bold"),
legend.text = element_text(colour="black", size=15, face="bold"),
axis.text=element_text(size=10,face="bold",angle = 90),
axis.title=element_text(size=15,face="bold"))
env.Tra$transcrib.pct<-rowSums(env.Tra[, c(12:20,22:24)]) / rowSums(env.Tra[, c(12:24)])
ggplot(env.Tra, aes(x=factor(TP), y= log(transcrib.pct), color=Treatment)) +
geom_boxplot()+
facet_wrap(~Habitat, ncol = 2,strip.position= 'top')+
labs(x="Week",y = "Log(Fungal transcription %)")+
scale_color_manual(values=c("black","red", "blue"))+
theme_bw()+
guides(color=FALSE)+
theme(strip.text = element_text(size = 15,face="bold"),
panel.spacing = unit(0, "lines"),
legend.title = element_text(colour="black", size=15, face="bold"),
legend.text = element_text(colour="black", size=15, face="bold"),
axis.text=element_text(size=10,face="bold",angle = 90),
axis.title=element_text(size=15,face="bold"))
```
```{r, message=FALSE, warning=FALSE, fig.height = 5, fig.width = 5, fig.align = "center"}
###################
ggplot(env[env$qPCR>0,], aes(x= log(qPCR), y = Fungi.pct, color = Habitat)) +
geom_point()+geom_smooth()+
labs(x="Community size: Log (fungal 18S qPCR)", y = "Community size: fungal ITS2 amplicon %")+
scale_color_manual(values=c("black","red", "blue"))+
theme_bw()+
guides(color=FALSE)+
theme(legend.title = element_text(colour="black", size=15, face="bold"),
legend.text = element_text(colour="black", size=15, face="bold"),
axis.text=element_text(size=10,face="bold",angle = 90),
axis.title=element_text(size=15,face="bold"))
cor.test(log(env[env$qPCR>0,]$qPCR), env[env$qPCR>0,]$Fungi.pct)
#####
ggplot(env.Tra, aes(x= log(transcrib.pct), y = Fungi.pct.x, color = Habitat)) +
geom_point()+geom_smooth()+
labs( x = "Community size: Log(fungal transcription %)",y="Community size: fungal ITS2 amplicon %")+
scale_color_manual(values=c("black","red", "blue"))+
theme_bw()+
guides(color=FALSE)+
theme(strip.text = element_text(size = 15,face="bold"),
panel.spacing = unit(0, "lines"),
legend.title = element_text(colour="black", size=15, face="bold"),
legend.text = element_text(colour="black", size=15, face="bold"),
axis.text=element_text(size=10,face="bold",angle = 90),
axis.title=element_text(size=15,face="bold"))
cor.test(log(env.Tra$transcrib.pct), env.Tra$Fungi.pct.x)
##########
ggplot(env.Tra[env.Tra$qPCR>0,], aes(x= log(transcrib.pct), y = qPCR, color = Habitat)) +
geom_point()+geom_smooth()+
labs(x = "Community size: Log(fungal transcription %)", y="Community size: Log(fungal 18S qPCR)")+
scale_color_manual(values=c("black","red", "blue"))+
theme_bw()+
guides(color=FALSE)+
theme(strip.text = element_text(size = 15,face="bold"),
panel.spacing = unit(0, "lines"),
legend.title = element_text(colour="black", size=15, face="bold"),
legend.text = element_text(colour="black", size=15, face="bold"),
axis.text=element_text(size=10,face="bold",angle = 90),
axis.title=element_text(size=15,face="bold"))
cor.test(log(env.Tra[env.Tra$qPCR>0,]$transcrib.pct), log(env.Tra[env.Tra$qPCR>0,]$qPCR))
```