NA causes export errors out

I was trying to export a MatrixTable to Plink or VCF format. Both error out due to NA.

My export_plink code is:
hl.export_plink(mt, filePrefix+‘.HailQC’, ind_id = mt.s)

and it returns:
FatalError: HailException: unphased_diploid_gt_index only supports ploidy == 2. Found 0.

My export_vcf code is:
hl.export_vcf(mt, filePrefix+‘.HailQC.vcf’)

and it returns:
FatalError: HailException: VCF spec does not support phased haploid calls.

Both worked after I dropped variants that has NAs. My Hail version is 0.2.126-ee77707f4fab.

Please help. Thank you!

Hi @MCMC, sorry you’re running into difficulty!

This isn’t about NAs. Your dataset has monoploid calls in it. export_vcf should be able to handle that, but there’s a bug which was fixed in this PR, which will be in the next release (which should be this week).

export_plink does not support monoploid calls. See the docs here for details.

Hi @patrick-schultz , thank you for your reply.

This is human variants called from WGS. Is it normal that it contains monoploid calls? Is it because of the sex chromosomes?

That’s most likely, yeah.

Thank you!