This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to plot LD decay?

I have a text file with 3 columns (Chromosome number, Distance (BP) and r2). I want to plot LD decay for this data. Can anyone suggest how to do it? Here is the sample data

CHR dist(bp)    r2
1   179160  0.03667880237
1   203115  0.007792207792
1   352949  0.0002724548179
1   389133  0.1577922078
1   464090  0.02009569378
1   829774  0.06714562034
1   1246697 0.01298701299
1   1698946 0.6255411255
1   1888668 0.003541912633
ld r2

install.packages("ggplot2") library(ggplot2)

ggplot(file, aes(dist(bp), r2)) + geom_point() + geom_smooth(formula = newfile$file.dist(bp) ~ newfile$newr2, se=F)

1 answer

See previous answer: A: LD-decay in a r2 vs distance(cm) plot

Kevin

Log in to answer this question.