plink2 export tped 12 not working as expected

Hi,

When I take a VCF file, convert it to plink, and then export it as a tped, the modifier ’12’ does not work as expected. I thought this modifier causes ALT1 alleles to be coded as ‘1’ and REF alleles as ‘2’. However, it appears to code REF alleles as ‘1’ and ALT1 alleles as ‘2’.

Sample commands and data follow:

Commands

plink2 –vcf ${vcf}  –make-pgen –out ${pfile_prefix}
plink2 –pfile ${pfile_prefix} –export tped 12 –output-missing-genotype 0 –out ${tped_prefix}

VCF data

#CHROM  POS     ID      REF     ALT     QUAL    FILTER  INFO    FORMAT  S1      S2      S3      S4
1       1691    .       C       T       .       PASS    AC=1;AN=8       GT      0|0     0|0     0|0     1|0
1       1800    .       G       A       .       PASS    AC=7;AN=8       GT      1|1     1|1     1|1     1|0

TPED data (note that a VCF entry of 0 is 1 in the tped)

1       .       0       1691    1       1       1       1       1       1       2       1
1       .       0       1800    2       2       2       2       2       2       2       1

Read more here: Source link