How to use 1000 Genomes data for LDheatmap package in R
Entering edit mode
7.9 years ago
mqzhu ▴ 10

I am trying to visualize LD blocks within 1Mb flanking a SNP. And I don't want to use Haploview because it uses Hap Map 3 (build 17 assembly) which is quite outdated. So I downloaded SNP data from 1000 Genomes phase 3, using the online tool "VCF to PED converter". I got .ped and .info files. Then I used an R package ‘LDheatmap’ (which can calculate the LD in r^2 and can visualize LD in heatmap). But the files (.ped, .info files) from 1000 Genomes are not compatible input files for LDheatmap.

The example data set for LDheatmap, "CEUData", contains a data frame and a vector. The format is like this:

  • CEUSNP: A dataframe of SNP genotypes. Each row represents an individual. Each column represents a SNP. SNP IDs are headers of each column.
  • CEUDist: A vector of integers, representing SNP physical map locations on the chromosome.

Does any one know how to convert .ped and .info files from 1000 Genomes into compatible input files (dataframe and vector) for LDheatmap package in R?

SNP R lingkage ldheatmap heatmap • 4.2k views
Entering edit mode

You could use Haploview with the downloaded 1000 data.

Entering edit mode

Did you ever fix this?

Entering edit mode
2.2 years ago
Rashmi ▴ 20

Hi I am hoping you had worked this out. For others coming here, hope the following works for you.

Once you have .ped and .info file, use the second script provided in this link to create a MAP file from INFO file.

Once you have your map file, you can use PLINK to get your LD matrix, which can then be plotted in R. I haven't used LDheatmap but have used LD.plot from package 'gaston' in R to plot LD.

1) to get LD matrix, name your ped file and map file with same name eg. eur.ped and

plink1.9 --file eur -r2 square --out eur

2) to draw your LD plot

m <- read.csv(eur.ld, sep="\t", header=F)
names <- read.csv(, sep="\t", header=F)
LD.plot(m, names[,2], draw.chr=TRUE,

Login before adding your answer.

Traffic: 2626 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6