#generate RGB code for Green=SM
rgb(0, 128, 0, maxColorValue=255)
#RGB Blue=TB
rgb(40, 70, 255, maxColorValue=255)
#RGB Red
rgb(153, 0, 0, maxColorValue=255)
#Now i am working on a script to make nice looking plots with aid of:
#https://www.rdocumentation.org/packages/drc/versions/3.0-1/topics/plot.drc
#YES it makes a new window for each graph but whatever
dev.off()
dev.new(width=2.5, height=2.5)
par(mar=c(7,7,5,5))
plot(multi.m1,
type = "all",
col=c("#008000", "#2846FF", "#990000"),
broken = TRUE, bp = 0.7, #this controls where the axis is cut
#bcontrol = (bp = 0.5, factor = "defult", style = "gap", width = "0.02"), #this controls how the cut is made but not working yet
conName = "Control",
cex =  1, cex.axis=2, lty=c(1, 2, 1), lwd=1, #size of: symbols, axis numbers, lines type, line thickness,  stuff
xlim = c(0,4), #Changes,  must be the same in the row below
ylim =c(-0.2,1.2),
xt = c(0, 1.5, 2, 3, 4), #Specify x numbers
yt = c(-0.2, 0.2, 0.6, 1), #Specify y number
xlab = expression("Concentration (" *mu ~ "M)"), line= 5, cex.lab =2,
ylab = "Inhibition of growth rate",
legend = TRUE, legendPos = c(1.2, 1), legendText=c(i,j, k), cex.legend = 1.5,
#legend = FALSE, legendPos = c(1.75, 1), legendText=c("1.5h", "3h", "5h"), cex.legend = 2,
main = title(main = "Cu", adj = 0.05, line = -2.5, cex.main = 2))
plot(bestDoseresponse_I.WB, col = "#2846FF", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
plot(bestDoseresponse_K.WB, col = "#008000", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
plot(bestDoseresponse_J.WB, col = "#990000", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
dev.copy(pdf, output)
dev.off()
dev.off()
dev.new(width=2.5, height=2.5)
par(mar=c(7,7,5,5))
plot(multi.m1,
type = "all",
col=c("#008000", "#2846FF", "#990000"),
broken = TRUE, bp = 0.7, #this controls where the axis is cut
#bcontrol = (bp = 0.5, factor = "defult", style = "gap", width = "0.02"), #this controls how the cut is made but not working yet
conName = "Control",
cex =  1, cex.axis=2, lty=c(1, 2, 1), lwd=1, #size of: symbols, axis numbers, lines type, line thickness,  stuff
xlim = c(0,4), #Changes,  must be the same in the row below
ylim =c(-0.2,1.2),
xt = c(0, 1.5, 2, 3, 4), #Specify x numbers
yt = c(-0.2, 0.2, 0.6, 1), #Specify y number
xlab = expression("Concentration (" *mu ~ "M)"), line= 5, cex.lab =2,
ylab = "Inhibition of growth rate",
legend = TRUE, legendPos = c(1.2, 1), legendText=c(i,j, k), cex.legend = 1.5,
#legend = FALSE, legendPos = c(1.75, 1), legendText=c("1.5h", "3h", "5h"), cex.legend = 2,
main = title(main = "Cu", adj = 0.05, line = -2.5, cex.main = 2))
plot(bestDoseresponse_I.WB, col = "#2846FF", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
plot(bestDoseresponse_K.WB, col = "#990000", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
plot(bestDoseresponse_J.WB, col = "#008000", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
dev.copy(pdf, output)
dev.off()
dev.off()
dev.new(width=2.5, height=2.5)
par(mar=c(7,7,5,5))
plot(multi.m1,
type = "all",
col=c("#008000", "#2846FF", "#990000"),
broken = TRUE, bp = 0.7, #this controls where the axis is cut
#bcontrol = (bp = 0.5, factor = "defult", style = "gap", width = "0.02"), #this controls how the cut is made but not working yet
conName = "Control",
cex =  1, cex.axis=2, lty=c(1, 2, 1), lwd=1, #size of: symbols, axis numbers, lines type, line thickness,  stuff
xlim = c(0,4), #Changes,  must be the same in the row below
ylim =c(-0.2,1.2),
xt = c(0, 1.5, 2, 3, 4), #Specify x numbers
yt = c(-0.2, 0.2, 0.6, 1), #Specify y number
xlab = expression("Concentration (" *mu ~ "M)"), line= 5, cex.lab =2,
ylab = "Inhibition of growth rate",
legend = TRUE, legendPos = c(1.2, 1), legendText=c(i,j, k), cex.legend = 1.5,
#legend = FALSE, legendPos = c(1.75, 1), legendText=c("1.5h", "3h", "5h"), cex.legend = 2,
main = title(main = "Cu", adj = 0.05, line = -2.5, cex.main = 2))
plot(bestDoseresponse_I.WB, col = "#008000", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
plot(bestDoseresponse_K.WB, col = "#2846FF", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
plot(bestDoseresponse_J.WB, col = "#990000", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
dev.copy(pdf, output)
dev.off()
dev.off()
dev.new(width=2.5, height=2.5)
par(mar=c(7,7,5,5))
plot(multi.m1,
type = "all",
col=c("#008000", "#2846FF", "#990000"),
broken = TRUE, bp = 0.7, #this controls where the axis is cut
#bcontrol = (bp = 0.5, factor = "defult", style = "gap", width = "0.02"), #this controls how the cut is made but not working yet
conName = "Control",
cex =  1, cex.axis=2, lty=c(1, 2, 1), lwd=1, #size of: symbols, axis numbers, lines type, line thickness,  stuff
xlim = c(0,4), #Changes,  must be the same in the row below
ylim =c(-0.2,1.2),
xt = c(0, 1.5, 2, 3, 4), #Specify x numbers
yt = c(-0.2, 0.2, 0.6, 1), #Specify y number
xlab = expression("Concentration (" *mu ~ "M)"), line= 5, cex.lab =2,
ylab = "Inhibition of growth rate",
legend = TRUE, legendPos = c(1.8, 1), legendText=c(i,j, k), cex.legend = 1.5,
#legend = FALSE, legendPos = c(1.75, 1), legendText=c("1.5h", "3h", "5h"), cex.legend = 2,
main = title(main = "Cu", adj = 0.05, line = -2.5, cex.main = 2))
plot(bestDoseresponse_I.WB, col = "#008000", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
plot(bestDoseresponse_K.WB, col = "#2846FF", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
plot(bestDoseresponse_J.WB, col = "#990000", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
dev.copy(pdf, output)
dev.off()
dev.off()
dev.new(width=2.5, height=2.5)
par(mar=c(7,7,5,5))
plot(multi.m1,
type = "all",
col=c("#008000", "#2846FF", "#990000"),
broken = TRUE, bp = 0.7, #this controls where the axis is cut
#bcontrol = (bp = 0.5, factor = "defult", style = "gap", width = "0.02"), #this controls how the cut is made but not working yet
conName = "Control",
cex =  1, cex.axis=2, lty=c(1, 2, 1), lwd=1, #size of: symbols, axis numbers, lines type, line thickness,  stuff
xlim = c(0,4), #Changes,  must be the same in the row below
ylim =c(-0.2,1.2),
xt = c(0, 1.5, 2, 3, 4), #Specify x numbers
yt = c(-0.2, 0.2, 0.6, 1), #Specify y number
xlab = expression("Concentration (" *mu ~ "M)"), line= 5, cex.lab =2,
ylab = "Inhibition of growth rate",
legend = TRUE, legendPos = c(1.5, 1), legendText=c(i,j, k), cex.legend = 1.5,
#legend = FALSE, legendPos = c(1.75, 1), legendText=c("1.5h", "3h", "5h"), cex.legend = 2,
main = title(main = "Cu", adj = 0.05, line = -2.5, cex.main = 2))
plot(bestDoseresponse_I.WB, col = "#008000", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
plot(bestDoseresponse_K.WB, col = "#2846FF", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
plot(bestDoseresponse_J.WB, col = "#990000", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
dev.copy(pdf, output)
dev.off()
dev.off()
dev.new(width=2.5, height=2.5)
par(mar=c(7,7,5,5))
plot(multi.m1,
type = "all",
col=c("#008000", "#2846FF", "#990000"),
broken = TRUE, bp = 0.7, #this controls where the axis is cut
#bcontrol = (bp = 0.5, factor = "defult", style = "gap", width = "0.02"), #this controls how the cut is made but not working yet
conName = "Control",
cex =  1, cex.axis=2, lty=c(1, 2, 1), lwd=1, #size of: symbols, axis numbers, lines type, line thickness,  stuff
xlim = c(0,4), #Changes,  must be the same in the row below
ylim =c(-0.2,1.2),
xt = c(0, 1.5, 2, 3, 4), #Specify x numbers
yt = c(-0.2, 0.2, 0.6, 1), #Specify y number
xlab = expression("Concentration (" *mu ~ "M)"), line= 5, cex.lab =2,
ylab = "Inhibition of growth rate",
legend = TRUE, legendPos = c(1.5, 1), legendText=c(i,j, k), cex.legend = 1.5,
#legend = FALSE, legendPos = c(1.75, 1), legendText=c("1.5h", "3h", "5h"), cex.legend = 2,
main = title(main = "Cu", adj = 0.05, line = -2.5, cex.main = 2))
plot(bestDoseresponse_I.WB, col = "#008000", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
plot(bestDoseresponse_J.WB, col = "#2846FF", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
plot(bestDoseresponse_K.WB, col = "#990000", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
dev.copy(pdf, output)
dev.off()
i="RO5"
j="RCu"
k="RC"
input1=paste("Files/Doseresponse_",i,".csv", sep="")
input2=paste("Files/Doseresponse_",j,".csv", sep="")
input3=paste("Files/Doseresponse_",k,".csv", sep="")
input_all=paste("Files/Doseresponse_",i,"_",j,"_",k,".csv", sep="") #need file with all data combined..
output=paste("Plots/Fig_",i,"_",j,"_",k,".pdf", sep="")
#First make the RO5 analysis
myDataI= read.csv2(input1, header=TRUE)
myDataI
#First look at the imported data
plot(myDataI$Concentration, myDataI$Inhibition) #$says which speific columns you will use
#drm = dose-response model for error plots (change model as needed)
fitDataI= subset(myDataI, myDataI$Concentration >=0)
bestDoseresponse_I.WB = drm(Inhibition~Concentration, data = fitDataI, fct = W2.2())
bestDoseresponse_I.WB #give you the intercepts
a = coef(bestDoseresponse_I.WB)[1]
b = coef(bestDoseresponse_I.WB)[2]
#First make the RO5 analysis
myDataJ= read.csv(input2, header=TRUE)
myDataJ
#First look at the imported data
plot(myDataJ$Concentration, myDataJ$Inhibition) #$says which speific columns you will use
#drm = dose-response model for error plots (change model as needed)
fitDataJ= subset(myDataJ, myDataJ$Concentration >=0)
bestDoseresponse_J.WB = drm(Inhibition~Concentration, data = fitDataJ, fct = W2.2())
bestDoseresponse_J.WB #give you the intercepts
a = coef(bestDoseresponse_J.WB)[1]
b = coef(bestDoseresponse_J.WB)[2]
#Then make the K-strain analysis
#Import data
myDataK= read.csv(input3, header=TRUE)
myDataK
#First look at the imported data
plot(myDataK$Concentration, myDataK$Inhibition) #$says which speific columns you will use
#drm = dose-response model for error plots (change model as needed)
fitDataK= subset(myDataK, myDataK$Concentration >=0)
bestDoseresponse_K.WB = drm(Inhibition~Concentration, data = fitDataK, fct = W2.2())
bestDoseresponse_K.WB #give you the intercepts
a = coef(bestDoseresponse_K.WB)[1]
b = coef(bestDoseresponse_K.WB)[2]
myData=read.csv2(input_all, header=TRUE)
myData
#First look at the imported data
plot(myData$Concentration, myData$Inhibition) #$says which speific columns you will use
#Fit the data using the Weibull1 model, fix the lower and upper limits
fitData= subset(myData, myData$Concentration >=0)
multi.m1 <- drm(Inhibition~Concentration, data = fitData, Running.ID, fct = W2.2())#define by which column strains are defined here Running.ID
#Choose colors to doubble plots
#Check ot this link for col funktion https://www.statmethods.net/advgraphs/parameters.html
#And http://research.stowers.org/mcm/efg/R/Color/Chart/
#generate RGB code for Green=SM
rgb(0, 128, 0, maxColorValue=255)
#RGB Blue=TB
rgb(40, 70, 255, maxColorValue=255)
#RGB Red
rgb(153, 0, 0, maxColorValue=255)
#Now i am working on a script to make nice looking plots with aid of:
#https://www.rdocumentation.org/packages/drc/versions/3.0-1/topics/plot.drc
#YES it makes a new window for each graph but whatever
dev.off()
dev.new(width=2.5, height=2.5)
par(mar=c(7,7,5,5))
plot(multi.m1,
type = "all",
col=c("#008000", "#2846FF", "#990000"),
broken = TRUE, bp = 0.7, #this controls where the axis is cut
#bcontrol = (bp = 0.5, factor = "defult", style = "gap", width = "0.02"), #this controls how the cut is made but not working yet
conName = "Control",
cex =  1, cex.axis=2, lty=c(1, 2, 1), lwd=1, #size of: symbols, axis numbers, lines type, line thickness,  stuff
xlim = c(0,4), #Changes,  must be the same in the row below
ylim =c(-0.2,1.2),
xt = c(0, 1.5, 2, 3, 4), #Specify x numbers
yt = c(-0.2, 0.2, 0.6, 1), #Specify y number
xlab = expression("Concentration (" *mu ~ "M)"), line= 5, cex.lab =2,
ylab = "Inhibition of growth rate",
legend = TRUE, legendPos = c(1.5, 1), legendText=c(i,j, k), cex.legend = 1.5,
#legend = FALSE, legendPos = c(1.75, 1), legendText=c("1.5h", "3h", "5h"), cex.legend = 2,
main = title(main = "Cu", adj = 0.05, line = -2.5, cex.main = 2))
plot(bestDoseresponse_I.WB, col = "#008000", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
plot(bestDoseresponse_J.WB, col = "#2846FF", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
plot(bestDoseresponse_K.WB, col = "#990000", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
dev.copy(pdf, output)
dev.off()
i="RO5"
j="RCu"
k="RC"
input1=paste("Files/Doseresponse_",i,".csv", sep="")
input2=paste("Files/Doseresponse_",j,".csv", sep="")
input3=paste("Files/Doseresponse_",k,".csv", sep="")
input_all=paste("Files/Doseresponse_",i,"_",j,"_",k,".csv", sep="") #need file with all data combined..
output=paste("Plots/Fig_",i,"_",j,"_",k,".pdf", sep="")
#First make the RO5 analysis
myDataI= read.csv2(input1, header=TRUE)
myDataI
#First look at the imported data
plot(myDataI$Concentration, myDataI$Inhibition) #$says which speific columns you will use
#drm = dose-response model for error plots (change model as needed)
fitDataI= subset(myDataI, myDataI$Concentration >=0)
bestDoseresponse_I.WB = drm(Inhibition~Concentration, data = fitDataI, fct = W2.2())
bestDoseresponse_I.WB #give you the intercepts
a = coef(bestDoseresponse_I.WB)[1]
b = coef(bestDoseresponse_I.WB)[2]
#First make the RO5 analysis
myDataJ= read.csv(input2, header=TRUE)
myDataJ
#First look at the imported data
plot(myDataJ$Concentration, myDataJ$Inhibition) #$says which speific columns you will use
#drm = dose-response model for error plots (change model as needed)
fitDataJ= subset(myDataJ, myDataJ$Concentration >=0)
bestDoseresponse_J.WB = drm(Inhibition~Concentration, data = fitDataJ, fct = W2.2())
bestDoseresponse_J.WB #give you the intercepts
a = coef(bestDoseresponse_J.WB)[1]
b = coef(bestDoseresponse_J.WB)[2]
#Then make the K-strain analysis
#Import data
myDataK= read.csv(input3, header=TRUE)
myDataK
#First look at the imported data
plot(myDataK$Concentration, myDataK$Inhibition) #$says which speific columns you will use
#drm = dose-response model for error plots (change model as needed)
fitDataK= subset(myDataK, myDataK$Concentration >=0)
bestDoseresponse_K.WB = drm(Inhibition~Concentration, data = fitDataK, fct = W2.2())
bestDoseresponse_K.WB #give you the intercepts
a = coef(bestDoseresponse_K.WB)[1]
b = coef(bestDoseresponse_K.WB)[2]
myData=read.csv2(input_all, header=TRUE)
myData
#First look at the imported data
plot(myData$Concentration, myData$Inhibition) #$says which speific columns you will use
#Fit the data using the Weibull1 model, fix the lower and upper limits
fitData= subset(myData, myData$Concentration >=0)
multi.m1 <- drm(Inhibition~Concentration, data = fitData, Running.ID, fct = W2.2())#define by which column strains are defined here Running.ID
#Choose colors to doubble plots
#Check ot this link for col funktion https://www.statmethods.net/advgraphs/parameters.html
#And http://research.stowers.org/mcm/efg/R/Color/Chart/
#generate RGB code for Green=SM
rgb(0, 128, 0, maxColorValue=255)
#RGB Blue=TB
rgb(40, 70, 255, maxColorValue=255)
#RGB Red
rgb(153, 0, 0, maxColorValue=255)
#Now i am working on a script to make nice looking plots with aid of:
#https://www.rdocumentation.org/packages/drc/versions/3.0-1/topics/plot.drc
#YES it makes a new window for each graph but whatever
dev.off()
dev.new(width=2.5, height=2.5)
par(mar=c(7,7,5,5))
plot(multi.m1,
type = "all",
col=c("#008000", "#2846FF", "#990000"),
broken = TRUE, bp = 0.7, #this controls where the axis is cut
#bcontrol = (bp = 0.5, factor = "defult", style = "gap", width = "0.02"), #this controls how the cut is made but not working yet
conName = "Control",
cex =  1, cex.axis=2, lty=c(1, 2, 1), lwd=1, #size of: symbols, axis numbers, lines type, line thickness,  stuff
xlim = c(0,4), #Changes,  must be the same in the row below
ylim =c(-0.2,1.2),
xt = c(0, 1.5, 2, 3, 4), #Specify x numbers
yt = c(-0.2, 0.2, 0.6, 1), #Specify y number
xlab = expression("Concentration (" *mu ~ "M)"), line= 5, cex.lab =2,
ylab = "Inhibition of growth rate",
legend = TRUE, legendPos = c(1.5, 1), legendText=c(i,j, k), cex.legend = 1.5,
#legend = FALSE, legendPos = c(1.75, 1), legendText=c("1.5h", "3h", "5h"), cex.legend = 2,
main = title(main = "Cu", adj = 0.05, line = -2.5, cex.main = 2))
plot(bestDoseresponse_I.WB, col = "#008000", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
plot(bestDoseresponse_J.WB, col = "#2846FF", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
plot(bestDoseresponse_K.WB, col = "#990000", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
dev.copy(pdf, output)
dev.off()
staple_pdf(input_directory = "./Plots" , input_files = NULL, output_filepath = "Plots/Fig_all.pdf")
dev.off()
dev.new(width=2.5, height=2.5)
par(mar=c(7,7,5,5))
plot(multi.m1,
type = "all",
col=c("#008000", "#2846FF", "#990000"),
broken = TRUE, bp = 0.7, #this controls where the axis is cut
#bcontrol = (bp = 0.5, factor = "defult", style = "gap", width = "0.02"), #this controls how the cut is made but not working yet
conName = "Control",
cex =  1, cex.axis=2, lty=c(1, 2, 1), lwd=1, #size of: symbols, axis numbers, lines type, line thickness,  stuff
xlim = c(0,4), #Changes,  must be the same in the row below
ylim =c(-0.2,1.2),
xt = c(0, 1.5, 2, 3, 4), #Specify x numbers
yt = c(-0.2, 0.2, 0.6, 1), #Specify y number
xlab = expression("Concentration (" *mu ~ "M)"), line= 5, cex.lab =2,
ylab = "Inhibition of growth rate",
legend = TRUE, legendPos = c(1.5, 1), legendText=c(i,j, k), cex.legend = 1.5,
#legend = FALSE, legendPos = c(1.75, 1), legendText=c("1.5h", "3h", "5h"), cex.legend = 2,
main = title(main = "Cu", adj = 0.05, line = -2.5, cex.main = 2))
plot(bestDoseresponse_I.WB, col = "#990000", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
plot(bestDoseresponse_J.WB, col = "#2846FF", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
plot(bestDoseresponse_K.WB, col = "#008000", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
dev.copy(pdf, output)
dev.off()
dev.off()
dev.new(width=2.5, height=2.5)
par(mar=c(7,7,5,5))
plot(multi.m1,
type = "all",
col=c("#008000", "#2846FF", "#990000"),
broken = TRUE, bp = 0.7, #this controls where the axis is cut
#bcontrol = (bp = 0.5, factor = "defult", style = "gap", width = "0.02"), #this controls how the cut is made but not working yet
conName = "Control",
cex =  1, cex.axis=2, lty=c(1, 2, 1), lwd=1, #size of: symbols, axis numbers, lines type, line thickness,  stuff
xlim = c(0,4), #Changes,  must be the same in the row below
ylim =c(-0.2,1.2),
xt = c(0, 1.5, 2, 3, 4), #Specify x numbers
yt = c(-0.2, 0.2, 0.6, 1), #Specify y number
xlab = expression("Concentration (" *mu ~ "M)"), line= 5, cex.lab =2,
ylab = "Inhibition of growth rate",
legend = TRUE, legendPos = c(1.5, 1), legendText=c(i,j, k), cex.legend = 1.5,
#legend = FALSE, legendPos = c(1.75, 1), legendText=c("1.5h", "3h", "5h"), cex.legend = 2,
main = title(main = "Cu", adj = 0.05, line = -2.5, cex.main = 2))
plot(bestDoseresponse_I.WB, col = "#008000", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
plot(bestDoseresponse_J.WB, col = "#2846FF", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
plot(bestDoseresponse_K.WB, col = "#008000", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
dev.copy(pdf, output)
dev.off()
dev.off()
dev.new(width=2.5, height=2.5)
par(mar=c(7,7,5,5))
plot(multi.m1,
type = "all",
col=c("#008000", "#2846FF", "#990000"),
broken = TRUE, bp = 0.7, #this controls where the axis is cut
#bcontrol = (bp = 0.5, factor = "defult", style = "gap", width = "0.02"), #this controls how the cut is made but not working yet
conName = "Control",
cex =  1, cex.axis=2, lty=c(1, 2, 1), lwd=1, #size of: symbols, axis numbers, lines type, line thickness,  stuff
xlim = c(0,4), #Changes,  must be the same in the row below
ylim =c(-0.2,1.2),
xt = c(0, 1.5, 2, 3, 4), #Specify x numbers
yt = c(-0.2, 0.2, 0.6, 1), #Specify y number
xlab = expression("Concentration (" *mu ~ "M)"), line= 5, cex.lab =2,
ylab = "Inhibition of growth rate",
legend = TRUE, legendPos = c(1.5, 1), legendText=c(i,j, k), cex.legend = 1.5,
#legend = FALSE, legendPos = c(1.75, 1), legendText=c("1.5h", "3h", "5h"), cex.legend = 2,
main = title(main = "Cu", adj = 0.05, line = -2.5, cex.main = 2))
plot(bestDoseresponse_I.WB, col = "#008000", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
plot(bestDoseresponse_J.WB, col = "#2846FF", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
plot(bestDoseresponse_K.WB, col = "#990000", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
dev.copy(pdf, output)
dev.off()
#generate RGB code for Green=SM
rgb(0, 128, 0, maxColorValue=255)
#RGB Blue=TB
rgb(40, 70, 255, maxColorValue=255)
#RGB Red
rgb(153, 0, 0, maxColorValue=255)
#YES it makes a new window for each graph but whatever
dev.off()
dev.new(width=2.5, height=2.5)
par(mar=c(7,7,5,5))
plot(multi.m1,
type = "all",
col=c("#008000", "#2846FF", "#990000"),
broken = TRUE, bp = 0.7, #this controls where the axis is cut
#bcontrol = (bp = 0.5, factor = "defult", style = "gap", width = "0.02"), #this controls how the cut is made but not working yet
conName = "Control",
cex =  1, cex.axis=2, lty=c(1, 2, 1), lwd=1, #size of: symbols, axis numbers, lines type, line thickness,  stuff
xlim = c(0,4), #Changes,  must be the same in the row below
ylim =c(-0.2,1.2),
xt = c(0, 1.5, 2, 3, 4), #Specify x numbers
yt = c(-0.2, 0.2, 0.6, 1), #Specify y number
xlab = expression("Concentration (" *mu ~ "M)"), line= 5, cex.lab =2,
ylab = "Inhibition of growth rate",
legend = TRUE, legendPos = c(1.5, 1), legendText=c(i,j, k), cex.legend = 1.5,
#legend = FALSE, legendPos = c(1.75, 1), legendText=c("1.5h", "3h", "5h"), cex.legend = 2,
main = title(main = "Cu", adj = 0.05, line = -2.5, cex.main = 2))
plot(bestDoseresponse_I.WB, col = "#008000", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
plot(bestDoseresponse_J.WB, col = "#2846FF", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
plot(bestDoseresponse_K.WB, col = "#990000", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
dev.copy(pdf, output)
dev.off()
i="RO5"
j="RC"
k="RCu"
input1=paste("Files/Doseresponse_",i,".csv", sep="")
input2=paste("Files/Doseresponse_",j,".csv", sep="")
input3=paste("Files/Doseresponse_",k,".csv", sep="")
input_all=paste("Files/Doseresponse_",i,"_",j,"_",k,".csv", sep="") #need file with all data combined..
output=paste("Plots/Fig_",i,"_",j,"_",k,".pdf", sep="")
#First make the RO5 analysis
myDataI= read.csv2(input1, header=TRUE)
myDataI
#First look at the imported data
plot(myDataI$Concentration, myDataI$Inhibition) #$says which speific columns you will use
#drm = dose-response model for error plots (change model as needed)
fitDataI= subset(myDataI, myDataI$Concentration >=0)
bestDoseresponse_I.WB = drm(Inhibition~Concentration, data = fitDataI, fct = W2.2())
bestDoseresponse_I.WB #give you the intercepts
a = coef(bestDoseresponse_I.WB)[1]
b = coef(bestDoseresponse_I.WB)[2]
#First make the RO5 analysis
myDataJ= read.csv(input2, header=TRUE)
myDataJ
#First look at the imported data
plot(myDataJ$Concentration, myDataJ$Inhibition) #$says which speific columns you will use
#drm = dose-response model for error plots (change model as needed)
fitDataJ= subset(myDataJ, myDataJ$Concentration >=0)
bestDoseresponse_J.WB = drm(Inhibition~Concentration, data = fitDataJ, fct = W2.2())
bestDoseresponse_J.WB #give you the intercepts
a = coef(bestDoseresponse_J.WB)[1]
b = coef(bestDoseresponse_J.WB)[2]
#Then make the K-strain analysis
#Import data
myDataK= read.csv(input3, header=TRUE)
myDataK
#First look at the imported data
plot(myDataK$Concentration, myDataK$Inhibition) #$says which speific columns you will use
#drm = dose-response model for error plots (change model as needed)
fitDataK= subset(myDataK, myDataK$Concentration >=0)
bestDoseresponse_K.WB = drm(Inhibition~Concentration, data = fitDataK, fct = W2.2())
bestDoseresponse_K.WB #give you the intercepts
a = coef(bestDoseresponse_K.WB)[1]
b = coef(bestDoseresponse_K.WB)[2]
myData=read.csv2(input_all, header=TRUE)
myData
#First look at the imported data
plot(myData$Concentration, myData$Inhibition) #$says which speific columns you will use
#Fit the data using the Weibull1 model, fix the lower and upper limits
fitData= subset(myData, myData$Concentration >=0)
multi.m1 <- drm(Inhibition~Concentration, data = fitData, Running.ID, fct = W2.2())#define by which column strains are defined here Running.ID
#Choose colors to doubble plots
#Check ot this link for col funktion https://www.statmethods.net/advgraphs/parameters.html
#And http://research.stowers.org/mcm/efg/R/Color/Chart/
#generate RGB code for Green=SM
rgb(0, 128, 0, maxColorValue=255)
#RGB Blue=TB
rgb(40, 70, 255, maxColorValue=255)
#RGB Red
rgb(153, 0, 0, maxColorValue=255)
#Now i am working on a script to make nice looking plots with aid of:
#https://www.rdocumentation.org/packages/drc/versions/3.0-1/topics/plot.drc
#YES it makes a new window for each graph but whatever
dev.off()
dev.new(width=2.5, height=2.5)
par(mar=c(7,7,5,5))
plot(multi.m1,
type = "all",
col=c("#008000", "#2846FF", "#990000"),
broken = TRUE, bp = 0.7, #this controls where the axis is cut
#bcontrol = (bp = 0.5, factor = "defult", style = "gap", width = "0.02"), #this controls how the cut is made but not working yet
conName = "Control",
cex =  1, cex.axis=2, lty=c(1, 2, 1), lwd=1, #size of: symbols, axis numbers, lines type, line thickness,  stuff
xlim = c(0,4), #Changes,  must be the same in the row below
ylim =c(-0.2,1.2),
xt = c(0, 1.5, 2, 3, 4), #Specify x numbers
yt = c(-0.2, 0.2, 0.6, 1), #Specify y number
xlab = expression("Concentration (" *mu ~ "M)"), line= 5, cex.lab =2,
ylab = "Inhibition of growth rate",
legend = TRUE, legendPos = c(1.5, 1), legendText=c(i,j, k), cex.legend = 1.5,
#legend = FALSE, legendPos = c(1.75, 1), legendText=c("1.5h", "3h", "5h"), cex.legend = 2,
main = title(main = "Cu", adj = 0.05, line = -2.5, cex.main = 2))
plot(bestDoseresponse_I.WB, col = "#008000", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
plot(bestDoseresponse_J.WB, col = "#2846FF", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
plot(bestDoseresponse_K.WB, col = "#990000", type = "confidence", xlim = c(0,4), lty=c(0), add = TRUE)
dev.copy(pdf, output)
dev.off()
