ScatterPlot-File:6681.tm.png.R

From ZhangLabWiki
Jump to navigation Jump to search
d1<-read.table("dennis.hapinfo2mf.march28.txt",head=T,row.names=1)
d2<-read.table("dennis.hapinfo2mhl.march28.txt",head=T,row.names=1)
library("ggplot2")
library(RColorBrewer)
require(KernSmooth)
pdf("comp.smoothscatter.relationship.pdf")
par(mfrow=c(5,5),mar=c(1,1,1,1))
for(i in 1:25){
g = 11
n=length(d1[,i])
my.cols <- rev(brewer.pal(g, "RdYlBu"))
smoothScatter(d1[,i], d2[,i], nrpoints=0.05*n, colramp=colorRampPalette(my.cols), pch=19, cex=.3, col = "green1",xlab="",ylab="")
}
dev.off()
pdf("comp-2.smoothscatter.relationship.pdf")
par(mfrow=c(2,2),mar=c(2,2,2,2))
hist(d1[,1],breaks=10,main="MF",col="blue")
hist(d2[,1],breaks=10,main="MHL",col="blue")
plot(density(d1[,1],na.rm=T),main="MF",col="blue",lwd=2)
plot(density(d2[,1],na.rm=T),main="MHL",col="blue",lwd=2)
dev.off()