Hello,
I use plink2 quite frequently for my research, and I've run into an issue that I know is a known problem concerning haps files. I need to generate a genotype matrix (012) to run some phenotypic simulations, and what used to work (or maybe I didn't catch this problem until now) no longer does. Before, I think I used plink-ng (? now deprecated for a year or more) to convert beagle files into haps files to then use farther down my pipeline. Recently I realized that if I run this code (as seen in my first screenshot where I run the --vcf flag), I get an N haps file rather than a 2N, as I thought I was getting.
This throws a huge wrench into my pipeline, so I thought to use bcftools to generate the haps/legend files instead and generate the geno matrix from those as before. However, I continually get this error (second screenshot of terminal output). However, I have checked and there is no header column, and the format of this file is as is expected for a haps file--and I believe that these flags allow for both 2N and 2N +5 meta fields, and I have tried both with no success. I've also tried changing the legend flag arguments, no success (third screenshot). Essentially I just want to take these haps files, convert to bed files, then generate the genotype matrix. My concern is that if these files fail at this step, they will fail at other steps on my pipeline that also use plink2 utility for haps files. For context, I'm uploading my screenshot of the code I used to generate the haps and legend files with bcftools.
Included in this email are files to reproduce my error, any guidance or insight is much appreciated.