GP to DS conversion

Is there a way to go from bgen files with genotype probabilites to vcf files with genotype dosages?
I’m wondering if the gp_dosage can be extended to a full bgen file once imported? Or if Hail provides another way of annonating the genotypes?

Thank you!

I don’t understand what you mean by “extend to a full bgen file” since bgen files only contain the genotype probabilities (dosages) to begin with. But the matrix table commands ending in _entries are useful for working with the genotype (entry) level data. For example, use annotate_entries to annotate the genotypes:

You can then use export_vcf to export the matrix table as a VCF:

Yep, annotate_entries is what I was looking for and I’ve gp_dosage works nicely within that on the full matrixTable.

I’m trying to export it as a vcf but the SparkContext is being shut down. I’m using spark 2.2.0

Is that the only error message?

Where are you running Hail? Spark doesn’t like to run with too few resources, so trying to process UKBB on a single server might go badly.

I started up another thread with the full error of spark shutting down.
I’ve submitted it to more compute nodes to see if that works.