-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAnalyze Tie1F2.Rmd
185 lines (154 loc) · 4.44 KB
/
Analyze Tie1F2.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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
## Tie1 F2s
Quick analysis to determine if we should look at more F2s to distinguigh between GA2ox and the Alpha Glucosidase as causative for tie-1 phenotype
Get the data and take a quick look
```{r}
tie1 <- read.csv("tie.F2s.csv",na.strings=c("NA","-"))
summary(tie1)
head(tie1)
tie1$gt <- paste("GA2ox",tie1$GA2,"_AG.2",tie1$AG,sep="")
tie1$height <- tie1$epi + tie1$int1 + tie1$int2
tie1$int.total <- tie1$int1 + tie1$int2
```
Remove unused columns
```{r}
tie1.small <- tie1[,!grepl("X",colnames(tie1))]
#tie1.small <- tie1.small[tie1.small$first.leaf=="1",] #remove wierd plants where there are 2 leave at first node.
head(tie1.small)
```
melt
```{r}
library(reshape2)
tie1.melt <- melt(tie1.small,id.vars = c("plant","GA2","AG","gt","flat","first.leaf"),variable.name="organ")
head(tie1.melt)
```
plot it
```{r}
library(ggplot2)
pl <- ggplot(na.omit(tie1.melt),aes(x=gt,y=value))
pl <- pl + geom_boxplot()
pl <- pl + facet_wrap( ~ organ)
pl <- pl + theme(axis.text.x = element_text(angle=90, vjust=0.5))
pl + geom_point()
```
## test it for epicotyl
### GA2oxidase only
```{r}
lm1 <- lm(epi ~ GA2,data=tie1)
summary(lm1)
```
Very strong effect and we can see the het effect also.
### Alpha-glucosidase only
```{r}
lm2 <- lm(epi ~ AG,data=tie1)
summary(lm2)
```
Yes there is an effect here but probably due to linkage with GA2ox. Test via additive model.
### Additive model
```{r}
lm3 <- lm(epi ~ GA2 + AG,data=tie1)
summary(lm3)
```
This confirms that when both loci are in the model that only GA2 genotype matters
### interaction model
To test whether or not there is some wierd interaction between loci
```{r}
lm4 <- lm(epi ~ GA2*AG,data=tie1)
summary(lm4)
```
Still no evidence for alpha-glucosidase playing a role.
### an alternative
Predict on two-locus genotype
```{r}
lm5 <- lm(epi ~ gt,data=na.omit(tie1))
summary(lm5)
```
## test for total height
### GA2oxidase only
```{r}
lm1 <- lm(height ~ GA2,data=tie1)
summary(lm1)
```
Very strong effect and we can see het effect also.
### Alpha-glucosidase only
```{r}
lm2 <- lm(height ~ AG,data=tie1)
summary(lm2)
```
Yes there is an effect here but probably due to linkage with GA2ox. Test via additive model.
### Additive model
```{r}
lm3 <- lm(height ~ GA2 + AG,data=tie1)
summary(lm3)
```
This confirms that when both loci are in the model that only GA2 genotype matters
### interaction model
To test whether or not there is some wierd interaction between loci
```{r}
lm4 <- lm(height ~ GA2*AG,data=tie1)
summary(lm4)
```
### an alternative
Predicted on two-locus genotype
```{r}
lm5 <- lm(height ~ gt,data=na.omit(tie1))
summary(lm5)
```
## test for total internode
### GA2oxidase only
```{r}
lm1 <- lm(int.total ~ GA2,data=tie1)
summary(lm1)
```
Very strong effect and we can see het effect also.
### Alpha-glucosidase only
```{r}
lm2 <- lm(int.total ~ AG,data=tie1)
summary(lm2)
```
Yes there is an effect here but probably due to linkage with GA2ox. Test via additive model.
### Additive model
```{r}
lm3 <- lm(int.total ~ GA2 + AG,data=tie1)
summary(lm3)
```
This confirms that when both loci are in the model that only GA2 genotype matters
### interaction model
To test whether or not there is some wierd interaction between loci
```{r}
lm4 <- lm(int.total ~ GA2*AG,data=tie1)
summary(lm4)
```
This argues that the alpha-glucosidase being het instead of Heinz decreases height in the presence of GA
### an alternative
Predicted on two-locus genotype
```{r}
lm5 <- lm(int.total ~ gt,data=na.omit(tie1))
summary(lm5)
```
### make a figure
```{r}
#make a function for summarizing
mean.sem <- function(x,na.rm=TRUE) {
if(na.rm) x <- na.omit(x)
mean.x <- mean(x)
sem.x <- sd(x)/sqrt(length(x))
data.frame(
y=mean.x,
ymin=mean.x-sem.x,
ymax=mean.x+sem.x)
}
#plot AG conditioned on GA2
pl <- ggplot(data=na.omit(tie1),aes(x=AG,y=int.total))
pl <- pl + geom_bar(stat="summary",fun.data="mean.sem",fill="skyblue")
pl <- pl + geom_errorbar(stat="summary",fun.data="mean.sem",width=0.5)
pl <- pl + facet_wrap( ~ GA2,nrow=1)
pl + ylab("Total Internode Length") + xlab("Alpha-glucosidase Genotype")
ggsave("AG2_total_internode.pdf",height=6,width=6)
#plot GA2 conditions on AG
pl <- ggplot(data=na.omit(tie1),aes(x=GA2,y=int.total))
pl <- pl + geom_bar(stat="summary",fun.data="mean.sem",fill="seagreen")
pl <- pl + geom_errorbar(stat="summary",fun.data="mean.sem",width=0.5)
pl <- pl + facet_wrap( ~ AG,nrow=1)
pl + ylab("Total Internode Length") + xlab("GA2 Oxidase 7/8 Genotype")
ggsave("GA2_total_internode.pdf",height=6,width=6)
```