Skip to content

Commit

Permalink
Revision 1 R files
Browse files Browse the repository at this point in the history
  • Loading branch information
clcazer committed Jul 4, 2020
1 parent 6881870 commit 3cfd506
Show file tree
Hide file tree
Showing 17 changed files with 486 additions and 143 deletions.
2 changes: 1 addition & 1 deletion R Analysis/README - Tylosin Model R Analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ scripts:

"TYL sensitivity analysis.R": a sensitivity analysis of the TYL model outputs (from TYL no intervention scenario) to model parameters. Figure 5 saved to "figures/". Returns realized range of model parameters to "results/param_range.xlsx".


"TYL intervention vs CON intervention prop res cow_LG Pen.R": analyzing the proportion of resistant enterococci in cattle, comparing TYL intervention groups to CON intervention groups, in the model scenario with a large pen size (N=150 cattle). Also analyzes the concentration of TYL in the large intestine. Does not assess validation because the validation studies use a small pen size. Descriptive results are saved to "results/tyl intestine concentrations LGpen.txt", "results/TYL effect LGpen.txt". LG Pen versions of Figures 2 and 4 are created and saved to "figures/".

--------------------------------
$platform
Expand Down
Binary file modified R Analysis/figures/Fig 4 Prop_cow_res_interventions.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added R Analysis/figures/Fig LGPen3 tyl_conc.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified R Analysis/figures/Sup Fig 1 Prop_env_res_interventions.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified R Analysis/figures/Sup Fig 2 Ent_conc_env_interventions.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified R Analysis/figures/Sup Fig 3 INT_vs_NI_Prop_cow_res.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
131 changes: 131 additions & 0 deletions R Analysis/results/TYL effect LGpen.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
[1] "TYL_NI, median. Min, max over time and end of simulation"
[1] 0.0497
[1] 0.08
[1] 0.0786
[1] "TYL_NI, 5th percentile. Min, max over time and end of simulation"
[1] 0.0016
[1] 0.0022
[1] 0.0016
[1] "TYL_NI, 95th percentile. Min, max over time and end of simulation"
[1] 0.463
[1] 0.9919
[1] 0.9919
[1] ""
[1] "change over time in TYL_NI simulations"
[1] "% with decrease"
[1] 0.377
[1] "maximum decrease"
[1] -0.1538
[1] "% with increase"
[1] 0.623
[1] "% with minimal increase"
[1] 0.317
[1] "% with moderate increases"
[1] 0.165
[1] "% with substantial increase"
[1] 0.141
[1] ""
[1] "CON NI change over time"
[1] "% with decrease"
[1] 0.812
[1] "maximum decrease"
[1] -0.2072
[1] "% with minimal increase"
[1] 0.087
[1] "% with moderate increases"
[1] 0.057
[1] "% with substantial increase"
[1] 0.044
[1] ""
[1] "difference between TYL and CON at the end of the feeding period"
[1] "% with decrease"
[1] 0.048
[1] "largest decrease"
[1] 0
[1] "the largest decrease is 0 percentage points. so 5% of simulations had no difference between TYL and CON"
[1] "% with minimal increase"
[1] 0.707
[1] "% with minimal increase or decrease"
[1] 0.755
[1] "% with moderate increase"
[1] 0.159
[1] "% with substantial increase"
[1] 0.086
[1] "median difference"
50%
3433 0.0125
[1] ""
[1] "difference between TYL and CON at the end of the feeding period for different interventions"
[1] "RWT"
[1] "% with minimal increase or decrease"
[1] 0.791
[1] "% with moderate increase"
[1] 0.14
[1] "% with substantial increase"
[1] 0.069
[1] "DFM"
[1] "% with minimal increase or decrease"
[1] 0.752
[1] "% with moderate increase"
[1] 0.162
[1] "% with substantial increase"
[1] 0.086
[1] "AFTP"
[1] "% with minimal increase or decrease"
[1] 0.809
[1] "% with moderate increase"
[1] 0.144
[1] "% with substantial increase"
[1] 0.047
[1] ""
[1] "time and magnitude of intervention impact in TYL effect"
[1] "AFTP"
`summarise()` ungrouping output (override with `.groups` argument)
# A tibble: 7 x 9
variable d113 max min d143 day.max day.min d143.reduction lrgst.reduction
<fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 X1. 0 0 0 0 113 113 0 0
2 X5. 0.000100 0.000100 0 0 113. 113. 0.000100 0.000100
3 X25. 0.00210 0.00210 0.00120 0.00120 113 139 0.000900 0.000900
4 X50. 0.0115 0.0115 0.00760 0.0076 113 142. 0.00385 0.00385
5 X75. 0.0816 0.0816 0.0548 0.0548 113 143. 0.0268 0.0268
6 X95. 0.650 0.650 0.486 0.486 113 143. 0.164 0.164
7 X99. 0.947 0.947 0.802 0.802 113 143. 0.146 0.146
[1] "RWT"
`summarise()` ungrouping output (override with `.groups` argument)
# A tibble: 7 x 9
variable d113 max min d143 day.max day.min d143.reduction lrgst.reduction
<fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 X1. 0 0 0 0 113 113 0 0
2 X5. 0.000100 0.000100 0 0 115. 118. 0.000100 0.000100
3 X25. 0.00210 0.00210 0.00160 0.00160 114. 143. 0.000500 0.0005
4 X50. 0.0115 0.0115 0.0100 0.0100 114. 143. 0.0014 0.0014
5 X75. 0.0816 0.0820 0.0672 0.0672 114. 143. 0.0143 0.0144
6 X95. 0.650 0.653 0.601 0.601 114. 143. 0.0486 0.0486
7 X99. 0.947 0.948 0.923 0.923 114. 143. 0.0243 0.0243
[1] ""
[1] "DFM vs NI. They are essentially the same for proportion resistant"
[1] "DFM"
`summarise()` ungrouping output (override with `.groups` argument)
# A tibble: 7 x 2
variable v
<fct> <dbl>
1 X1. 0
2 X5. 0.000100
3 X25. 0.00210
4 X50. 0.0124
5 X75. 0.0973
6 X95. 0.732
7 X99. 0.964
[1] "NI"
`summarise()` ungrouping output (override with `.groups` argument)
# A tibble: 7 x 2
variable v
<fct> <dbl>
1 X1. 0
2 X5. 0.000100
3 X25. 0.00207
4 X50. 0.0125
5 X75. 0.0935
6 X95. 0.734
7 X99. 0.962
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@
3432 5.095095
50%
3432 5.095901
[1] "ALL, median for TYL, CON at end of treatment"
50%
3432 5.095636
50%
3432 5.096027
[1] "NI, median for TYL, CON at end of treatment"
50%
3432 5.286565
Expand Down
44 changes: 16 additions & 28 deletions R Analysis/results/TYL effect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,31 +72,30 @@
[1] 0.086
[1] "AFTP"
[1] "% with minimal increase or decrease"
[1] 0.775
[1] "% with moderate increase"
[1] 0.146
[1] "% with substantial increase"
[1] 0.079
[1] "#ALL"
[1] "% with minimal increase or decrease"
[1] 0.809
[1] "% with moderate increase"
[1] 0.144
[1] "% with substantial increase"
[1] 0.047
[1] "" [1] "time and magnitude of intervention impact in TYL effect"
[1] "AFTP"
[1] "RWT"
[1] ""
[1] "DFM vs NI. They are essentially the same for proportion resistant"
[1] "DFM"
[1] "NI"
[1] "time and magnitude of intervention impact in TYL effect"
[1] "AFTP"
# A tibble: 7 x 9
variable d113 max min d143 day.max day.min d143.reduction lrgst.reduction
<fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 X1. 0 0 0 0 113 113 0. 0
2 X5. 0.000100 0.0001 0 0.000100 125. 113. -9.49e-19 0.000100
3 X25. 0.00210 0.00210 0.0017 0.0017 113 115. 4.00e- 4 0.000400
4 X50. 0.0115 0.0115 0.0097 0.0101 113 123. 1.35e- 3 0.00175
5 X75. 0.0816 0.0816 0.0689 0.0761 113 118. 5.43e- 3 0.0126
6 X95. 0.650 0.667 0.557 0.667 143. 119. -1.70e- 2 0.0931
7 X99. 0.947 0.947 0.852 0.918 113 116. 2.92e- 2 0.0955
# A tibble: 7 x 11
variable d113 max min d143 d120 day.max day.min d143.reduction week.reduction lrgst.reduction
<fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 X1. 0 0 0 0 0 113 113 0 0 0
2 X5. 0.000100 0.000100 0 0 0 113. 113. 0.000100 0.000100 0.000100
3 X25. 0.00210 0.00210 0.00120 0.00120 0.0014 113 139 0.000900 0.000700 0.000900
4 X50. 0.0115 0.0115 0.00760 0.0076 0.0088 113 142. 0.00385 0.00265 0.00385
5 X75. 0.0816 0.0816 0.0548 0.0548 0.0633 113 143. 0.0268 0.0182 0.0268
6 X95. 0.650 0.650 0.486 0.486 0.515 113 143. 0.164 0.135 0.164
7 X99. 0.947 0.947 0.802 0.802 0.824 113 143. 0.146 0.123 0.146
[1] "RWT"
# A tibble: 7 x 9
variable d113 max min d143 day.max day.min d143.reduction lrgst.reduction
Expand All @@ -108,17 +107,6 @@
5 X75. 0.0816 0.0820 0.0672 0.0672 114. 143. 0.0143 0.0144
6 X95. 0.650 0.653 0.601 0.601 114. 143. 0.0486 0.0486
7 X99. 0.947 0.948 0.923 0.923 114. 143. 0.0243 0.0243
[1] "ALL"
# A tibble: 7 x 11
variable d113 max min d143 d120 day.max day.min d143.reduction week.reduction lrgst.reduction
<fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 X1. 0 0 0 0 0 113 113 0 0 0
2 X5. 0.000100 0.000100 0 0 0 114. 114. 0.000100 0.000100 0.000100
3 X25. 0.0021 0.0021 0.00120 0.0012 0.0014 113 140. 0.000900 0.000700 0.0009
4 X50. 0.0115 0.0115 0.0076 0.00770 0.0089 113 142. 0.00385 0.00265 0.00395
5 X75. 0.0810 0.0810 0.0573 0.0573 0.0637 113 143. 0.0237 0.0174 0.0237
6 X95. 0.651 0.651 0.484 0.484 0.513 113 143. 0.166 0.137 0.167
7 X99. 0.946 0.946 0.797 0.801 0.824 113 138. 0.145 0.122 0.150
[1] ""
[1] "DFM vs NI. They are essentially the same for proportion resistant"
[1] "DFM"
Expand Down
2 changes: 1 addition & 1 deletion R Analysis/results/intervention effects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
[1] ""
[1] "AFTP, TYL"
[1] "% with minimal increase or decrease"
[1] 0.944
[1] 0.807
14 changes: 14 additions & 0 deletions R Analysis/results/tyl intestine concentrations LGpen.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[1] "descriptive results (median, 5th, 95th percentiles) for peak (max) and end of treatment (index 3433)"
[1] "median, peak and end"
[1] 0.6
[1] 0.4
[1] ""
[1] "5th percentile, peak and end"
[1] 0.25
[1] 0.17
[1] ""
[1] "95th percentile, peak and end"
[1] 1.13
[1] 0.75
[1] "maximum tyl conc still substantially lowr than intermediate MIC (16 ug/mL)"
[1] 1.6695
24 changes: 9 additions & 15 deletions R Analysis/scripts/Intervention vs NI prop res cow.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ lcolor=c("black", "#F8766D", "#7CAE00", "#619CFF", "#7CAE00", "#F8766D", "black"
#Take the difference between individual simulations because parameter values are the same for each simulation (due to random number seed)

#automate loading data and calculating differences
TYLdatafiles<-c("TYL_NI_", "TYL_RWT_", "TYL_NI_", "TYL_AFTP_", "TYL_NI_", "TYL_DFM_", "TYL_NI_", "TYL_ALL_") #control (TYL_NI) followed by TYL intervention group.
TYLdatafiles<-c("TYL_NI_", "TYL_RWT_", "TYL_NI_", "TYL_AFTP_", "TYL_NI_", "TYL_DFM_") #control (TYL_NI) followed by TYL intervention group.

#load in proportion resistant
for (i in seq(1,length(TYLdatafiles),2)){
Expand All @@ -54,7 +54,7 @@ rm(tyl.NI.cow, tyl.I.cow, diff.cow, list, label)

#difference between CON_INT and CON_NI. Note that there is no CON_RWT because TYL can't be withdrawn in CON scenario
#automate loading data and calculating differences
CONdatafiles<-c("NoTYL_NI_", "NoTYL_AFTP_", "NoTYL_NI_", "NoTYL_DFM_", "NoTYL_NI_", "NoTYL_ALL_")
CONdatafiles<-c("NoTYL_NI_", "NoTYL_AFTP_", "NoTYL_NI_", "NoTYL_DFM_")

#load in proportion resistant
for (i in seq(1,length(CONdatafiles),2)){
Expand All @@ -75,7 +75,7 @@ rm(con.NI.cow, con.I.cow, diff.cow, list, label)

#difference between TYL_INT and CON_NI.
#automate loading data and calculating differences
datafiles<-c("NoTYL_NI_", "TYL_RWT_", "NoTYL_NI_", "TYL_AFTP_", "NoTYL_NI_", "TYL_DFM_", "NoTYL_NI_", "TYL_ALL_") #control (NoTYL_NI) followed by TYL intervention group.
datafiles<-c("NoTYL_NI_", "TYL_RWT_", "NoTYL_NI_", "TYL_AFTP_", "NoTYL_NI_", "TYL_DFM_") #control (NoTYL_NI) followed by TYL intervention group.

#load in proportion resistant
for (i in seq(1,length(datafiles),2)){
Expand All @@ -96,7 +96,7 @@ rm(con.NI.cow, tyl.I.cow, diff.cow, list, label)


#plotting
scenarios <- c("RWT", "DFM", "AFTP", "ALL")
scenarios <- c("RWT", "DFM", "AFTP")
#create figure of Prop res in cow for all scenarios
for (i in 1:length(scenarios)){
TYLdata <- get(paste("TYL_", scenarios[i], "_Prop_res", sep=""))
Expand Down Expand Up @@ -146,14 +146,11 @@ grid.arrange(TYLplot.cow.Pr.RWT+
xlab("")+
ggtitle("B"),
TYLplot.cow.Pr.AFTP+
ylab("Difference in Proportion Resistant")+
geom_vline(aes(xintercept=113), linetype="longdash", size=1.25)+
ggtitle("D"),
TYLplot.cow.Pr.ALL+
ylab("Difference in Proportion Resistant")+
xlab("Days")+
geom_vline(aes(xintercept=113), linetype="longdash", size=1.25)+
ggtitle("F"), ncol=1),
ggtitle("D"),
ncol=1),
grid.arrange(ggplot()+
theme_bw()+
theme(panel.border=element_blank())+
Expand All @@ -164,17 +161,14 @@ grid.arrange(ggplot()+
xlab("")+
ggtitle("C"),
CONplot.cow.Pr.AFTP+
ylab("")+
geom_vline(aes(xintercept=113), linetype="longdash", size=1.25)+
ggtitle("E"),
CONplot.cow.Pr.ALL+
ylab("")+
xlab("Days")+
geom_vline(aes(xintercept=113), linetype="longdash", size=1.25)+
ggtitle("G"), ncol=1),
ggtitle("E"),
ncol=1),
ncol=2),
width=6*2,
height=5*4,
height=5*3,
units="in",
dpi=320)

Expand Down

0 comments on commit 3cfd506

Please sign in to comment.