# Importing X chromosome bgen in Hail

**URL:** <https://discuss.hail.is/t/importing-x-chromosome-bgen-in-hail/353>\
**Category:** Help \[0.1\]\
**Created:** [November 7, 2017, 5:16pm UTC](https://discuss.hail.is/t/importing-x-chromosome-bgen-in-hail/353 "2017-11-07T17:16:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephane\_Bourgeois](https://avatars.discourse-cdn.com/v4/letter/s/f04885/32.png) [@Stephane\_Bourgeois](https://discuss.hail.is/u/Stephane_Bourgeois)\
**Post date:** [November 7, 2017, 5:16pm UTC](https://discuss.hail.is/t/importing-x-chromosome-bgen-in-hail/353/1 "2017-11-07T17:16:32Z")

</div>

Hi,

it seems Hail doesn’t want to import the chrX.bgen file I have, throwing the following error:

Hail version: 0.1-6e815ac  
Error summary: HailException: Hail only supports diploid genotypes. Found min ploidy equals `1' and max ploidy equals`2’.

I’ve seen in\_X\_PAR() and in\_X\_non\_PAR() in variants methods, so surely it should be possible to import the X chromosome, isn’t it? @tpoterba ?

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [November 9, 2017, 1:17pm UTC](https://discuss.hail.is/t/importing-x-chromosome-bgen-in-hail/353/2 "2017-11-09T13:17:15Z")

</div>

Hail’s infrastructure currently doesn’t support haploid genotypes, which is a big problem. Our internal genotype representation is inherently diploid, and we haven’t really thought about representing and computing on haploid genotypes. There’s some barebones stuff around the X chromosome for variants (is\_x\_non\_par, etc), but nothing on genotypes. We built in a diploid assumption to the bgen import partly due to this infrastructural limitation, and partly because we didn’t think chrX data was being released with the UKBB, the primary bgen use case.

As of right now there aren’t concrete plans to change this, but you should file an issue on github and I’ll flag this issue with the team today.

---

<div class="post-metadata">

**Author:** ![Stephane\_Bourgeois](https://avatars.discourse-cdn.com/v4/letter/s/f04885/32.png) [@Stephane\_Bourgeois](https://discuss.hail.is/u/Stephane_Bourgeois)\
**Post date:** [November 9, 2017, 1:36pm UTC](https://discuss.hail.is/t/importing-x-chromosome-bgen-in-hail/353/3 "2017-11-09T13:36:27Z")

</div>

UKBB imputed X chromosome will be released, though later than autosomes, but genotyped X is released (then people either use it non-imputed, or impute it themselves). There are important genes on the X chromosome, such as several coagulation factors.

Thanks for you help.

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [November 9, 2017, 1:37pm UTC](https://discuss.hail.is/t/importing-x-chromosome-bgen-in-hail/353/4 "2017-11-09T13:37:18Z")

</div>

That’s good information to know, I’ll see if we can reprioritize haploid infrastructure.

---

<div class="post-metadata">

**Author:** ![Stephane\_Bourgeois](https://avatars.discourse-cdn.com/v4/letter/s/f04885/32.png) [@Stephane\_Bourgeois](https://discuss.hail.is/u/Stephane_Bourgeois)\
**Post date:** [November 9, 2017, 1:43pm UTC](https://discuss.hail.is/t/importing-x-chromosome-bgen-in-hail/353/5 "2017-11-09T13:43:52Z")

</div>

Thank you. Should I raise the issue on Github, as you suggested?

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [November 9, 2017, 1:45pm UTC](https://discuss.hail.is/t/importing-x-chromosome-bgen-in-hail/353/6 "2017-11-09T13:45:03Z")

</div>

Yes, definitely! That gives us something to track.

---

<div class="post-metadata">

**Author:** ![Stephane\_Bourgeois](https://avatars.discourse-cdn.com/v4/letter/s/f04885/32.png) [@Stephane\_Bourgeois](https://discuss.hail.is/u/Stephane_Bourgeois)\
**Post date:** [November 9, 2017, 1:48pm UTC](https://discuss.hail.is/t/importing-x-chromosome-bgen-in-hail/353/7 "2017-11-09T13:48:16Z")

</div>

Done, issue #2407

Thanks again.
