# Importing XY psuedoautosomal data into hail

**URL:** <https://discuss.hail.is/t/importing-xy-psuedoautosomal-data-into-hail/778>\
**Category:** Hail Query & hailctl\
**Created:** [November 19, 2018, 5:44pm UTC](https://discuss.hail.is/t/importing-xy-psuedoautosomal-data-into-hail/778 "2018-11-19T17:44:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Liz\_Cirulli](https://avatars.discourse-cdn.com/v4/letter/l/3d9bf3/32.png) [@Liz\_Cirulli](https://discuss.hail.is/u/Liz_Cirulli)\
**Post date:** [November 19, 2018, 5:44pm UTC](https://discuss.hail.is/t/importing-xy-psuedoautosomal-data-into-hail/778/1 "2018-11-19T17:44:53Z")

</div>

What is the currently recommended method for importing pseudoautosomal XY data into hail? I am using the UKBB imputed data in bgen format for the XY chromosome. I note that if you try to load the data as XY, it errors with:

Hail version: 0.2-961f76d14f1e  
Error summary: HailException: Invalid locus `XY:60014' found. Contig`XY’ is not in the reference genome `GRCh37’.

If you translate the bgen so that XY is just coded as X instead, it errors with:

Hail version: 0.2-961f76d14f1e  
Error summary: HailException: Hail only supports diploid genotypes. Found min ploidy `1' and max ploidy`2’.

If you translate the bgen so that XY is coded as chr 1 just to see what happens, it errors with:

Hail version: 0.2-961f76d14f1e  
Error summary: HailException: Hail only supports 8-bit probabilities, found 16.

I am guessing that there are some specific genotypes in the XY file that it doesn’t like, but I’m not sure what I am looking for.

---

<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 19, 2018, 11:11pm UTC](https://discuss.hail.is/t/importing-xy-psuedoautosomal-data-into-hail/778/2 "2018-11-19T23:11:02Z")

</div>

Which BGEN file is this coming from?

We designed import\_bgen to work with the v2 release of UKBB. If there is a newer release, we should support that.

---

<div class="post-metadata">

**Author:** ![Liz\_Cirulli](https://avatars.discourse-cdn.com/v4/letter/l/3d9bf3/32.png) [@Liz\_Cirulli](https://discuss.hail.is/u/Liz_Cirulli)\
**Post date:** [November 20, 2018, 3:11pm UTC](https://discuss.hail.is/t/importing-xy-psuedoautosomal-data-into-hail/778/3 "2018-11-20T15:11:54Z")

</div>

ah, this seems to be v3: ukb\_imp\_chrXY\_v3.bgen ([https://biobank.ctsu.ox.ac.uk/crystal/refer.cgi?id=1125](https://biobank.ctsu.ox.ac.uk/crystal/refer.cgi?id=1125)). note the first variant is shown as chr PAR, then it switches to chr XY after that… but regardless of how I re-code the chr it won’t load.
