Smoothscatter.plot.monod.wb.R

From ZhangLabWiki
Jump to navigation Jump to search
setwd("/home/shg047/oasis/AgeBlood/mf")
mf<-read.table("/home/shg047/oasis/AgeBlood/mf/WB.mf.march22.txt",head=T,sep="\t",row.names=1)
mhl<-read.table("/home/shg047/oasis/AgeBlood/mhl/WB.mhl.march22.txt",head=T,sep="\t",row.names=1)
dim(mf)
dim(mhl)
sum(rownames(mf) == rownames(mhl))
n=nrow()
#smoothscatter
library(RColorBrewer)
require(KernSmooth)
pdf("mf-mhl.smoothscatter.relationship.pdf")
par(mfrow=c(3,3))
for(i in 1:3){
  g = 11
  n=length(mf[,i])
  my.cols <- rev(brewer.pal(g, "RdYlBu"))
  smoothScatter(mf[,i], mhl[,i], nrpoints=0.05*n, colramp=colorRampPalette(my.cols), pch=19, cex=.3, col = "green1",xlab="Methylation frequency",ylab="MHL")
}
dev.off()