###Graphics for {PD,Tm} x {GS,XZ} x {Fold,Homology}### ### ### #Set working dir setwd("/home/recerca/public_html/ProtDeform/PDscore/Stat/probs20bins/") files <- dir() #index pair of index for files list, title =main, x=xlabel, y =ylabel,h=ylim plot4 <- function(index,title,y,x,h,s,k,phaseGS,phaseXZ){ read.table(files[index[1]],header=T)-> GS read.table(files[index[2]],header=T)-> XZ #twenty <- seq(1,100,5) GS[,1]<- GS[,1]-0.025 XZ[,1]<- XZ[,1]-0.025 plot(GS[,1],GS[,7],ylim=c(0,h),xlim=c(0,1),ylab=y, xlab=x,pch=21,lty=1,main=title, cex.main=0.8,cex.axis=0.8,cex.lab=0.8,cex=s) points(XZ[,1],XZ[,7],type="p",pch=22,bg="red",cex=s,col="red") lines(GS[,1],GS[,7]) lines(XZ[,1],XZ[,7],col="red") points(phaseGS,0.5,type="p",pch=23) points(phaseXZ,0.5,type="p",pch=23,col="red") } ##Fixing global parameters s <- 0.8 k <-5 h <- 1 nameplot <- "/home/recerca/public_html/ProtDeform/PDscore/Stat/PLOSfig8.tiff" par("Arial") tiff(nameplot,width=12.35,height=12.35,units="cm",res=300,pointsize=8) par(mfrow=c(2,2), mar =c(3,3.8,1,1)) ### Fold PD for GS and XZ sets index <- c(1,5) plot4(index,"Fold/Topology Posterior Probability" , "Probability", "",h,s,k,0.325,0.316) legend(0,1, c("GS set", "XZ set"), pch=c(21,22),cex=0.7,col=c("black","red") ) text(0.8,0.2,"PD-score",font=2) ### Homo PD for GS and XZ sets index <- c(2,6) plot4(index,"Superfamily/Homology Posterior Probability", "", "",h,s,k,0.473,0.404) text(0.8,0.2,"PD-score",font=2) par( mar =c(3,3.8,1,1)) h<- 1 ### Fold TM for GS and XZ sets index <- c(3,7) plot4(index,"Fold/Topology Posterior Probability", "Probability", "TM-score",h,s,k,0.556,0.518) text(0.8,0.2,"TM-score",font=2) ### Homo TM for GS and XZ sets index <- c(4,8) plot4(index,"Superfamily/Homology Posterior Probability", "", "TM-score",h,s,k,0.684,0.611) text(0.8,0.2,"TM-score",font=2) dev.off() setwd("../")