cd DIRECTORY_WITH_DATA ## mac: cp ../osx/* . #copy programs to current directory ./selscan --ihs --map CEU.chr2.map --hap CEU.chr2.ihshap --out CEU.chr2 ./norm --ihs --files CEU.chr2.ihs.out bg.ihs.out ## linux: cp ../linux/* . #copy programs to current directory ./selscan --ihs --map CEU.chr2.map --hap CEU.chr2.ihshap --out CEU.chr2 ./norm --ihs --files CEU.chr2.ihs.out bg.ihs.out ## windows: cp ..\win\* . #copy programs to current directory selscan.exe --ihs --map CEU.chr2.map --hap CEU.chr2.ihshap --out CEU.chr2 norm.exe --ihs --files CEU.chr2.ihs.out bg.ihs.out ## R commands setwd("DIRECTORY_WITH_DATA") CEU=read.table("CEU.chr2.ihs.out.100bins.norm") plot(CEU[,2], CEU[,7]) #normalized iHS values plot(CEU[,2], abs(CEU[,7])) # absolute value of normalized iHS values ## let's smooth this data with loess!! SP=0.2 #this is the span, a parameter you can change (higher = more smoothing) CEU.x=CEU[,2]; #the x-coordinates in Mb y=abs(CEU[,7]) #iHS is actually the absolute value CEU.loess=loess(y~CEU.x,span=SP,data.frame(x=CEU.x,y=y)); #step 1 CEU.predict=predict(CEU.loess,data.frame(x=CEU.x)); #step 2 plot(CEU[,2], abs(CEU[,7])) # absolute value of normalized iHS values lines(CEU.x, CEU.predict, lwd=2, col='blue')