All together
lib <- read.delim("libraries.txt", header=TRUE)
red_line <- mean(lib$PctReadsMappingBaboon[lib$Type=="blood"])
par(mfrow=c(3,1))
part <- lib[lib$Library=="A",]
barplot(part$PctReadsMappingBaboon, names.arg = part$ID,
las=2, ylim=c(0,100),
col=ifelse(part$Type=="blood","red","#835923"))
abline(h=red_line, col="red", lty=2, lwd=2)
part <- lib[lib$Library=="B",]
barplot(part$PctReadsMappingBaboon, names.arg = part$ID,
las=2, ylim=c(0,100),
col=ifelse(part$Type=="blood","red","#835923"))
abline(h=red_line, col="red", lty=2, lwd=2)
part <- lib[lib$Library=="C",]
barplot(part$PctReadsMappingBaboon, names.arg = part$ID,
las=2, ylim=c(0,100),
col=ifelse(part$Type=="blood","red","#835923"))
abline(h=red_line, col="red", lty=2, lwd=2)
par(mfrow=c(1,1))