# UK Biobank DRAGEN WGS BGEN files use 16-bit probabilities that are incompatible with Hail

**URL:** <https://discuss.hail.is/t/uk-biobank-dragen-wgs-bgen-files-use-16-bit-probabilities-that-are-incompatible-with-hail/4108>\
**Category:** Hail Query & hailctl\
**Created:** [April 14, 2025, 7:03pm UTC](https://discuss.hail.is/t/uk-biobank-dragen-wgs-bgen-files-use-16-bit-probabilities-that-are-incompatible-with-hail/4108 "2025-04-14T19:03:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrewmagis](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@andrewmagis](https://discuss.hail.is/u/andrewmagis)\
**Post date:** [April 14, 2025, 7:03pm UTC](https://discuss.hail.is/t/uk-biobank-dragen-wgs-bgen-files-use-16-bit-probabilities-that-are-incompatible-with-hail/4108/1 "2025-04-14T19:03:58Z")

</div>

WGS DRAGEN BGEN files were recently released on UKBB.

Using HAIL 2.4 1 on a Spark cluster, I generated Hail index files using the following command in Python:

` hl.index_bgen(path=file_url,`  
` index_file_map={file_url:f"hdfs:///{filename}.idx2"},`  
` reference_genome="GRCh38",`  
` skip_invalid_loci=False)`

After the index creation completed successfully, I loaded the bgens into Hail matrix table using import\_bgen:

`mt = hl.import_bgen(path=bgen_file_map, `  
` entry_fields=['GT'],`  
` sample_file=f"file://{bgen_path}/ukb24309_c1_b0_v1.sample",`  
` n_partitions=None,`  
` block_size=None,`  
` index_file_map=index_file_map,`  
` variants=annotation_ht,)`

Finally, I computed an aggregate score using hl.agg.sum over all samples and a subset of variants.

When I tried to run this computation and write out a dataframe, I receive the following error:

_FatalError: HailException: Hail only supports 8-bit probabilities, found 16._

This occurs whether or not I load in the ‘GP’ entry field in Hail. It also occurs on Hail 2.3.1. Reviewing the Hail source code and documentation, it appears this is a fundamental limitation of Hail, which means the WGS DRAGEN BGEN files may not be usable by Hail.

I began a conversion to 8-bit BGENS with qctools, but it is very slow and not feasible to run across all the UKBB WGS data.

Has anyone else observed this issue and found a workaround?

---

<div class="post-metadata">

**Author:** ![chrisvittal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/chrisvittal/32/327_2.png) [@chrisvittal](https://discuss.hail.is/u/chrisvittal)\
**Post date:** [April 14, 2025, 7:30pm UTC](https://discuss.hail.is/t/uk-biobank-dragen-wgs-bgen-files-use-16-bit-probabilities-that-are-incompatible-with-hail/4108/2 "2025-04-14T19:30:09Z")

</div>

Thanks for letting us know about these new datasets. I’ve created a tracking issue so that we can add this support.

---

<div class="post-metadata">

**Author:** ![andrewmagis](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@andrewmagis](https://discuss.hail.is/u/andrewmagis)\
**Post date:** [April 15, 2025, 6:05pm UTC](https://discuss.hail.is/t/uk-biobank-dragen-wgs-bgen-files-use-16-bit-probabilities-that-are-incompatible-with-hail/4108/3 "2025-04-15T18:05:45Z")

</div>

Thanks! Does this mean support for 16 bit BGEN files?

---

<div class="post-metadata">

**Author:** ![chrisvittal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/chrisvittal/32/327_2.png) [@chrisvittal](https://discuss.hail.is/u/chrisvittal)\
**Post date:** [April 15, 2025, 6:10pm UTC](https://discuss.hail.is/t/uk-biobank-dragen-wgs-bgen-files-use-16-bit-probabilities-that-are-incompatible-with-hail/4108/4 "2025-04-15T18:10:11Z")

</div>

Eventually yes. I can’t give you a firm timeline at this point.

---

<div class="post-metadata">

**Author:** ![andrewmagis](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@andrewmagis](https://discuss.hail.is/u/andrewmagis)\
**Post date:** [May 12, 2025, 2:13pm UTC](https://discuss.hail.is/t/uk-biobank-dragen-wgs-bgen-files-use-16-bit-probabilities-that-are-incompatible-with-hail/4108/5 "2025-05-12T14:13:49Z")

</div>

Quick update on this. I had posted the same question to the UK Biobank community board, and they just replied:

> We do not have plans to release more versions of the DRAGEN WGS BGENs.  
> Over to the community for advise on using HAIL.

Here is the link to my post over there:  
[https://community.ukbiobank.ac.uk/hc/en-gb/community/posts/26542327941533-DRAGEN-WGS-BGEN-files-use-16-bit-probabilities-that-are-incompatible-with-Hail](https://community.ukbiobank.ac.uk/hc/en-gb/community/posts/26542327941533-DRAGEN-WGS-BGEN-files-use-16-bit-probabilities-that-are-incompatible-with-Hail)
