<p>Hi everyone:</p>

<p>I am trying to plot the linkage disequilibrium decay across the genome using genome-wide snps and get a plot that looks something like this:</p>

<p><a href='http://postimg.org/image/5bkdju6jx/'>http://postimg.org/image/5bkdju6jx/</a></p>

<p>In the methods sections the authors specified that they used the --r2 command in plink. I read the details of this command in the plink website, but I am still not sure how should I use the output file to plot a similar thing. </p>

<p>Any help would be really appreciated. </p>

<p>Thank you in advance.</p>

<p>Javier</p>

<p>Ps: Heres the article's title: Population Genetic Structure of the People of Qatar (2010)</p>

<p>In the plink.ld file you have colums CHR_A, BP_A, SNP_A, CHR_B, BP_B, SNP_B and R2.</p>

<p>in R do</p>

<pre><code># install and load ggplot2
install.packages("ggplot2")
library(ggplot2)

# import the data
ld &lt;- read.table("plink.ld", sep="\t",header=T)

# plot the average correlation for each snp distance
ggplot(ld) +
geom_line(aes(x=BP_B - BP_A, y = R2))
</code></pre>
