How To Convert Vcf File To Plink Ped Format?
5
4
Entering edit mode
10.6 years ago

This is my first post to Biostar,

I have a VCF file containing variants, i want to convert to PLINK PED format.

I have tried using, vcftools --vcf *.vcf --plink

But when i input this file into WGAViewer it says "SNP and p value cannot be the same", Why?

Is there any other software to convert vcf to plink ped format?

Thanks.

vcftools • 31k views
0
Entering edit mode

could you post some lines of the output that you obtain with your vcftools command?

3
Entering edit mode
7.1 years ago
Lídia ▴ 80

I have read that GATK has also a tool to do this conversion. It is called VariantsToBinaryPed. I have not used it yet but it looks useful and I will give it a try!

0
Entering edit mode

Has anyone used this successfully? I tried, but it asks me for a metadata file with an extension of .fam. Given that I am trying to create this very file (i.e. .bim, .bed, and .fam) it confused me. I couldn't find a good article to explain how this works!

1
Entering edit mode

I am still new to using PLINK and variant calling in general, so someone with more experience may correct me if needed. For my purposes I generally have a VCF file that I need to convert to PLINK for certain things. When I do this I manually create the .fam file for all my samples. I'm not sure of any other way as the information needed in the .fam file is not stored in the VCF file. It is meta information about your samples. This link here (https://www.cog-genomics.org/plink2/formats#fam) gives a good explanation of the .fam file format.

0
Entering edit mode

@alolex, Do you do this using the above mentioned tool from GATK VariantsToBinaryPed? Or with PLINK's --make-bed?

2
Entering edit mode
10.4 years ago

Hello Ketan,

the vcftools 'plink' format is the ped ('pedigree') format that plink uses as primary INPUT. WGAViewer accepts the OUTPUT of plink (the association tests) and display you the pvalues in a genomic view.

A ped file (and its companion map file) does not contain any p-value. The p-values can be obtained doing the association test with plink (see the plink manual).

As you can see from the error you have "SNP and p value cannot be the same" WGAViewer wants a file with p-values not the ped files.

0
Entering edit mode

hello,i want to know how can i convert the hapmap genotypes data to plink format? i use peas first to convert to normal format and then to plink_in format. it creats several output files but without map file. BUt the pedsnp file seems to be the same with map file.

But when i load into plink, it turns out to be wrong with message:ped collume wrong.

so could any body tell me how to do this work?

1
Entering edit mode
7.7 years ago

Check out Plink 1.9 an alpha version of plink with VCF support.

1
Entering edit mode
7.1 years ago
dweeks.pitt ▴ 40

The Mega2 program can convert from VCF to PLINK format.

0
Entering edit mode
9.3 years ago
user56 ▴ 300

You can work with VCFs in R.

file='e:/d/genome/yourVCF.txt'
str(v)


The UTF-16 encoding was particularly hard to troubleshoot. Eventually Notepad++ helped me to detect this encoding problem.

It correctly ignores the header lines and detects column headers as well.