Skip to content

Commit

Permalink
Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Chaillet committed May 4, 2022
1 parent 2fa9b7a commit 3127898
Showing 1 changed file with 47 additions and 8 deletions.
55 changes: 47 additions & 8 deletions batchRuns/analyze_codes.r
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ library(cowplot)
library(dplyr)
#oneLR<-read.csv("v4_param_results.csv")
#oneLR<-read.csv("v5_param_results.csv")
oneLR<- read.csv("ParamListGen_results(8).csv")
oneLR<- read.csv("ParamListGen-1_results.csv")
straRef<-data.frame(nstrains=ceiling(10^(seq(0.7,2.3,0.15))),rawStrains = 10^(seq(0.7,2.3,0.15)))
oneLR<-oneLR%>%left_join(straRef,by="nstrains")
oneLR<-oneLR%>%mutate(resistP = PR/P,
Expand Down Expand Up @@ -42,16 +42,16 @@ ggplot(oneLR%>%filter(wildOnly==0,d1>0), aes(log10(adjB),log10(rawStrains)))+
geom_raster(aes(fill=resistP))+scale_fill_viridis_c()+
facet_wrap(d1~seasonality, labeller="label_both")

ggplot(oneLR%>%filter(wildOnly==0,d1>0), aes(log10(adjB),red))+
ggplot(oneLR%>%filter(wildOnly==0,d1>0,cloneCost==0.1), aes(log10(adjB),red))+
geom_raster(aes(fill=resistP))+scale_fill_viridis_c()+
facet_wrap(d1~seasonality, labeller="label_both")

ggplot(oneLR%>%filter(wildOnly==0,d1>0.5,cloneCost==0.1), aes(log10(adjB),resistP))+geom_point()+geom_line(aes(color=as.factor(red)))#+facet_wrap(d1~cloneCost, labeller="label_both")

# host populations
ggplot(oneLR%>%filter(wildOnly==0,d1>0), aes(log10(adjB),log10(rawStrains)))+
geom_raster(aes(fill=N))+scale_fill_viridis_c()+
facet_wrap(d1~seasonality~, labeller="label_both")
ggplot(oneLR%>%filter(wildOnly==0,d1>0,prev>0), aes(log10(adjB),red))+
geom_raster(aes(fill=resistP))+scale_fill_viridis_c()+
facet_wrap(d1~cloneCost, labeller="label_both")

ggplot(oneLR%>%filter(wildOnly==0,d1>0), aes(log10(adjB),N)) + geom_point() + geom_line(aes(color=as.factor(log10(rawStrains))))

Expand Down Expand Up @@ -91,15 +91,15 @@ ggplot(oneLR%>%drop_na()%>%filter(wildOnly==0,d1>0), aes(log10(adjB*adjPrev*365)
ylab("percentage of resistance")+facet_grid(d1~seasonality,labeller="label_both")+
theme_cowplot()

ggplot(oneLR%>%filter(wildOnly==0,d1>0.5), aes(adjB*adjPrev*365,resistP))+
ggplot(oneLR%>%filter(wildOnly==0,d1>0.5,cloneCost==0.1), aes(adjB*adjPrev*365,resistP))+
geom_point(aes(color=red))+
scale_color_viridis_c(option="turbo")+xlab("log10(EIR per year)")+
ylab("percentage of resistance")+facet_grid(d1~seasonality,labeller="label_both")+
theme_cowplot()


# AU prevalence vs resistance
ggplot(oneLR%>%filter(wildOnly==0,d1>0),aes(I_AU,resistP))+
ggplot(oneLR%>%filter(wildOnly==0,d1>0,cloneCost==0.1),aes(I_AU,resistP))+
geom_point(aes(color=log10(nstrains/adjB),shape=as.factor(seasonality)))+scale_color_viridis_c(option="plasma")+xlab("Prevalance in Asymptomatic")+ylab("percentage of resistance")+
facet_grid(d1~.,labeller="label_both")+
theme_cowplot()+
Expand Down Expand Up @@ -143,7 +143,46 @@ ggplot(oneLR%>%filter(wildOnly==0,d1>0.5,cloneCost==0.1),aes(adjPrev,resistP))+
facet_grid(d1~.,labeller="label_both")+
theme_cowplot()+
geom_smooth()



ggplot(oneLR%>%filter(wildOnly==0,d1>0),aes(adjPrev,resistP))+
geom_line(aes(color=as.factor(adjB)))+scale_color_viridis_d(option="plasma")+
xlab("Prevalance")+ylab("percentage of resistance")+
facet_grid(d1~cloneCost,labeller="label_both")+
theme_cowplot()

ggplot(oneLR%>%filter(wildOnly==0,d1>0,adjB>=0.1,adjPrev>0,red>0),aes(I_AU,resistP))+
geom_point(aes(color=red))+scale_color_viridis_c(option="plasma")+
xlab("Prevalance")+ylab("percentage of resistance")+
facet_grid(d1~cloneCost,labeller="label_both")+
theme_cowplot()

ggplot(oneLR%>%filter(wildOnly==0,d1>0,adjPrev>0,red>0),aes(1/muWU*exp(-red*P_acc_S/(SU+SD)),resistP))+
geom_point(aes(color=red))+scale_color_viridis_c(option="plasma")+
ylab("percentage of resistance")+
facet_grid(d1~cloneCost,labeller="label_both")+
theme_cowplot()

oneLR<-oneLR%>%mutate(clearN = 1/(1/muWU*exp(-red*P_acc_N/(NU+ND))+1),
clearS = 1/(1/muWU*exp(-red*P_acc_S/(SU+SD))+1),
clearA = 1/(1/muWU*exp(-red*P_acc_A/(AU+AD))+1),
sympt = ((PW_NU)*(1-exp(-1/8/clearN))+(PW_SU)*(1-exp(-1/8/clearS))+
(PW_AU)*(1-exp(-1/8/clearA))),
aSympt = ((PW_NU)*exp(-1/8/clearN))/clearN+
((PW_SU)*exp(-1/8/clearS))/clearS+
((PW_AU)*exp(-1/8/clearA))/clearA,
noDrug = PW_NU/clearN+PW_SU/clearS+PW_AU/clearA,
symptRatio = (sympt+aSympt)/noDrug)



ggplot(oneLR%>%filter(wildOnly==0,d1>0,adjPrev>0,red>0),aes(symptRatio,resistP))+
geom_point(aes(color=red))+scale_color_viridis_c(option="plasma")+
ylab("percentage of resistance")+
facet_grid(d1~cloneCost,labeller="label_both")+
theme_cowplot()


ggplot(oneLR%>%filter(wildOnly==0,d1>0.5,cloneCost==0.1,red!=0),aes(log10(adjB),adjPrev))+geom_point()+geom_line(aes(color=as.factor(red)))


Expand Down

0 comments on commit 3127898

Please sign in to comment.