Post date: Jun 25, 2015 6:45:13 PM
This R script (plotSelCand.R) is in /labs/evolution/projects/timema_speciation/timema_wgexmperiment/popgen
sc<-read.table("selectionCandidates.csv",header=TRUE,sep=",")
regs<-read.table("region20klist.txt",header=FALSE)
ll<-read.table("lgByScaf.txt",header=FALSE)
lgs<-rep(NA,dim(regs)[1])
for(i in 1:dim(regs)[1]){
lgs[i]<-ll[which(ll[,2]==regs[i,1]),1]
}
regs<-regs[order(lgs),]
slgs<-sort(lgs)
indxs<-which(regs[,1] %in% sc[,1] & regs[,2] %in% sc[,2])
pdf("sCandsLg.pdf",width=8,height=5)
par(mar=c(5,5,0.5,0.5))
plot(1:dim(regs)[1],type='n',ylim=c(0,1),cex.lab=1.5,axes=FALSE,xlab="20 kb window",ylab="selection candidates")
abline(v=indxs,col="red")
N<-length(slgs)
bnds<-which((slgs[2:N]-slgs[1:(N-1)]) != 0)
abline(v=bnds,col="darkgray",lty=2)
axis(1)
box()
dev.off()
pdf("sCandsLgV2.pdf",width=8,height=5)
par(mar=c(5,5,0.5,0.5))
plot(1:dim(regs)[1],type='n',ylim=c(0,1),cex.lab=1.5,axes=FALSE,xlab="20 kb window",ylab="selection candidates")
points(indxs,rep(0.5,25),cex=1.3,col="red")
N<-length(slgs)
bnds<-which((slgs[2:N]-slgs[1:(N-1)]) != 0)
abline(v=bnds,col="darkgray",lty=2)
axis(1)
box()
dev.off()