10
$\begingroup$

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!

$\endgroup$
2
  • 1
    $\begingroup$ 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! $\endgroup$
    – gaelgarcia
    May 9 '18 at 3:07
  • $\begingroup$ 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. $\endgroup$
    – Sarah
    May 10 '18 at 5:07
6
$\begingroup$

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.

$\endgroup$
3
  • 1
    $\begingroup$ How does PLINK know what to write to the .fam file, since it's only taking the VCF as input? $\endgroup$
    – gaelgarcia
    May 9 '18 at 3:08
  • 1
    $\begingroup$ It looks like PLINK uses the sample IDs to create family/individual IDs, see "Variant Call Format" section on this page. $\endgroup$
    – Sarah
    May 10 '18 at 5:10
  • $\begingroup$ @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. $\endgroup$
    – Sarah
    Nov 7 '18 at 23:08
2
$\begingroup$

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)

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.