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:
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 !