-
Notifications
You must be signed in to change notification settings - Fork 0
/
EC50-DotPlots.R
106 lines (93 loc) · 4.96 KB
/
EC50-DotPlots.R
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
#setwd("~/Documents/people/sajeewa amaradasa/sublethal paper/sublethalstressmanuscript")
#EC50 <- read.csv("~/Documents/people/sajeewa amaradasa/sublethal paper/sublethalstressmanuscript/EC50.csv")
EC2 <- read.csv("EC50V2.csv")
dotchart(EC2$Fold_Exp1[as.logical(match(EC2$Fungicide, "Boscalid", nomatch = F))], labels=EC2$IsolateID[as.logical(match(EC2$Fungicide, "Boscalid"))])
bos_1 <- EC2$Fold_Exp1[as.logical(match(EC2$Fungicide, "Boscalid", nomatch = F))]
bos_2 <- EC2$Fold_Exp2[as.logical(match(EC2$Fungicide, "Boscalid", nomatch = F))]
az_1 <- EC2$Fold_Exp1[as.logical(match(EC2$Fungicide, "Azoxystrobin", nomatch = F))]
az_2 <- EC2$Fold_Exp2[as.logical(match(EC2$Fungicide, "Azoxystrobin", nomatch = F))]
ip_1 <- EC2$Fold_Exp1[as.logical(match(EC2$Fungicide, "Iprodione", nomatch = F))]
ip_2 <- EC2$Fold_Exp2[as.logical(match(EC2$Fungicide, "Iprodione", nomatch = F))]
py_1 <- EC2$Fold_Exp1[as.logical(match(EC2$Fungicide, "Pyraclostrobin", nomatch = F))]
py_2 <- EC2$Fold_Exp2[as.logical(match(EC2$Fungicide, "Pyraclostrobin", nomatch = F))]
tm_1 <- EC2$Fold_Exp1[as.logical(match(EC2$Fungicide, "ThiophanateMethyl", nomatch = F))]
tm_2 <- EC2$Fold_Exp2[as.logical(match(EC2$Fungicide, "ThiophanateMethyl", nomatch = F))]
bs1 <- EC2$sig[as.logical(match(EC2$Fungicide, "Boscalid", nomatch = F))]
bs2 <- EC2$sig.1[as.logical(match(EC2$Fungicide, "Boscalid", nomatch = F))]
as1 <- EC2$sig[as.logical(match(EC2$Fungicide, "Azoxystrobin", nomatch = F))]
as2 <- EC2$sig.1[as.logical(match(EC2$Fungicide, "Azoxystrobin", nomatch = F))]
is1 <- EC2$sig[as.logical(match(EC2$Fungicide, "Iprodione", nomatch = F))]
is2 <- EC2$sig.1[as.logical(match(EC2$Fungicide, "Iprodione", nomatch = F))]
ps1 <- EC2$sig[as.logical(match(EC2$Fungicide, "Pyraclostrobin", nomatch = F))]
ps2 <- EC2$sig.1[as.logical(match(EC2$Fungicide, "Pyraclostrobin", nomatch = F))]
ts1 <- EC2$sig[as.logical(match(EC2$Fungicide, "ThiophanateMethyl", nomatch = F))]
ts2 <- EC2$sig.1[as.logical(match(EC2$Fungicide, "ThiophanateMethyl", nomatch = F))]
b1 <- as.logical(match(bs1, "n", nomatch=F))
b1[is.na(bs1)] <- NA
b2 <- as.logical(match(bs2, "n", nomatch=F))
b2[is.na(bs2)] <- NA
a1 <- as.logical(match(as1, "n", nomatch=F))
a1[is.na(as1)] <- NA
a2 <- as.logical(match(as2, "n", nomatch=F))
a2[is.na(as2)] <- NA
i1 <- as.logical(match(is1, "n", nomatch=F))
i1[is.na(is1)] <- NA
i2 <- as.logical(match(is2, "n", nomatch=F))
i2[is.na(is2)] <- NA
p1 <- as.logical(match(ps1, "n", nomatch=F))
p1[is.na(ps1)] <- NA
p2 <- as.logical(match(ps2, "n", nomatch=F))
p2[is.na(ps2)] <- NA
t1 <- as.logical(match(ts1, "n", nomatch=F))
t1[is.na(ts1)] <- NA
t2 <- as.logical(match(ts2, "n", nomatch=F))
t2[is.na(ts2)] <- NA
#bavg <- mean(c(bos_1,bos_2), na.rm=T) #5
#aavg <- mean(c(az_1,az_2), na.rm=T) #3
#iavg <- mean(c(ip_1,ip_2), na.rm=T) #2
#pavg <- mean(c(py_1,py_2), na.rm=T) #1
#tavg <- mean(c(tm_1,tm_2), na.rm=T) #4
#avg <- bavg
#avg <- append(bavg,c(aavg, iavg, pavg, tavg))
#set.seed(1)
##Don't print the axes labels
par(ann=FALSE)
##Plot first set of data.
##Need to check for sensible ranges
##Use the jitter function to spread data out.
plot(jitter(rep(0,9),amount=0.2), py_1, pch=21, bg=!p1, col=1,
xlim=range(-0.5,9.5), ylim=range(-1,3.2),
axes=FALSE,frame.plot=TRUE)
points(jitter(rep(1,9), amount=0.2), py_2, pch=23, bg=!p2, col=1)
points(jitter(rep(2,9), amount=0.2), ip_1, pch=21, bg=!i1, col=1)
points(jitter(rep(3,9), amount=0.2), ip_2, pch=23, bg=!i2, col=1)
points(jitter(rep(4,9), amount=0.2), az_1, pch=21, bg=!a1, col=1)
points(jitter(rep(5,9), amount=0.2), az_2, pch=23, bg=!a2, col=1)
points(jitter(rep(6,9), amount=0.2), tm_1, pch=21, bg=!t1, col=1)
points(jitter(rep(7,9), amount=0.2), tm_2, pch=23, bg=!t2, col=1)
points(jitter(rep(8,9), amount=0.2), bos_1, pch=21, bg=!b1, col=1)
points(jitter(rep(9,9), amount=0.2), bos_2, pch=23, bg=!b2, col=1)
##Add in the y-axis
axis(2, seq(-1,3.1,by=0.5))
##Add in the x-axis labels
mtext("Pyraclostrobin", side = 1, at=0.5)
mtext("Iprodione", side = 1, at=2.5)
mtext("Azoxystrobin", side = 1, at=4.5)
mtext("Thio. Methyl", side = 1, at=6.5)
mtext("Boscalid", side = 1, at=8.5)
##Add in the means
segments(-0.25, mean(py_1, na.rm = T), 0.25, mean(py_1, na.rm = T))
segments(0.75, mean(py_2, na.rm = T), 1.25, mean(py_2, na.rm = T))
segments(1.75, mean(ip_1, na.rm = T), 2.25, mean(ip_1, na.rm = T))
segments(2.75, mean(ip_2, na.rm = T), 3.25, mean(ip_2, na.rm = T))
segments(3.75, mean(az_1, na.rm = T), 4.25, mean(az_1, na.rm = T))
segments(4.75, mean(az_2, na.rm = T), 5.25, mean(az_2, na.rm = T))
segments(5.75, mean(tm_1, na.rm = T), 6.25, mean(tm_1, na.rm = T))
segments(6.75, mean(tm_2, na.rm = T), 7.25, mean(tm_2, na.rm = T))
segments(7.75, mean(bos_1, na.rm = T), 8.25, mean(bos_1, na.rm = T))
segments(8.75, mean(bos_2, na.rm = T), 9.25, mean(bos_2, na.rm = T))
abline(h = 0, col = "gray60")
##Add in the legend
legend(0, 3.0, c("Experiment 1", "Experiment 2"), col=1, pch=c(21,23))
title(main = "Fold-change in EC-50 from G0 to G12")
############################# EOF ########################################