changed<-subset(y, (y$PValue <0.05)&((y$logFC<=-1.5)|(y$logFC>=1.5)))
change_up<-subset(y, (y$PValue <0.05)&(y$logFC>=1.5))
change_down<-subset(y, (y$PValue <0.05)&(y$logFC<=-1.5))

plot(log2(y[,15]),log2(y[,16]), col= "grey", ylab="log2(RPKM_m0_wt_translation)", xlab = "log2(RPKM_m0_wt_translation)", main="m0 translation", pch=20,cex=0.8)
points(log2(change_up[,15]),log2(change_up[,16]), col= "green", pch=20,cex=0.8)
points(log2(change_down[,15]),log2(change_down[,16]), col= "red", pch=20,cex=0.8)
#plot(log2(y[,15]),log2(y[,16]), col= "grey", ylab="m0_wt_translation", xlab = "m0_wt_translation", main="m0 translation", pch=20,cex=0.8, xlim = c(-20,20), ylim = c(-15, 15))
#plot(log2(y[,15]),log2(y[,16]), col= "grey", ylab="m0_wt_abundance", xlab = "m0_wt_abundance", main="m0 abundance", pch=20,cex=0.8)
#plot(log2(y[,15]),log2(y[,16]), col= "grey", ylab="m0_wt_abundance", xlab = "m0_wt_abundance", main="m0 abundance", pch=20,cex=0.8, xlim = c(-20,20), ylim = c(-15, 15))
points(opposite_change_dn_up$logFC.x,opposite_change_dn_up$logFC.y, col="red", pch="*")
points(opposite_change_up_dn$logFC.x,opposite_change_up_dn$logFC.y, col="red", pch="*")
points(homodirect_up$logFC.x,homodirect_up$logFC.y, col="green", pch="*")
points(homodirect_down$logFC.x,homodirect_down$logFC.y, col="green", pch="*")
points(transcr_only$logFC.x,transcr_only$logFC.y, col="blue", pch="*")
points(translation_only$logFC.x,translation_only$logFC.y, col="yellow", pch="*")
#@@ scatterplot fit least square fit line
abline(lsfit(y$logFC.x,y$logFC.y),col=2)
legend("topright", "spearman 0.060",  bty = "n", cex = 0.60)
legend("bottomright", c("transcriptome only","translatome only", "homodirectional","opposite change"),  fill = c("blue","yellow", "green", "red"), bty = "n", cex = 0.60)

cor.test(y[,15], y[,16], method = "spearman")
