-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphylo_figures.R
289 lines (200 loc) · 20.3 KB
/
phylo_figures.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
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
#Making phylo figures
library(ape)
library(phytools)
library(ggtree)
library(ggplot2)
library(cowplot)
#taxa<-read.csv("C:/Users/Brian/Google Drive/DNH_scale/L48_taxa.csv")
status<-read.csv("C:/Users/Brian/Google Drive/DNH_scale/status4.csv",stringsAsFactors = F)
status<-status[which(status$status != "NA"),]
#need figures of:
#(pruned) base trees (gbmb, gbotb)
#genus-only trees (gbmb,gbotb)
#genus+fam trees (gbmb,gbotb)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#base trees
#gbotb
gbotb_base <- read.tree("smith_and_brown_2018_trees/v0.1/v0.1/GBOTB.tre")
gbotb_base <- drop.tip(phy =gbotb_base,tip = setdiff(x = gbotb_base$tip.label,y = status$binomial))
#Get taxa
angios <- getMRCA(phy = gbotb_base, tip = intersect(x = status$binomial[which(status$Group=="Angiosperms")],y = gbotb_base$tip.label) )
gymnos <- getMRCA(phy = gbotb_base, tip = intersect(x = status$binomial[which(status$Group=="Gymnosperms")],y = gbotb_base$tip.label) )
#sort(table(status$Family),decreasing = T)[1:10]
asteraceae <- getMRCA(phy = gbotb_base, tip = intersect(x = status$binomial[which(status$Family=="Asteraceae")],y = gbotb_base$tip.label) )
fabaceae <- getMRCA(phy = gbotb_base, tip = intersect(x = status$binomial[which(status$Family=="Fabaceae")],y = gbotb_base$tip.label) )
poaceae <- getMRCA(phy = gbotb_base, tip = intersect(x = status$binomial[which(status$Family=="Poaceae")],y = gbotb_base$tip.label) )
cyperaceae <- getMRCA(phy = gbotb_base, tip = intersect(x = status$binomial[which(status$Family=="Cyperaceae")],y = gbotb_base$tip.label) )
scrophulariaceae <- getMRCA(phy = gbotb_base, tip = intersect(x = status$binomial[which(status$Family=="Scrophulariaceae")],y = gbotb_base$tip.label) )
l1 <- get_legend(ggtree(tr = gbotb_base,layout = "circular") %<+% status+geom_treescale(y = length(gbotb_base$tip.label)-1000,offset = 100,width = 100) +
geom_tippoint(aes(subset=status %in% c('I')), color='red', alpha=.8,position = ggplot2::position_nudge(x = 10))+
geom_tippoint(aes(subset=status %in% c('N')), color='blue', alpha=.5 )+
geom_cladelabel(node = angios, label="Angiosperms", offset = 20,barsize = 3,color="grey")+
geom_tippoint(aes(color=status),show.legend = T)+theme(legend.position = "right")+labs(color = "Native Status\n")+
scale_color_manual(labels = c("Native", "Non-native"), values = c("blue", "red")))
#plot(l1)
t1 <- ggtree(tr = gbotb_base,layout = "circular") %<+% status+geom_treescale(y = length(gbotb_base$tip.label)-1000,offset = 100,width = 100) +
geom_tippoint(aes(subset=status %in% c('I')), color='red', alpha=.8,size=2,position = ggplot2::position_nudge(x = 25))+
geom_tippoint(aes(subset=status %in% c('N')), color='blue', alpha=.5,size=2, position = ggplot2::position_nudge(x = 10) )+
geom_cladelabel(node = asteraceae, label="Asteraceae", offset = 35,angle = 90,offset.text = 50,barsize = 3,color="grey")+
geom_cladelabel(node = fabaceae, label="Fabaceae", offset = 35,angle = 90,offset.text = 50,barsize = 3,color="brown")+
geom_cladelabel(node = poaceae, label="Poaceae", offset = 35,angle = 90,offset.text = 50,barsize = 3,color="tan")+
geom_cladelabel(node = cyperaceae, label="Cyperaceae", offset = 35,angle = 90,offset.text = 50,barsize = 3,color="dark grey")+
geom_cladelabel(node = scrophulariaceae, label="Scrophulariaceae", offset = 35,angle = 0,offset.text = 50,barsize = 3,color="#CC6600")+
ggtitle(label = "GBOTB")
#plot(t1)
combined_gbotb_base <- ggdraw(t1) +
draw_plot(plot = l1,x = .8,y = .8,height = .2,width = .2)
combined_gbotb_base
ggsave(filename = "DNH_scale_GBOT_base.pdf",plot = combined_gbotb_base,device = "pdf",path = "C:/Users/Brian/Desktop/",width = 20,height = 20,units = "cm")
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#gbmb
gbmb_base <- read.tree("smith_and_brown_2018_trees/v0.1/v0.1/GBMB.tre")
gbmb_base <- drop.tip(phy =gbmb_base,tip = setdiff(x = gbmb_base$tip.label,y = status$binomial))
#Get taxa
angios <- getMRCA(phy = gbmb_base, tip = intersect(x = status$binomial[which(status$Group=="Angiosperms")],y = gbmb_base$tip.label) )
gymnos <- getMRCA(phy = gbmb_base, tip = intersect(x = status$binomial[which(status$Group=="Gymnosperms")],y = gbmb_base$tip.label) )
#sort(table(status$Family),decreasing = T)[1:3]
asteraceae <- getMRCA(phy = gbmb_base, tip = intersect(x = status$binomial[which(status$Family=="Asteraceae")],y = gbmb_base$tip.label) )
fabaceae <- getMRCA(phy = gbmb_base, tip = intersect(x = status$binomial[which(status$Family=="Fabaceae")],y = gbmb_base$tip.label) )
poaceae <- getMRCA(phy = gbmb_base, tip = intersect(x = status$binomial[which(status$Family=="Poaceae")],y = gbmb_base$tip.label) )
l1 <- get_legend(ggtree(tr = gbmb_base,layout = "circular") %<+% status+geom_treescale(y = length(gbmb_base$tip.label)-1000,offset = 100,width = 100) +
geom_tippoint(aes(subset=status %in% c('I')), color='red', alpha=.8,position = ggplot2::position_nudge(x = 10))+
geom_tippoint(aes(subset=status %in% c('N')), color='blue', alpha=.5 )+
geom_cladelabel(node = angios, label="Angiosperms", offset = 20,barsize = 3,color="grey")+
geom_tippoint(aes(color=status),show.legend = T)+theme(legend.position = "right")+labs(color = "Native Status\n")+
scale_color_manual(labels = c("Native", "Non-native"), values = c("blue", "red")))
#plot(l1)
t1 <- ggtree(tr = gbmb_base,layout = "circular") %<+% status+geom_treescale(y = length(gbmb_base$tip.label)-1000,offset = 100,width = 100) +
geom_tippoint(aes(subset=status %in% c('I')), color='red', alpha=.8,size=2,position = ggplot2::position_nudge(x = 25))+
geom_tippoint(aes(subset=status %in% c('N')), color='blue', alpha=.5,size=2, position = ggplot2::position_nudge(x = 10) )+
geom_cladelabel(node = asteraceae, label="Asteraceae", offset = 35,angle = 90,offset.text = 50,barsize = 3,color="grey")+
geom_cladelabel(node = fabaceae, label="Fabaceae", offset = 35,angle = 90,offset.text = 50,barsize = 3,color="brown")+
geom_cladelabel(node = poaceae, label="Poaceae", offset = 35,angle = 90,offset.text = 50,barsize = 3,color="tan")+ggtitle(label = "GBMB")
#plot(t1)
combined_gbmb_base <- ggdraw(t1) +
draw_plot(plot = l1,x = .8,y = .8,height = .2,width = .2)
combined_gbmb_base
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#gbmb_plus_congeners
gbmb_plus_congeners <- read.tree("sunplin_trees/genus_addition_only/gbmb_genus_additions_only/gbmb_genus_addition_only616.tre") #616 = my area code
gbmb_plus_congeners <- drop.tip(phy =gbmb_plus_congeners,tip = setdiff(x = gbmb_plus_congeners$tip.label,y = status$binomial))
#Get taxa
angios <- getMRCA(phy = gbmb_plus_congeners, tip = intersect(x = status$binomial[which(status$Group=="Angiosperms")],y = gbmb_plus_congeners$tip.label) )
gymnos <- getMRCA(phy = gbmb_plus_congeners, tip = intersect(x = status$binomial[which(status$Group=="Gymnosperms")],y = gbmb_plus_congeners$tip.label) )
#sort(table(status$Family),decreasing = T)[1:3]
asteraceae <- getMRCA(phy = gbmb_plus_congeners, tip = intersect(x = status$binomial[which(status$Family=="Asteraceae")],y = gbmb_plus_congeners$tip.label) )
fabaceae <- getMRCA(phy = gbmb_plus_congeners, tip = intersect(x = status$binomial[which(status$Family=="Fabaceae")],y = gbmb_plus_congeners$tip.label) )
poaceae <- getMRCA(phy = gbmb_plus_congeners, tip = intersect(x = status$binomial[which(status$Family=="Poaceae")],y = gbmb_plus_congeners$tip.label) )
l1 <- get_legend(ggtree(tr = gbmb_plus_congeners,layout = "circular") %<+% status+geom_treescale(y = length(gbmb_plus_congeners$tip.label)-1000,offset = 100,width = 100) +
geom_tippoint(aes(subset=status %in% c('I')), color='red', alpha=.8,position = ggplot2::position_nudge(x = 10))+
geom_tippoint(aes(subset=status %in% c('N')), color='blue', alpha=.5 )+
geom_cladelabel(node = angios, label="Angiosperms", offset = 20,barsize = 3,color="grey")+
geom_tippoint(aes(color=status),show.legend = T)+theme(legend.position = "right")+labs(color = "Native Status\n")+
scale_color_manual(labels = c("Native", "Non-native"), values = c("blue", "red")))
#plot(l1)
t1 <- ggtree(tr = gbmb_plus_congeners,layout = "circular") %<+% status+geom_treescale(y = length(gbmb_plus_congeners$tip.label)-1000,offset = 100,width = 100) +
geom_tippoint(aes(subset=status %in% c('I')), color='red', alpha=.8,size=2,position = ggplot2::position_nudge(x = 25))+
geom_tippoint(aes(subset=status %in% c('N')), color='blue', alpha=.5,size=2, position = ggplot2::position_nudge(x = 10) )+
geom_cladelabel(node = asteraceae, label="Asteraceae", offset = 35,angle = 90,offset.text = 50,barsize = 3,color="grey")+
geom_cladelabel(node = fabaceae, label="Fabaceae", offset = 35,angle = 90,offset.text = 50,barsize = 3,color="brown")+
geom_cladelabel(node = poaceae, label="Poaceae", offset = 35,angle = 90,offset.text = 50,barsize = 3,color="tan")+ggtitle(label = "GBMB plus congeners")
#plot(t1)
combined_gbmb_plus_congeners <- ggdraw(t1) +
draw_plot(plot = l1,x = .8,y = .8,height = .2,width = .2)
combined_gbmb_plus_congeners
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#gbotb_plus_congeners
gbotb_plus_congeners <- read.tree("sunplin_trees/genus_addition_only/gbotb_genus_additions_only/gbotb_genus_addition_only616.tre") #616 = my area code
gbotb_plus_congeners <- drop.tip(phy =gbotb_plus_congeners,tip = setdiff(x = gbotb_plus_congeners$tip.label,y = status$binomial))
#Get taxa
angios <- getMRCA(phy = gbotb_plus_congeners, tip = intersect(x = status$binomial[which(status$Group=="Angiosperms")],y = gbotb_plus_congeners$tip.label) )
gymnos <- getMRCA(phy = gbotb_plus_congeners, tip = intersect(x = status$binomial[which(status$Group=="Gymnosperms")],y = gbotb_plus_congeners$tip.label) )
#sort(table(status$Family),decreasing = T)[1:3]
asteraceae <- getMRCA(phy = gbotb_plus_congeners, tip = intersect(x = status$binomial[which(status$Family=="Asteraceae")],y = gbotb_plus_congeners$tip.label) )
fabaceae <- getMRCA(phy = gbotb_plus_congeners, tip = intersect(x = status$binomial[which(status$Family=="Fabaceae")],y = gbotb_plus_congeners$tip.label) )
poaceae <- getMRCA(phy = gbotb_plus_congeners, tip = intersect(x = status$binomial[which(status$Family=="Poaceae")],y = gbotb_plus_congeners$tip.label) )
cyperaceae <- getMRCA(phy = gbotb_plus_congeners, tip = intersect(x = status$binomial[which(status$Family=="Cyperaceae")],y = gbotb_plus_congeners$tip.label) )
scrophulariaceae <- getMRCA(phy = gbotb_plus_congeners, tip = intersect(x = status$binomial[which(status$Family=="Scrophulariaceae")],y = gbotb_plus_congeners$tip.label) )
l1 <- get_legend(ggtree(tr = gbotb_plus_congeners,layout = "circular") %<+% status+geom_treescale(y = length(gbotb_plus_congeners$tip.label)-1000,offset = 100,width = 100) +
geom_tippoint(aes(subset=status %in% c('I')), color='red', alpha=.8,position = ggplot2::position_nudge(x = 10))+
geom_tippoint(aes(subset=status %in% c('N')), color='blue', alpha=.5 )+
geom_cladelabel(node = angios, label="Angiosperms", offset = 20,barsize = 3,color="grey")+
geom_tippoint(aes(color=status),show.legend = T)+theme(legend.position = "right")+labs(color = "Native Status\n")+
scale_color_manual(labels = c("Native", "Non-native"), values = c("blue", "red")))
#plot(l1)
t1 <- ggtree(tr = gbotb_plus_congeners,layout = "circular") %<+% status+geom_treescale(y = length(gbotb_plus_congeners$tip.label)-1000,offset = 100,width = 100) +
geom_tippoint(aes(subset=status %in% c('I')), color='red', alpha=.8,size=2,position = ggplot2::position_nudge(x = 25))+
geom_tippoint(aes(subset=status %in% c('N')), color='blue', alpha=.5,size=2, position = ggplot2::position_nudge(x = 10) )+
geom_cladelabel(node = asteraceae, label="Asteraceae", offset = 35,angle = 90,offset.text = 50,barsize = 3,color="grey")+
geom_cladelabel(node = fabaceae, label="Fabaceae", offset = 35,angle = 90,offset.text = 50,barsize = 3,color="brown")+
geom_cladelabel(node = poaceae, label="Poaceae", offset = 35,angle = 90,offset.text = 50,barsize = 3,color="tan")+
geom_cladelabel(node = cyperaceae, label="Cyperaceae", offset = 35,angle = 90,offset.text = 50,barsize = 3,color="dark grey")+
geom_cladelabel(node = scrophulariaceae, label="Scrophulariaceae", offset = 35,angle = 0,offset.text = 50,barsize = 3,color="#CC6600")+
ggtitle(label = "GBOTB plus congeners")
#plot(t1)
combined_gbotb_plus_congeners <- ggdraw(t1) +
draw_plot(plot = l1,x = .8,y = .8,height = .2,width = .2)
combined_gbotb_plus_congeners
ggsave(filename = "DNH_scale_GBOTB_plus_congeners.pdf",plot = combined_gbotb_plus_congeners,device = "pdf",path = "C:/Users/Brian/Desktop/",width = 20,height = 20,units = "cm")
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#gbmb_plus_congeners_and_confamilials
gbmb_plus_congeners_and_confamilials <- read.tree("sunplin_trees/genus_and_family_additions/gbmb_genus_and_family_additions/gbmb_and_family_additions616.tre") #616 = my area code
gbmb_plus_congeners_and_confamilials <- drop.tip(phy =gbmb_plus_congeners_and_confamilials,tip = setdiff(x = gbmb_plus_congeners_and_confamilials$tip.label,y = status$binomial))
#Get taxa
angios <- getMRCA(phy = gbmb_plus_congeners_and_confamilials, tip = intersect(x = status$binomial[which(status$Group=="Angiosperms")],y = gbmb_plus_congeners_and_confamilials$tip.label) )
gymnos <- getMRCA(phy = gbmb_plus_congeners_and_confamilials, tip = intersect(x = status$binomial[which(status$Group=="Gymnosperms")],y = gbmb_plus_congeners_and_confamilials$tip.label) )
#sort(table(status$Family),decreasing = T)[1:3]
asteraceae <- getMRCA(phy = gbmb_plus_congeners_and_confamilials, tip = intersect(x = status$binomial[which(status$Family=="Asteraceae")],y = gbmb_plus_congeners_and_confamilials$tip.label) )
fabaceae <- getMRCA(phy = gbmb_plus_congeners_and_confamilials, tip = intersect(x = status$binomial[which(status$Family=="Fabaceae")],y = gbmb_plus_congeners_and_confamilials$tip.label) )
poaceae <- getMRCA(phy = gbmb_plus_congeners_and_confamilials, tip = intersect(x = status$binomial[which(status$Family=="Poaceae")],y = gbmb_plus_congeners_and_confamilials$tip.label) )
l1 <- get_legend(ggtree(tr = gbmb_plus_congeners_and_confamilials,layout = "circular") %<+% status+geom_treescale(y = length(gbmb_plus_congeners_and_confamilials$tip.label)-1000,offset = 100,width = 100) +
geom_tippoint(aes(subset=status %in% c('I')), color='red', alpha=.8,position = ggplot2::position_nudge(x = 10))+
geom_tippoint(aes(subset=status %in% c('N')), color='blue', alpha=.5 )+
geom_cladelabel(node = angios, label="Angiosperms", offset = 20,barsize = 3,color="grey")+
geom_tippoint(aes(color=status),show.legend = T)+theme(legend.position = "right")+labs(color = "Native Status\n")+
scale_color_manual(labels = c("Native", "Non-native"), values = c("blue", "red")))
#plot(l1)
t1 <- ggtree(tr = gbmb_plus_congeners_and_confamilials,layout = "circular") %<+% status+geom_treescale(y = length(gbmb_plus_congeners_and_confamilials$tip.label)-1000,offset = 100,width = 100) +
geom_tippoint(aes(subset=status %in% c('I')), color='red', alpha=.8,size=2,position = ggplot2::position_nudge(x = 25))+
geom_tippoint(aes(subset=status %in% c('N')), color='blue', alpha=.5,size=2, position = ggplot2::position_nudge(x = 10) )+
geom_cladelabel(node = asteraceae, label="Asteraceae", offset = 35,angle = 90,offset.text = 50,barsize = 3,color="grey")+
geom_cladelabel(node = fabaceae, label="Fabaceae", offset = 35,angle = 90,offset.text = 50,barsize = 3,color="brown")+
geom_cladelabel(node = poaceae, label="Poaceae", offset = 35,angle = 90,offset.text = 50,barsize = 3,color="tan")+ggtitle(label = "GBMB plus congeners and confamilials")
#plot(t1)
combined_gbmb_plus_congeners_and_confamilials <- ggdraw(t1) +
draw_plot(plot = l1,x = .8,y = .8,height = .2,width = .2)
combined_gbmb_plus_congeners_and_confamilials
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#gbotb_plus_congeners_and_confamilials
gbotb_plus_congeners_and_confamilials <- read.tree("sunplin_trees/genus_and_family_additions/gbotb_genus_and_family_additions/gbotb_genus_and_family_additions616.tre") #616 = my area code
gbotb_plus_congeners_and_confamilials <- drop.tip(phy =gbotb_plus_congeners_and_confamilials,tip = setdiff(x = gbotb_plus_congeners_and_confamilials$tip.label,y = status$binomial))
#Get taxa
angios <- getMRCA(phy = gbotb_plus_congeners_and_confamilials, tip = intersect(x = status$binomial[which(status$Group=="Angiosperms")],y = gbotb_plus_congeners_and_confamilials$tip.label) )
gymnos <- getMRCA(phy = gbotb_plus_congeners_and_confamilials, tip = intersect(x = status$binomial[which(status$Group=="Gymnosperms")],y = gbotb_plus_congeners_and_confamilials$tip.label) )
#sort(table(status$Family),decreasing = T)[1:3]
asteraceae <- getMRCA(phy = gbotb_plus_congeners_and_confamilials, tip = intersect(x = status$binomial[which(status$Family=="Asteraceae")],y = gbotb_plus_congeners_and_confamilials$tip.label) )
fabaceae <- getMRCA(phy = gbotb_plus_congeners_and_confamilials, tip = intersect(x = status$binomial[which(status$Family=="Fabaceae")],y = gbotb_plus_congeners_and_confamilials$tip.label) )
poaceae <- getMRCA(phy = gbotb_plus_congeners_and_confamilials, tip = intersect(x = status$binomial[which(status$Family=="Poaceae")],y = gbotb_plus_congeners_and_confamilials$tip.label) )
cyperaceae <- getMRCA(phy = gbotb_plus_congeners_and_confamilials, tip = intersect(x = status$binomial[which(status$Family=="Cyperaceae")],y = gbotb_plus_congeners_and_confamilials$tip.label) )
scrophulariaceae <- getMRCA(phy = gbotb_plus_congeners_and_confamilials, tip = intersect(x = status$binomial[which(status$Family=="Scrophulariaceae")],y = gbotb_plus_congeners_and_confamilials$tip.label) )
l1 <- get_legend(ggtree(tr = gbotb_plus_congeners_and_confamilials,layout = "circular") %<+% status+geom_treescale(y = length(gbotb_plus_congeners_and_confamilials$tip.label)-1000,offset = 100,width = 100) +
geom_tippoint(aes(subset=status %in% c('I')), color='red', alpha=.8,position = ggplot2::position_nudge(x = 10))+
geom_tippoint(aes(subset=status %in% c('N')), color='blue', alpha=.5 )+
geom_cladelabel(node = angios, label="Angiosperms", offset = 20,barsize = 3,color="grey")+
geom_tippoint(aes(color=status),show.legend = T)+theme(legend.position = "right")+labs(color = "Native Status\n")+
scale_color_manual(labels = c("Native", "Non-native"), values = c("blue", "red")))
#plot(l1)
t1 <- ggtree(tr = gbotb_plus_congeners_and_confamilials,layout = "circular") %<+% status+geom_treescale(y = length(gbotb_plus_congeners_and_confamilials$tip.label)-1000,offset = 100,width = 100) +
geom_tippoint(aes(subset=status %in% c('I')), color='red', alpha=.8,size=2,position = ggplot2::position_nudge(x = 25))+
geom_tippoint(aes(subset=status %in% c('N')), color='blue', alpha=.5,size=2, position = ggplot2::position_nudge(x = 10) )+
geom_cladelabel(node = asteraceae, label="Asteraceae", offset = 35,angle = 90,offset.text = 50,barsize = 3,color="grey")+
geom_cladelabel(node = fabaceae, label="Fabaceae", offset = 35,angle = 90,offset.text = 50,barsize = 3,color="brown")+
geom_cladelabel(node = poaceae, label="Poaceae", offset = 35,angle = 90,offset.text = 50,barsize = 3,color="tan")+
geom_cladelabel(node = cyperaceae, label="Cyperaceae", offset = 35,angle = 90,offset.text = 50,barsize = 3,color="dark grey")+
geom_cladelabel(node = scrophulariaceae, label="Scrophulariaceae", offset = 35,angle = 0,offset.text = 50,barsize = 3,color="#CC6600")+
ggtitle(label = "GBOTB plus congeners and confamilials")
#plot(t1)
combined_gbotb_plus_congeners_and_confamilials <- ggdraw(t1) +
draw_plot(plot = l1,x = .8,y = .8,height = .2,width = .2)
combined_gbotb_plus_congeners_and_confamilials
ggsave(filename = "DNH_scale_GBOTB_plus_congeners_and_confamilials.pdf",plot = combined_gbotb_plus_congeners_and_confamilials,device = "pdf",path = "C:/Users/Brian/Desktop/",width = 20,height = 20,units = "cm")