# Help with "phase trio\_matrix by transmission"

**URL:** <https://discuss.hail.is/t/help-with-phase-trio-matrix-by-transmission/2396>\
**Category:** Hail Query & hailctl\
**Created:** [December 7, 2021, 1:03am UTC](https://discuss.hail.is/t/help-with-phase-trio-matrix-by-transmission/2396 "2021-12-07T01:03:11Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![CuriousGeneticist](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@CuriousGeneticist](https://discuss.hail.is/u/CuriousGeneticist)\
**Post date:** [December 7, 2021, 1:03am UTC](https://discuss.hail.is/t/help-with-phase-trio-matrix-by-transmission/2396/1 "2021-12-07T01:03:11Z")

</div>

Hi! I found this function in the experimental section and I am interested to use _phase\_trio\_matrix\_by\_transmission_. Let’s say I have a MatrixTable with three samples in “s” loaded in the “child, father, mother” order, will I be able to run the function with the mt as the sole argument?

---

<div class="post-metadata">

**Author:** ![CuriousGeneticist](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@CuriousGeneticist](https://discuss.hail.is/u/CuriousGeneticist)\
**Post date:** [December 7, 2021, 3:00am UTC](https://discuss.hail.is/t/help-with-phase-trio-matrix-by-transmission/2396/2 "2021-12-07T03:00:22Z")

</div>

As an update, I got this error message:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/hail/original/1X/026a56f7d5b9ff037441bc7678c9ccde05a21fe3.jpeg)  
Does anyone know what to make of it? Thank you so much!

---

<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:** [December 7, 2021, 11:59am UTC](https://discuss.hail.is/t/help-with-phase-trio-matrix-by-transmission/2396/3 "2021-12-07T11:59:30Z")

</div>

`hl.missing` was added somewhat recently to replace the deprecated `hl.null`. What version are you running?

---

<div class="post-metadata">

**Author:** ![CuriousGeneticist](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@CuriousGeneticist](https://discuss.hail.is/u/CuriousGeneticist)\
**Post date:** [December 7, 2021, 2:34pm UTC](https://discuss.hail.is/t/help-with-phase-trio-matrix-by-transmission/2396/4 "2021-12-07T14:34:24Z")

</div>

Thank you for your response. This is the version I am running:  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/hail/original/1X/fa40a02e442ff81a72d64fc8bc550d61d07a9434.png)  
I am using Hail on my institution’s cluster. What version would I need?  
Is there any way to get around this issue by changing hl.missing to hl.null in the function?

---

<div class="post-metadata">

**Author:** ![johnc1231](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/johnc1231/32/286_2.png) [@johnc1231](https://discuss.hail.is/u/johnc1231)\
**Post date:** [December 7, 2021, 2:40pm UTC](https://discuss.hail.is/t/help-with-phase-trio-matrix-by-transmission/2396/5 "2021-12-07T14:40:33Z")

</div>

If you changed all the `hl.missing` to `hl.null`, that’d probably work, assuming no other new errors crop up.

Your best bet would be updating to latest version of hail though.

---

<div class="post-metadata">

**Author:** ![CuriousGeneticist](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@CuriousGeneticist](https://discuss.hail.is/u/CuriousGeneticist)\
**Post date:** [December 7, 2021, 2:57pm UTC](https://discuss.hail.is/t/help-with-phase-trio-matrix-by-transmission/2396/6 "2021-12-07T14:57:55Z")

</div>

Thank you! It worked without any issues. However, all of my entries only show the proband. This is my trio information:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/hail/original/1X/76eb061ffb14de5ce30c605996f28a5f7ca18fd6.jpeg)  
However, when I try _father\_entry.GT.show()_ or _mother\_entry.GT.show()_, I get the genotype information for the proband:  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/hail/original/1X/7d0a92ce6e48752fb5600251c0031013ea912538.jpeg)  
This is the same for the _phased\_trio\_dataset_. Is there any way to resolve this? Thank you so much.

---

<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:** [December 7, 2021, 3:08pm UTC](https://discuss.hail.is/t/help-with-phase-trio-matrix-by-transmission/2396/7 "2021-12-07T15:08:24Z")

</div>

> [@CuriousGeneticist](#):
>
> However, when I try _father\_entry.GT.show()_ or _mother\_entry.GT.show()_ , I get the genotype information for the proband:

This is an incorrect interpretation – the H\_VT-8169 is the column key, but each column isn’t a sample, it’s a trio. The column is keyed by the proband identifier. When you `show()` an entry field of a matrix table, you see the row and column keys too. Here you’re showing the father\_entry genotype, but it’s printing out the associated proband ID.

---

<div class="post-metadata">

**Author:** ![CuriousGeneticist](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@CuriousGeneticist](https://discuss.hail.is/u/CuriousGeneticist)\
**Post date:** [December 7, 2021, 3:11pm UTC](https://discuss.hail.is/t/help-with-phase-trio-matrix-by-transmission/2396/8 "2021-12-07T15:11:46Z")

</div>

Oh, thank you for the interpretation! What would be the appropriate command to show the GT of PBT\_GT for the father and mother?

---

<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:** [December 7, 2021, 3:12pm UTC](https://discuss.hail.is/t/help-with-phase-trio-matrix-by-transmission/2396/9 "2021-12-07T15:12:50Z")

</div>

> [@CuriousGeneticist](#):
>
> What would be the appropriate command to show the GT of PBT\_GT for the father and mother

What’s PBG\_GT?

I think perhaps one thing you could try is `trio_dataset.entries().show()`

---

<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:** [December 7, 2021, 3:13pm UTC](https://discuss.hail.is/t/help-with-phase-trio-matrix-by-transmission/2396/10 "2021-12-07T15:13:23Z")

</div>

`entries()` is the coordinate-represented table produced from a matrix table – so showing this will print out one line per entry in the matrix table, left to right, top to bottom.

---

<div class="post-metadata">

**Author:** ![CuriousGeneticist](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@CuriousGeneticist](https://discuss.hail.is/u/CuriousGeneticist)\
**Post date:** [December 7, 2021, 4:43pm UTC](https://discuss.hail.is/t/help-with-phase-trio-matrix-by-transmission/2396/11 "2021-12-07T16:43:53Z")

</div>

That makes sense! Is it possible to count how many “NA” are there in each of the proband\_entry.PBT\_GT column? I want to check how many variants were phased out of all variants.
