# Converting VCF file to PLINK bed/bim/fam files

I am trying to find the best way to convert VCF files to PLINK binary bed/bim/fam files, but it seems like there are many varied ways to do this. (For example, using Plink 1.9 --vcf tag, bcftools, GATK, and vcftools).

Obviously they all probably have their uses and you could likely spend a while discussing this, but can anyone give a short, simple explanation as to whether the methods are generally the same, or whether one or another is generally best for certain situations? Thanks!

• Hi Sarah, did you end up preferring one method over the other? I'm on the same boat you were a few months ago, just trying to get an overview of the different methods to do this. Thanks! May 9 '18 at 3:07
• Hi @gaelgarcia! So after talking more with my PI I realized I was mistaken and didn't have to convert the VCF files to plink, but I've used other plink commands that have seemed to work well and I expect that the plink --vcf command will work fine. Do be careful if you care about which alleles are major/minor, as sometimes the order gets switched around in plink. For more info see "Variant Call Format" section on this page. May 10 '18 at 5:07

Given that Plink reads in VCF files natively, and Plink is your desired output format, I expect that plink --vcf <file> would be the best option.

There are caveats associated with the types of variants that Plink will pull in from the VCF files, mostly related to limitations of Plink's own file formats. But if your end-goal is Plink, then that should be fine.

• How does PLINK know what to write to the .fam file, since it's only taking the VCF as input? May 9 '18 at 3:08
• It looks like PLINK uses the sample IDs to create family/individual IDs, see "Variant Call Format" section on this page. May 10 '18 at 5:10
• @gaelgarcia did you ever figure out how it knows what to write to the fam file? I am working with a different dataset now and I am having trouble figuring out the best way to get the fam files to be written correctly. Nov 7 '18 at 23:08

Additional tidbit I learned in the last year that I wanted to share with anyone else that's working on this.

Plink creates an extremely generic fam file for you, but if you are updating this fam file to reflect your population's family structure, sex, etc., note that when using plink binary files (bed/bim/fam) the order of the individuals in the fam file needs to match the order of the individuals in the other files (which is the order of the individuals in the generic fam file)

• It's vcftools that requires the --gzvcf flag. plink --vcf can handle gzipped VCFs. Mar 1 '19 at 16:24
• Thanks @ChristopherChang I'll fix that in the answer Mar 4 '19 at 18:27