tiff("PvaluesLength.tiff",width=12.35,height=12.35,units="cm",res=300,pointsize=8) #setEPS() accum <- function(obs) { n=length(obs)+1 accumv<-seq(length=n,by=0,from=0) accumv[1]=sum(obs) for (i in 2:n) { accumv[i]=accumv[i-1]-obs[i-1] } accumv <- accumv/sum(obs) return(accumv) } X=read.table("../gapless/PDObs1000") accumPD<-accum(X[,2]) X=read.table("PDObs67_99") accumPD1<-accum(X[,2]) X=read.table("PDObs100_118") accumPD2<-accum(X[,2]) X=read.table("PDObs119_146") accumPD3<-accum(X[,2]) X=read.table("PDObs147_759") accumPD4<-accum(X[,2]) breaks=seq(0,1.0,0.001) par(mfrow=c(2,2)) par( mar =c(3,3.8,0.5,0.5)) plot(breaks,accumPD,type="l",xlab="PD-score",ylab="P-value", ylim=c(0,1), xlim=c(0,0.5)) lines(breaks,accumPD1,type="l",col="red") lines(breaks,accumPD2,type="l",col="blue") lines(breaks,accumPD3,type="l",col="green") lines(breaks,accumPD4,type="l",col="yellow") legend("topright",cex=0.8,title="Gapless Set",legend= c( "All lengths"," < 100","[100,118]","[119,146]", "> 146"), col = c("black","red","blue","green","yellow") , lwd=1, lty=c(1,1,1)) text(0.05,0,"PD-score", font=1) plot(breaks,accumPD,type="l",xlab="PD-score",ylab="P-value", log="y", ylim=c(1e-6,1), xlim=c(-0.01,0.5)) lines(breaks,accumPD1,type="l",col="red") lines(breaks,accumPD2,type="l",col="blue") lines(breaks,accumPD3,type="l",col="green") lines(breaks,accumPD4,type="l",col="yellow") text(0.05,1e-6,"PD-score", font=1) X=read.table("../gapless/TMObs1000") accumPD<-accum(X[,2]) X=read.table("TMObs67_99") accumPD1<-accum(X[,2]) X=read.table("TMObs100_118") accumPD2<-accum(X[,2]) X=read.table("TMObs119_146") accumPD3<-accum(X[,2]) X=read.table("TMObs147_759") accumPD4<-accum(X[,2]) plot(breaks,accumPD,type="l",xlab="TM-score",ylab="P-value",ylim=c(0,1), xlim=c(0,0.5)) lines(breaks,accumPD1,type="l",col="red") lines(breaks,accumPD2,type="l",col="blue") lines(breaks,accumPD3,type="l",col="green") lines(breaks,accumPD4,type="l",col="yellow") text(0.05,0,"TM-score", font=1) plot(breaks,accumPD,type="l",xlab="TM-score",ylab="P-value", log="y",ylim=c(1e-6,1), xlim=c(0,0.5)) lines(breaks,accumPD1,type="l",col="red") lines(breaks,accumPD2,type="l",col="blue") lines(breaks,accumPD3,type="l",col="green") lines(breaks,accumPD4,type="l",col="yellow") text(0.05,1e-6,"TM-score", font=1) dev.off()