#######READ IN DATA AFTER ML PARAMETER DETERMINATION############ tolall <- read.csv("/Users/acgerstein/Documents/PhD/Research/beneficial mutations/Nystatin/A vs AA/NysIC50/combined_A_AA_MLc.csv", sep=",") nyshap <- read.csv("/Users/acgerstein/Documents/PhD/Research/beneficial mutations/Nystatin/haploid tolerance/param/1110NBMnys_param.csv", sep=",", as.is=TRUE) sig <- read.csv( "/Users/acgerstein/Documents/PhD/Research/beneficial mutations/Nystatin/A vs AA/NysIC50/NysIC50_A_AA_modelsig.csv",sep=",", as.is=TRUE) ny <- subset(nyshap, nyshap$NBM %in% tolall$lines) ny<-ny[order(ny$NBM),] sig<-sig[order(sig$name.h),] all <- data.frame(tolall, pos=rep(ny$pos, 2), col=rep(ny$col,2), gene=rep(ny$gene,2)) all$pch <- ifelse(all$ploidy=="N", 21,19) max.od <- c() max.scal <- c() max.asym <- c() k <-0 for (i in unique(tolall$lines)){ k <- k+1 sub <- subset(tolall, lines==i) max.od[k] <- max(sub$CIh) max.scal[k] <- max(sub$CISh) max.asym[k] <- max(sub$CIAh) } all.sig <- data.frame(NBM=sig$name.h, sig.od=sig$sig.od, sig.scal=sig$sig.scal, sig.asym=sig$sig.asym, pos=ny$pos, max.od, max.scal, max.asym) labels <- c(1,3,5,6,9,13,16,19,21,22,23,25,28,29,30,31,32,33,34,35) txt <- expression(paste("(I", C[50], " in ",mu,"M)",sep="")) all$col2 <- ifelse(all$ploidy=="N","red","blue") all$col3[all$col2=="red"] <- grey(0.5) all$col3[all$col2=="blue"] <- "black" ############################################################### ###############READ IN R CODE TO GET RAW FITS################## source("/Users/acgerstein/Documents/PhD/Research/beneficial mutations/Nystatin/A vs AA/NysIC50/code/1202 RawFit_one.R") ############################################################### #changei <- function(i){ #yyd<- func(exptMLd[[i]]$par[1],exptMLd[[i]]$par[2],exptMLd[[i]]$par[3],xx) #yy<- func(exptML[[i]]$par[1],exptML[[i]]$par[2],exptML[[i]]$par[3],xx) # #plot(xx, yyd, type="n", ylim=c(0,1.2), xaxt="n", yaxt="n", col="purple", lwd=2, xlab="", ylab="", yaxt="n") #points(ddnd[[i]]$enviro, ddnd[[i]]$ODn, col="black") #points(xx, yyd, type="l") #points(exptMLd[[i]]$par[2],exptMLd[[i]]$par[1]/2, co="blue", pch=15, cex=1.3) # #points(ddn[[i]]$enviro, ddn[[i]]$ODn, col="grey") #points(xx, yy, type="l", col="grey") #points(exptML[[i]]$par[2],exptML[[i]]$par[1]/2, co="red", pch=15, cex=1.3)} ###########FUNCTION TO DISPLAY RAW DATA######################## changei <- function(i){ yyd<- func(exptMLd[[i]]$par[1],exptMLd[[i]]$par[2],exptMLd[[i]]$par[3],xx) yy<- func(exptML[[i]]$par[1],exptML[[i]]$par[2],exptML[[i]]$par[3],xx) plot(xx, yyd, type="n", ylim=c(0,1.2), xaxt="n", yaxt="n", col="purple", lwd=2, xlab="", ylab="", yaxt="n") points(ddnd[[i]]$enviro, ddnd[[i]]$ODn, col="black") points(xx, yyd, type="l") points(exptMLd[[i]]$par[2],exptMLd[[i]]$par[1]/2, col="black", pch=15, cex=1) points(ddn[[i]]$enviro, ddn[[i]]$ODn, col="grey") points(xx, yy, type="l", col="grey") points(exptML[[i]]$par[2], exptML[[i]]$par[1]/2, col=grey(0.5), pch=15, cex=1)} ############################################################## ##############FUNCTION TO DISPLAY ARROWS###################### arr <- function(i, left, right, cL, cR){ arrows(left[[i]]$par[2]+0.5,left[[i]]$par[1]/2,left[[i]]$par[2]+0.2,left[[i]]$par[1]/2, col=cL, length=0.05, cex=1.1) arrows(right[[i]]$par[2]-0.5,right[[i]]$par[1]/2,right[[i]]$par[2]-0.2,right[[i]]$par[1]/2, col=cR, length=0.05, cex=1.1) } ############################################################## ############FIGURE 1 (black and white)######################## hap1 <- expression(paste("Haploid I", C[50], "",sep="")) dip1 <- expression(paste("Diploid I", C[50], "",sep="")) txt2 <- expression(paste("Level of nystatin (",mu,"M)",sep="")) txt <- expression(paste("(level of nystatin, ",mu,"M)",sep="")) eq <- expression(italic(paste("Haploid ", IC[50], " = Diploid ", IC[50], sep=""))) less <- expression(italic(paste("Haploid ", IC[50], " < Diploid ", IC[50], sep=""))) more <- expression(italic(paste("Haploid ", IC[50], " > Diploid ", IC[50], sep=""))) nf<-layout(matrix(c(5,1,2,3,4,4,4,4), 2, 4, byrow = TRUE), widths=c(0.2,1,1,1,3), heights=c(1.3,2)) #TOP PANELS par(mar=c(4.5,5,1.5,0)) changei(3) axis(2, las=2) axis(1, labels=c(1,2,4,8,16,32,64,128), at=c(log(1),log(2),log(4),log(8),log(16),log(32),log(64),log(128))) legend("bottomleft", legend=c("haploids","diploids",hap1,dip1), col=c("grey","black",grey(0.5),"black"), pch=c(21,21,15,15), inset=0.02, cex=0.9, y.intersp=0.85) text(log(120),1.1, "BMN16", pos=2, cex=1.3) mtext("Optical density", side=2, outer=FALSE, line=3) mtext("(a)", side=3, outer=TRUE, line=-2, adj=0.04, cex=1.3) mtext("(b)", side=3, outer=TRUE, line=-16.5, adj=0.04, cex=1.3) arr(3, exptML, exptMLd, grey(0.5),"black") mtext(eq, side=3, line=0.25, font=2, adj=0.15, cex=0.8) #MAIN FIGURE - TOLERANCE DATA par(mar=c(4.5,2.5,1.5,2.5)) changei(9) axis(2, labels=FALSE) axis(1, labels=c(1,2,4,8,16,32,64,128), at=c(log(1),log(2),log(4),log(8),log(16),log(32),log(64),log(128))) text(log(120),1.1, "BMN13", pos=2, cex=1.3) mtext(txt2, side=1, outer=FALSE, line=2.5) arr(9, exptMLd, exptML, "black", grey(0.5)) mtext(less, side=3, line=0.25, font=2, adj=0.2, cex=0.8) par(mar=c(4.5,0,1.5,5)) changei(20) axis(2, labels=FALSE) axis(1, labels=c(1,2,4,8,16,32,64,128), at=c(log(1),log(2),log(4),log(8),log(16),log(32),log(64),log(128))) text(log(120),1.1, "BMN34", pos=2, cex=1.3) arr(20, exptML, exptMLd,grey(0.5), "black") mtext(more, side=3, line=0.25, font=2, adj=0.1, cex=0.8) par(mar=c(4,5,1,1)) plot(all$pos, all$od50, pch=all$pch, xaxt="n", yaxt="n", ylab="", ylim=c(0,5.6), xlab="", col=all$col3, cex=1.5) axis(2, las=2, cex.axis=1, at=c(0,0.69,1.38, 2.08, 2.77, 3.47, 4.16, 4.85), labels=c(0,2,4,8,16,32,64,128)) arrows(all$pos, all$CIl, all$pos, all$CIh, length=0) axis(1, at=sort(unique(all$pos)), labels=labels, cex.axis=1) mtext("Nystatin tolerance", side=2, line=3.5, outer=FALSE, cex=1.2) mtext(txt, side=2, line=2.2, outer=FALSE, cex=0.9) text(all.sig$pos, all.sig$max.od+0.25, all.sig$sig.od, cex=1.5) abline(v=3, lty=2) abline(v=11, lty=2) abline(v=23, lty=2) ptxt <- expression(paste(italic(p)," < 0.05")) legend("topright", legend=c("haploid","diploid",ptxt), pch=c(21,19,8),bg="white", cex=1.2, col=c(grey(0.5),"black","black"), inset=c(0.01,0.02)) text(2, -0.2, "ERG7", font=4, cex=1.3, pos=3) text(6.9, -0.2, "ERG6", font=4, pos=3, cex=1.3) text(16.9, -0.2, "ERG3", font=4, pos=3, cex=1.3) text(23.9, -0.2, "ERG5", font=4, pos=3, cex=1.3) mtext("BMN Line", side=1, line=3, cex=1) ###############################################################