# Identify inherited variants in trio matrix

**URL:** <https://discuss.hail.is/t/identify-inherited-variants-in-trio-matrix/2591>\
**Category:** Hail Query & hailctl\
**Created:** [April 7, 2022, 8:51pm UTC](https://discuss.hail.is/t/identify-inherited-variants-in-trio-matrix/2591 "2022-04-07T20:51:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![qing](https://avatars.discourse-cdn.com/v4/letter/q/e99b99/32.png) [@qing](https://discuss.hail.is/u/qing)\
**Post date:** [April 7, 2022, 8:51pm UTC](https://discuss.hail.is/t/identify-inherited-variants-in-trio-matrix/2591/1 "2022-04-07T20:51:28Z")

</div>

Hi,

I have a question regarding using the trio matrix to identify inherited variants?

I have already identified de novo variants, but do not find a function that could identify inherited variants. Besides, the property that variants are inherited from either one parent, I would also want to put a filter on the variants, such as GQ should be above 25, heterozygous genotypes with allele balance above 0.3.

Here’s the beginning of my code:  
pedigree = hl.Pedigree.read(‘SSC.fam’)  
mt\_pass\_QC\_trio\_dataset = hl.trio\_matrix(mt\_pass\_QC, pedigree, complete\_trios=True)

Any help would be appreciated.

Thank you.

---

<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:** [April 7, 2022, 8:52pm UTC](https://discuss.hail.is/t/identify-inherited-variants-in-trio-matrix/2591/2 "2022-04-07T20:52:57Z")

</div>

What inheritance pattern are you looking for? I’d think that every heterozygous call in a proband is inherited, unless both parents are homozygous reference.

---

<div class="post-metadata">

**Author:** ![qing](https://avatars.discourse-cdn.com/v4/letter/q/e99b99/32.png) [@qing](https://discuss.hail.is/u/qing)\
**Post date:** [April 8, 2022, 1:35am UTC](https://discuss.hail.is/t/identify-inherited-variants-in-trio-matrix/2591/3 "2022-04-08T01:35:48Z")

</div>

Thanks for your reply.

I think my question can be separated as:

1. how to identify heterozygous variants.
2. how to identify which heterozygous variants are from the proband.

Should I start from the trio matrix or the matrix table (mt\_pass\_QC in my example)? I saw the data structure is quite different in the trio matrix compared with the matrix table. But I thought trio matrix might be more accessible for variants in proband identification.

Thank you!

---

<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:** [April 8, 2022, 11:35am UTC](https://discuss.hail.is/t/identify-inherited-variants-in-trio-matrix/2591/4 "2022-04-08T11:35:23Z")

</div>

Starting from the trio matrix is going to be the right launching point for both, I think.

You can filter to entries that are heterozygous in the proband as follows:

```auto
tm = mt_pass_QC_trio_dataset # short name
tm_het = tm.filter_entries(tm.proband_entry.GT.is_het())

```
