O objetivo de esse trabalho é verificar a concentração efetiva que reduz em 50% algum processo do fungo (CE50). Neste caso será utilizada a germinação dos esporos in vitro, avaliada 18 h após iniciado o processo.
O fungicida testado foi Azoxistrobin, do grupo químico estrobilurinas. Os isolados são 6:
pkg <- c("ggplot2", "knitr","reshape2", "dplyr")
sapply(pkg, library, character.only=TRUE, logical.return=TRUE)
## ggplot2 knitr reshape2 dplyr
## TRUE TRUE TRUE TRUE
setwd("/home/epi/Dropbox/MyR/Análise otros/ISA/tese")# lab
#setwd("/media/juanchi/DATA/Dropbox/MyR/Análise otros/ISA/tese") # DELL
# Dados planilha laboratorio
datlab = read.csv("ec50_isa.csv", dec=".", header=T, sep="\t", check.names=FALSE)
head(datlab)
## iso exp rep sub 0 0.05 0.1 0.2 0.4 0.8 1.6 3.2
## 1 sp09 1 1 1 85 77 85 88 85 82 34 0
## 2 sp09 1 1 2 89 80 82 88 91 79 31 0
## 3 sp09 1 1 3 84 81 76 88 81 86 20 0
## 4 sp09 1 2 1 93 74 89 83 86 67 39 4
## 5 sp09 1 2 2 90 84 81 81 74 73 21 2
## 6 sp09 1 2 3 85 74 78 88 88 69 24 5
# Dados long expandidos
dat = melt(datlab, id.vars = c("iso", "exp", "rep", "sub"))
names(dat)[5:6] = c("dose", "germi") ; head(dat)
## iso exp rep sub dose germi
## 1 sp09 1 1 1 0 85
## 2 sp09 1 1 2 0 89
## 3 sp09 1 1 3 0 84
## 4 sp09 1 2 1 0 93
## 5 sp09 1 2 2 0 90
## 6 sp09 1 2 3 0 85
dat = dat[with(dat, order(iso, exp)), ]
head(dat)
## iso exp rep sub dose germi
## 37 160 1 1 1 0 98
## 38 160 1 1 2 0 100
## 39 160 1 1 3 0 99
## 40 160 1 2 1 0 99
## 41 160 1 2 2 0 99
## 42 160 1 2 3 0 99
# Medias por repetição
dat_rep= aggregate(germi ~ iso + exp + rep + dose , data = dat, mean)
dat_rep = dat_rep[with(dat_rep, order(iso, exp, dose, rep)), ]
dat_rep$germi = round(dat_rep$germi, 1)
dat_rep$id <- as.factor(paste(dat_rep$iso, dat_rep$exp, sep="_"))
dat_rep = dat_rep[,c(6,1,2,4,3,5)]
dat_rep[c(1:48),]
## id iso exp dose rep germi
## 1 160_1 160 1 0 1 99.0
## 13 160_1 160 1 0 2 99.0
## 25 160_1 160 1 0 3 99.0
## 37 160_1 160 1 0.05 1 98.3
## 49 160_1 160 1 0.05 2 97.7
## 61 160_1 160 1 0.05 3 98.3
## 73 160_1 160 1 0.1 1 94.3
## 85 160_1 160 1 0.1 2 98.7
## 97 160_1 160 1 0.1 3 98.0
## 109 160_1 160 1 0.2 1 95.3
## 121 160_1 160 1 0.2 2 96.0
## 133 160_1 160 1 0.2 3 96.3
## 145 160_1 160 1 0.4 1 80.7
## 157 160_1 160 1 0.4 2 85.0
## 169 160_1 160 1 0.4 3 83.3
## 181 160_1 160 1 0.8 1 36.3
## 193 160_1 160 1 0.8 2 50.0
## 205 160_1 160 1 0.8 3 48.3
## 217 160_1 160 1 1.6 1 36.0
## 229 160_1 160 1 1.6 2 35.7
## 241 160_1 160 1 1.6 3 29.7
## 253 160_1 160 1 3.2 1 1.0
## 265 160_1 160 1 3.2 2 1.3
## 277 160_1 160 1 3.2 3 1.7
## 7 160_2 160 2 0 1 96.3
## 19 160_2 160 2 0 2 95.0
## 31 160_2 160 2 0 3 96.3
## 43 160_2 160 2 0.05 1 96.7
## 55 160_2 160 2 0.05 2 97.7
## 67 160_2 160 2 0.05 3 96.3
## 79 160_2 160 2 0.1 1 91.0
## 91 160_2 160 2 0.1 2 92.7
## 103 160_2 160 2 0.1 3 95.0
## 115 160_2 160 2 0.2 1 79.7
## 127 160_2 160 2 0.2 2 82.3
## 139 160_2 160 2 0.2 3 80.7
## 151 160_2 160 2 0.4 1 75.7
## 163 160_2 160 2 0.4 2 71.7
## 175 160_2 160 2 0.4 3 63.3
## 187 160_2 160 2 0.8 1 57.7
## 199 160_2 160 2 0.8 2 42.3
## 211 160_2 160 2 0.8 3 40.0
## 223 160_2 160 2 1.6 1 14.7
## 235 160_2 160 2 1.6 2 19.3
## 247 160_2 160 2 1.6 3 23.0
## 259 160_2 160 2 3.2 1 1.0
## 271 160_2 160 2 3.2 2 1.7
## 283 160_2 160 2 3.2 3 1.7
# Medias por exp » grafico exploratorio
dat_exp = aggregate(germi ~ iso + exp + dose , data = dat, mean)
dat_exp = dat_exp[with(dat_exp, order(iso, exp)), ]
dat_exp$germi = round(dat_exp$germi, 1)
dat_exp[c(1:16),]
## iso exp dose germi
## 1 160 1 0 99.0
## 13 160 1 0.05 98.1
## 25 160 1 0.1 97.0
## 37 160 1 0.2 95.9
## 49 160 1 0.4 83.0
## 61 160 1 0.8 44.9
## 73 160 1 1.6 33.8
## 85 160 1 3.2 1.3
## 7 160 2 0 95.9
## 19 160 2 0.05 96.9
## 31 160 2 0.1 92.9
## 43 160 2 0.2 80.9
## 55 160 2 0.4 70.2
## 67 160 2 0.8 46.7
## 79 160 2 1.6 19.0
## 91 160 2 3.2 1.4
dat_exp$dose = as.numeric(as.character(dat_exp$dose))
str(dat_exp)
## 'data.frame': 96 obs. of 4 variables:
## $ iso : Factor w/ 6 levels "160","210","345",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ exp : int 1 1 1 1 1 1 1 1 2 2 ...
## $ dose : num 0 0.05 0.1 0.2 0.4 0.8 1.6 3.2 0 0.05 ...
## $ germi: num 99 98.1 97 95.9 83 44.9 33.8 1.3 95.9 96.9 ...
explot = ggplot(dat_exp, aes(dose, germi)) +
geom_point(shape=20, size=2) +
geom_smooth() +
facet_wrap(~iso, ncol=2, nrow=3) +
scale_y_continuous("Germinação (%)")explot
# Medias por exp * dose
dose_max = aggregate(germi ~ iso + exp , data = dat_rep, max)
dose_max = dose_max %>% arrange(iso)
nrows_exp=lapply(unique(dat_rep$id), function(x){ sum(dat_rep$id==x) })
a <- c()
for(i in 1:length(nrows_exp)) {a <- c(a,nrows_exp[[i]])}
dat_rep$maxi=rep(dose_max[1:length(levels(dat_rep$id)),3], t=a)
dat_rep$ctrl = round(1-(dat_rep$germi/dat_rep$maxi),2)
dat_rep[1:40,]
## id iso exp dose rep germi maxi ctrl
## 1 160_1 160 1 0 1 99.0 99.0 0.00
## 13 160_1 160 1 0 2 99.0 99.0 0.00
## 25 160_1 160 1 0 3 99.0 99.0 0.00
## 37 160_1 160 1 0.05 1 98.3 99.0 0.01
## 49 160_1 160 1 0.05 2 97.7 99.0 0.01
## 61 160_1 160 1 0.05 3 98.3 99.0 0.01
## 73 160_1 160 1 0.1 1 94.3 99.0 0.05
## 85 160_1 160 1 0.1 2 98.7 99.0 0.00
## 97 160_1 160 1 0.1 3 98.0 99.0 0.01
## 109 160_1 160 1 0.2 1 95.3 99.0 0.04
## 121 160_1 160 1 0.2 2 96.0 99.0 0.03
## 133 160_1 160 1 0.2 3 96.3 99.0 0.03
## 145 160_1 160 1 0.4 1 80.7 99.0 0.18
## 157 160_1 160 1 0.4 2 85.0 99.0 0.14
## 169 160_1 160 1 0.4 3 83.3 99.0 0.16
## 181 160_1 160 1 0.8 1 36.3 99.0 0.63
## 193 160_1 160 1 0.8 2 50.0 99.0 0.49
## 205 160_1 160 1 0.8 3 48.3 99.0 0.51
## 217 160_1 160 1 1.6 1 36.0 99.0 0.64
## 229 160_1 160 1 1.6 2 35.7 99.0 0.64
## 241 160_1 160 1 1.6 3 29.7 99.0 0.70
## 253 160_1 160 1 3.2 1 1.0 99.0 0.99
## 265 160_1 160 1 3.2 2 1.3 99.0 0.99
## 277 160_1 160 1 3.2 3 1.7 99.0 0.98
## 7 160_2 160 2 0 1 96.3 97.7 0.01
## 19 160_2 160 2 0 2 95.0 97.7 0.03
## 31 160_2 160 2 0 3 96.3 97.7 0.01
## 43 160_2 160 2 0.05 1 96.7 97.7 0.01
## 55 160_2 160 2 0.05 2 97.7 97.7 0.00
## 67 160_2 160 2 0.05 3 96.3 97.7 0.01
## 79 160_2 160 2 0.1 1 91.0 97.7 0.07
## 91 160_2 160 2 0.1 2 92.7 97.7 0.05
## 103 160_2 160 2 0.1 3 95.0 97.7 0.03
## 115 160_2 160 2 0.2 1 79.7 97.7 0.18
## 127 160_2 160 2 0.2 2 82.3 97.7 0.16
## 139 160_2 160 2 0.2 3 80.7 97.7 0.17
## 151 160_2 160 2 0.4 1 75.7 97.7 0.23
## 163 160_2 160 2 0.4 2 71.7 97.7 0.27
## 175 160_2 160 2 0.4 3 63.3 97.7 0.35
## 187 160_2 160 2 0.8 1 57.7 97.7 0.41
dat_rep$dose = as.numeric(as.character(dat_rep$dose))
str(dat_rep)
## 'data.frame': 288 obs. of 8 variables:
## $ id : Factor w/ 12 levels "160_1","160_2",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ iso : Factor w/ 6 levels "160","210","345",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ exp : int 1 1 1 1 1 1 1 1 1 1 ...
## $ dose : num 0 0 0 0.05 0.05 0.05 0.1 0.1 0.1 0.2 ...
## $ rep : int 1 2 3 1 2 3 1 2 3 1 ...
## $ germi: num 99 99 99 98.3 97.7 98.3 94.3 98.7 98 95.3 ...
## $ maxi : num 99 99 99 99 99 99 99 99 99 99 ...
## $ ctrl : num 0 0 0 0.01 0.01 0.01 0.05 0 0.01 0.04 ...
plot_ctrl = ggplot(dat_rep, aes(dose, ctrl)) +
geom_point(shape=20, size=2) +
geom_smooth() +
facet_wrap(exp~iso) + #ncol=2, nrow=3
scale_y_continuous("Inhibição da germinação")
plot_ctrl
# Limpar data frame: exluir dose 0 e deixar valores de inhibição > 0
dat_rep = filter(dat_rep, dose > 0 , ctrl > 0 )
# Acrescentar uma coluna com simbolos: sem (0) ou com (1)
dat_rep$sym <- c(19,21)[match(dat_rep$exp, c(1,2))]
# Split dataframe by iso*exp
attach(dat_rep)
dat_id <- split(dat_rep, f=id) # Ate aqui fica completo o dataset!!! (IMAGEM)
m160.1 = glm(ctrl~ log(dose), data=dat_id[[1]], family = quasibinomial(link="probit"))
m160.2 = glm(ctrl~ log(dose), data=dat_id[[2]], family = quasibinomial(link="probit"))
summary(m160.1)
##
## Call:
## glm(formula = ctrl ~ log(dose), family = quasibinomial(link = "probit"),
## data = dat_id[[1]])
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.26773 -0.12172 0.01862 0.18833 0.30971
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.1860 0.0927 2.006 0.0601 .
## log(dose) 1.1055 0.1008 10.971 2.11e-09 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for quasibinomial family taken to be 0.05357103)
##
## Null deviance: 13.4853 on 19 degrees of freedom
## Residual deviance: 0.7481 on 18 degrees of freedom
## AIC: NA
##
## Number of Fisher Scoring iterations: 6
summary(m160.2)
##
## Call:
## glm(formula = ctrl ~ log(dose), family = quasibinomial(link = "probit"),
## data = dat_id[[2]])
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.35698 -0.03724 0.03834 0.11125 0.25880
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.43578 0.06021 7.237 9.90e-07 ***
## log(dose) 0.96122 0.05285 18.188 4.93e-13 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for quasibinomial family taken to be 0.02198881)
##
## Null deviance: 12.05141 on 19 degrees of freedom
## Residual deviance: 0.42839 on 18 degrees of freedom
## AIC: NA
##
## Number of Fisher Scoring iterations: 6
a <- list()
for (i in 1:length(dat_id)) {
a[[names(dat_id[i])]] <- glm(dat_id[[i]]$ctrl~ log(dat_id[[i]]$dose), family = quasibinomial(link="probit"))
}
a[1:3]
## $`160_1`
##
## Call: glm(formula = dat_id[[i]]$ctrl ~ log(dat_id[[i]]$dose), family = quasibinomial(link = "probit"))
##
## Coefficients:
## (Intercept) log(dat_id[[i]]$dose)
## 0.186 1.106
##
## Degrees of Freedom: 19 Total (i.e. Null); 18 Residual
## Null Deviance: 13.49
## Residual Deviance: 0.7481 AIC: NA
##
## $`160_2`
##
## Call: glm(formula = dat_id[[i]]$ctrl ~ log(dat_id[[i]]$dose), family = quasibinomial(link = "probit"))
##
## Coefficients:
## (Intercept) log(dat_id[[i]]$dose)
## 0.4358 0.9612
##
## Degrees of Freedom: 19 Total (i.e. Null); 18 Residual
## Null Deviance: 12.05
## Residual Deviance: 0.4284 AIC: NA
##
## $`210_1`
##
## Call: glm(formula = dat_id[[i]]$ctrl ~ log(dat_id[[i]]$dose), family = quasibinomial(link = "probit"))
##
## Coefficients:
## (Intercept) log(dat_id[[i]]$dose)
## 0.3185 0.8093
##
## Degrees of Freedom: 19 Total (i.e. Null); 18 Residual
## Null Deviance: 10.23
## Residual Deviance: 0.7645 AIC: NA
myFun <- function(glm)
{
out <- c(glm$coefficients[1],
glm$coefficients[2],
summary(glm)$coefficients[2,2],
summary(glm)$coefficients[1,2]
)
names(out) <- c("b0","b1","b0.SE","b1.SE")
return(out)}
results <- list()
for (i in 1:length(a)) results[[names(a)[i]]] <- myFun(a[[i]])
b <- as.data.frame(results)
b=t(b)
glm_coef = as.data.frame(b)
temp <- strsplit(rownames(b),"_")
mat <- matrix(unlist(temp), ncol=2, byrow=TRUE)
df <- as.data.frame(mat)
glm_coef <- cbind(df, glm_coef)
colnames(glm_coef)[1:2]<- c("Iso", "Exp")
glm_coef$Iso = gsub("X", " ", glm_coef$Iso)
rownames(glm_coef) <- NULL
glm_coef$DE50 = exp({log(0.5/(1-0.5)) - glm_coef$b0} / glm_coef$b1)
glm_coef[,3:7] = round(glm_coef[,3:7],2)
(final_glm = aggregate(DE50 ~ Iso, data=glm_coef, mean))
## Iso DE50
## 1 160 0.745
## 2 210 0.670
## 3 345 1.100
## 4 885 0.540
## 5 pr09 0.525
## 6 sp09 0.985
m160.1 = glm(ctrl~ log(dose), data=dat_id[[1]], family = quasibinomial(link="probit"))
m160.2 = glm(ctrl~ log(dose), data=dat_id[[2]], family = quasibinomial(link="probit"))
with(subset(dat_rep, iso=="160"),
plot(dose, ctrl, pch= sym, cex=0.7,
xlab = expression(paste("Concentração de I.A. (", mu,"g.ml⁻¹ )")),
ylab = "Inibição da germinação"))
ld <- seq(0.01, 3.3, 0.1)
lines(ld, predict(m160.1, data.frame(dose = ld), type = "response", lty=1, col="black"))
lines(ld, predict(m160.2, data.frame(dose = ld), type = "response", add=TRUE), lty=3)
abline(h=0.5, v=glm_coef$DE50[1], lty=3, col="grey40")
abline(h=0.5, v=glm_coef$DE50[2], lty=3, col="grey40")
text(final_glm[1,2], 0.01, round(final_glm[1,2],2), cex=0.8, font=2)
text(2.8,0.1,"Isolado SP05160", font=2)
m210.1 = glm(ctrl~ log(dose), data=dat_id[[3]], family = quasibinomial(link="probit"))
m210.2 = glm(ctrl~ log(dose), data=dat_id[[4]], family = quasibinomial(link="probit"))
with(subset(dat_rep, iso=="210"),
plot(dose, ctrl, pch= sym, cex=0.7,
xlab = expression(paste("Concentração de I.A. (", mu,"g.ml⁻¹ )")),
ylab = "Inibição da germinação"))
lines(ld, predict(m210.1, data.frame(dose = ld), type = "response"), lty=1)
lines(ld, predict(m210.2, data.frame(dose = ld), type = "response", add=TRUE),lty=2)
abline(h=0.5, v=glm_coef$DE50[3], lty=3, col="grey40")
abline(h=0.5, v=glm_coef$DE50[4], lty=3, col="grey40")
text(final_glm$DE50[2], 0.01, final_glm$DE50[2], cex=0.8, font=2)
text(2.8,0.1,"Isolado SP06210", font=2)
m345.1 = lm(ctrl ~ dose, data=dat_id[[5]])
m345.2 = lm(ctrl ~ dose, data=dat_id[[6]])
dose50.345.1 = round({0.5 - coef(m345.1)[[1]]} / coef(m345.1)[[2]], 2)
dose50.345.2 = round({0.5 - coef(m345.2)[[1]]} / coef(m345.2)[[2]], 2)
ce50.345 = mean(c(dose50.345.1, dose50.345.2))
with(subset(dat_rep, iso=="345"),
plot(dose, ctrl, pch=sym, cex=0.7,
xlab = expression(paste("Concentração de I.A. (", mu,"g.ml⁻¹ )")),
ylab = "Inibição da germinação"))
lines(ld, predict(m345.1, data.frame(dose = ld), type = "response"), lty=1)
lines(ld, predict(m345.2, data.frame(dose = ld), type = "response",add=TRUE),lty=2)
abline(h=0.5, v=dose50.345.1[], lty=3, col="grey40")
abline(h=0.5, v=dose50.345.2[], lty=3, col="grey40")
text(ce50.345, 0.01, round(ce50.345,2), cex=0.8, font=2)
text(2.8,0.1,"Isolado SP08345", font=2)
m885.1 = glm(ctrl~ log(dose), data=dat_id[[7]], family = quasibinomial(link="probit"))
m885.2 = glm(ctrl~ log(dose), data=dat_id[[8]], family = quasibinomial(link="probit"))
with(subset(dat_rep, iso=="885"),
plot(dose, ctrl, pch= sym, cex=0.7,
xlab = expression(paste("Concentração de I.A. (", mu,"g.ml⁻¹ )")),
ylab = "Inibição da germinação"))
lines(ld, predict(m885.1, data.frame(dose = ld), type = "response"), lty=1)
lines(ld, predict(m885.2, data.frame(dose = ld), type = "response", add=TRUE), lty=2)
abline(h=0.5, v=glm_coef$DE50[7], lty=3, col="grey40")
abline(h=0.5, v=glm_coef$DE50[8], lty=3, col="grey40")
text(final_glm$DE50[4], 0.01, final_glm$DE50[4], cex=0.8, font=2)
text(2.8,0.1,"Isolado SP09885", font=2)
mpr09.1 = glm(ctrl~ log(dose), data=dat_id[[9]], family = quasibinomial(link="probit"))
mpr09.2 = glm(ctrl~ log(dose), data=dat_id[[10]], family = quasibinomial(link="probit"))
with(subset(dat_rep, iso=="pr09"),
plot(dose, ctrl, pch= sym, cex=0.7,
xlab = expression(paste("Concentração de I.A. (", mu,"g.ml⁻¹ )")),
ylab = "Inibição da germinação"))
lines(ld, predict(mpr09.1, data.frame(dose = ld), type = "response"), lty=1)
lines(ld, predict(mpr09.2, data.frame(dose = ld), type = "response", add=TRUE),lty=2)
abline(h=0.5, v=glm_coef$DE50[9], lty=3, col="grey40")
abline(h=0.5, v=glm_coef$DE50[10], lty=3, col="grey40")
text(final_glm$DE50[5], 0.01, round(final_glm$DE50[5],2), cex=0.8, font=2)
text(2.8,0.1,"Isolado PR09638", font=2)
msp09.1 = lm(ctrl~ dose, data=dat_id[[11]])
msp09.2 = lm(ctrl~ dose, data=dat_id[[12]])
dose50.sp09.1 = round({0.5 - coef(msp09.1)[[1]]} / coef(msp09.1)[[2]], 2)
dose50.sp09.2 = round({0.5 - coef(msp09.2)[[1]]} / coef(msp09.2)[[2]], 2)
ce50.sp09 = mean(c(dose50.sp09.1, dose50.sp09.2))
with(subset(dat_rep, iso=="sp09"),
plot(dose, ctrl, pch= sym, cex=0.7,
xlab = expression(paste("Concentração de I.A. (", mu,"g.ml⁻¹ )")),
ylab = "Inibição da germinação"))
lines(ld, predict(msp09.1, data.frame(dose = ld), type = "response"), lty=1)
lines(ld, predict(msp09.2, data.frame(dose = ld), type = "response", add=TRUE),lty=2)
abline(h=0.5, v=dose50.sp09.1[], lty=3, col="grey40")
abline(h=0.5, v=dose50.sp09.2[], lty=3, col="grey")
text(ce50.sp09, 0.01, round(ce50.sp09,2), cex=0.8, font=2)
text(2.8,0.1,"Isolado SP09839", font=2)