I don't understand because for another dataset it worked. Anyway, I found this script that does it, just in case anybody in the future needs it:
https://github.com/bodkan/vcf2eigenstrat/blob/master/conversion.sh
Thanks @caleb_dume !
Heys,
I was trying to convert a vcf to a ped file format. However, when my samples had a genotype 0/0, it did not appear as 0 in my ped file. I am just obtaining 1 or 2 and the 0 are missing. This is the code I am using:
plink --bfile leopard1 --recode12 --out leopard1 --allow-extra-chr
I am using Plink v1.9
Thanks in advance!
You included the flag --recode12. The plink doc says --recode12 "will recode the alleles as 1 and 2 (and the missing genotype will always be 0)." Missing genotypes generally appear as ./. in a vcf and they would be coded as 0 0 (missing) in the ped file with the --recode12 flag. 0/0 would not appear as 0's in the ped file with the flags you included. Might recommend you check out the plink documentation for more on the recode flag.
I don't understand because for another dataset it worked. Anyway, I found this script that does it, just in case anybody in the future needs it:
https://github.com/bodkan/vcf2eigenstrat/blob/master/conversion.sh
Thanks @caleb_dume !
Log in to answer this question.