# REF ALT miss-matching after split multi-allelic lines

**URL:** <https://discuss.hail.is/t/ref-alt-miss-matching-after-split-multi-allelic-lines/3778>\
**Category:** Hail Query & hailctl\
**Created:** [March 22, 2024, 4:14pm UTC](https://discuss.hail.is/t/ref-alt-miss-matching-after-split-multi-allelic-lines/3778 "2024-03-22T16:14:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wen\_He](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/wen_he/32/1110_2.png) [@Wen\_He](https://discuss.hail.is/u/Wen_He)\
**Post date:** [March 22, 2024, 4:14pm UTC](https://discuss.hail.is/t/ref-alt-miss-matching-after-split-multi-allelic-lines/3778/1 "2024-03-22T16:14:06Z")

</div>

Hello,

I am a researcher working with WGS data. I have a question about Hail function `split_multi_hts()` in splitting multi-allelic lines.

The position needs to be split in vcf looks:  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/hail/original/2X/5/59592311e36453bffbd3c72f1e5d6923f3469385.png)

As it shows, it is a multi allelic line with Ref “C” and ALT1 to 5 .  
The variant “1/2” which indicate “CAAAAAA:A” has 50 carrier.

The hail matrix table before split looks like:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/hail/original/2X/2/2c83ef0748c2ee5e97b0439a9fbae15bdbf8efd1.png)

after split:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/hail/original/2X/4/43a135bbfa3a46a319e46c39d5d28d4967e9ef40.png)

As it shown, the variant “CAAAAAA:A” in vcf is mistakenly shown as “C:A” after `split_multi_hts()` with 50 carrier. It looks hail can only take “C” as ref and does not consider the other ALT alleles as Ref during splitting.

Could you let me know if there is a fix for that? if not, what do you suggest to identify similar splitted variant like that?

Thank you!

Best,  
Wen

---

<div class="post-metadata">

**Author:** ![patrick-schultz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/patrick-schultz/32/265_2.png) [@patrick-schultz](https://discuss.hail.is/u/patrick-schultz)\
**Post date:** [March 25, 2024, 4:20pm UTC](https://discuss.hail.is/t/ref-alt-miss-matching-after-split-multi-allelic-lines/3778/2 "2024-03-25T16:20:57Z")

</div>

Hi @Wen_He,

I appologize if I am misunderstanding; I’m not a geneticist. But I believe this is working as intended. The [documentation](https://hail.is/docs/0.2/methods/genetics.html#hail.methods.split_multi_hts) for `split_multi_hts` goes into a lot of detail.

In particular, any sample with genotype `1/2` (i.e. `CAAAAAA:A`) before splitting will have, after splitting, genotype `0/1` at variant `["C", "A"]` and genotype `0/1` at variant `["C", "CAAAAAA"]`, and `0/0` at all other split variants at this locus.

---

<div class="post-metadata">

**Author:** ![Wen\_He](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/wen_he/32/1110_2.png) [@Wen\_He](https://discuss.hail.is/u/Wen_He)\
**Post date:** [March 27, 2024, 3:32am UTC](https://discuss.hail.is/t/ref-alt-miss-matching-after-split-multi-allelic-lines/3778/3 "2024-03-27T03:32:49Z")

</div>

Thanks @patrick-schultz !

For this multi allelic loci before split, the ref is “C” (0) and alt are CAAAAAA(1), A(2). If looking at the vcf line, the ref “C” is not the ref for the situation of “1/2”, which is “CAAAAAA:A”. (if C is ref , it would be “0/1” or “0/2” before split). So, after split, the “1/2” ref is “CAAAAAA” and the alt is “A”.

I agree with you that for the “0/1” after split is “C:CAAAAAA” and “0/2” after split is “C:A”, but not the “1/2”.

Please let me know if my understanding is mistaken. Thanks!

---

<div class="post-metadata">

**Author:** ![Wen\_He](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/wen_he/32/1110_2.png) [@Wen\_He](https://discuss.hail.is/u/Wen_He)\
**Post date:** [March 27, 2024, 3:39am UTC](https://discuss.hail.is/t/ref-alt-miss-matching-after-split-multi-allelic-lines/3778/4 "2024-03-27T03:39:50Z")

</div>

@danking @tpoterba could you please share some thoughts? Thanks!

---

<div class="post-metadata">

**Author:** ![patrick-schultz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/patrick-schultz/32/265_2.png) [@patrick-schultz](https://discuss.hail.is/u/patrick-schultz)\
**Post date:** [March 27, 2024, 1:52pm UTC](https://discuss.hail.is/t/ref-alt-miss-matching-after-split-multi-allelic-lines/3778/5 "2024-03-27T13:52:00Z")

</div>

Tim and Dan have sadly both left Hail for new adventures. 😢

> [@Wen\_He](#):
>
> For this multi allelic loci before split, the ref is “C” (0) and alt are CAAAAAA(1), A(2). If looking at the vcf line, the ref “C” is not the ref for the situation of “1/2”, which is “CAAAAAA:A”. (if C is ref , it would be “0/1” or “0/2” before split). So, after split, the “1/2” ref is “CAAAAAA” and the alt is “A”.

This isn’t how `split_multi_hts` works. The “notes” section of the documentation [here](https://hail.is/docs/0.2/methods/genetics.html#hail.methods.split_multi_hts) has an example 3-allelic variant worked out in detail. But in brief, the reference allele is never changed; it splits into two bi-allelic variants with the original reference and one of the two alt alleles. A call for an allele not represented in the split row is mapped to `0`, a call for the alt allele represented by this row is mapped to `1`, and ref calls stay `0`.
