#Loading required packages library(picante) library(ggtree) library(ggplot2) library(flextable) #Loading required data KcalcTable_Nature <- read.csv("Kcalc_Table.csv", row.names=1) Naturenames<- read.tree("Species_Names.nwk") KcalcTable_Nature #Setting tip label Naturenames$tip.label set.seed(2032021) #Performign the Kcalc analysis on infection prevalence for the 10^6 treatment InfectionPrev = KcalcTable_Nature$X.Infection names(InfectionPrev) = KcalcTable_Nature$SpeciesNames InfectionPrev #The following line calculates the Blomberg's K Kcalc(InfectionPrev[Naturenames$tip.label], Naturenames) #This line compares our observed K value to a randomly generate K value and determines whether # there is a phylogenetic signal phylosignal(InfectionPrev[Naturenames$tip.label],Naturenames,reps=1000) #Performing the Kcalc analysis on % mortality for the 10^6 treatment PrevMort = KcalcTable_Nature$X..Mortality names(PrevMort) = KcalcTable_Nature$SpeciesNames PrevMort #The following line calculates the Blomberg's K Kcalc(PrevMort[Naturenames$tip.label], Naturenames) #This line compares our observed K value to a randomly generate K value and determines whether # there is a phylogenetic signa phylosignal(PrevMort[Naturenames$tip.label],Naturenames,reps=1000) #####Takeaway--> Infection prevalence and percentage mortality are phylogenetically related AbreviatedNames<-KcalcTable_Nature$AbrevSpecies d2<-data.frame(label=Naturenames$tip.label,Infection=InfectionPrev,Mortality=PrevMort,AbrevNames=AbreviatedNames) d2 #Circular graph with Mortality prevalence NatureFigureMortality<-ggtree(Naturenames,layout="circular") NatureFigureMortality<-NatureFigureMortality%<+%d2+ geom_hilight(node=59, fill="chartreuse2",alpha=0.2,extend=-10)+ geom_hilight(node=56, fill="red",alpha=0.2,extend=-10)+ geom_hilight(node=71, fill="orange",alpha=0.2,extend=-10)+ geom_hilight(node=70, fill="dodgerblue",alpha=0.2,extend=-10)+ geom_hilight(node=63, fill="gray71",alpha=0.2,extend=-10)+ geom_hilight(node=42, fill="darkgreen",alpha=0.2,extend=-10)+ geom_hilight(node=66, fill="aquamarine2",alpha=0.2,extend=-10)+ geom_hilight(node=16, fill="purple",alpha=0.2,extend=-10)+ geom_hilight(node=1, fill="deeppink4",alpha=0.2,extend=-10)+ geom_hilight(node=28, fill="navyblue",alpha=0.2,extend=-10)+geom_tiplab(aes(label=(AbrevNames)),size=2.8,fontface="bold.italic",hjust=0.024,offset=9)+ geom_tippoint(aes(size=Mortality),alpha=0.65)+theme(legend.position="right")+labs(size="% Mortality") NatureFigureMortality