Thank you Sam.
Is there a way to convert vcf.gz and vcf.gz.tbi to .ped and .info with R? I have no previous experience with PLINK. Of course I may have to learn PLINK if I have to.
I downloaded SNP data from the webpage you suggested. Taking Chr16 as an example, I downloaded 1kg_phase1_chr16.tar.gz file, which is first decompressed to a .tar file, which is further decompressed to 3 files in .bed, .bim, and .fam format. I then used the code below to load the three files into R:
library(snpStats); path <- "D:\Downloads"; snps <- read.plink(file.path(path, "1kg_phase1_chr16"), na.strings = ("-9"))
However, I was returned the error message:
Error in .rowNamesDF<-(x, value = value) :
duplicate 'row.names' are not allowed
In addition: Warning message:
non-unique value when setting 'row.names': ‘.’
The above code worked well when I was loading the bed/bim/fam files for the GWAS paper I mentioned earlier but not for those downloaded from your recommended page. It would be highly appreciated if anyone could help with this error. Thank you.