# Constraint metric

**URL:** <https://discuss.gnomad.broadinstitute.org/t/constraint-metric/429>\
**Category:** Browser\
**Tags:** bug\
**Created:** [August 19, 2024, 8:39am UTC](https://discuss.gnomad.broadinstitute.org/t/constraint-metric/429 "2024-08-19T08:39:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MariAnn](https://avatars.discourse-cdn.com/v4/letter/m/e5b9ba/32.png) [@MariAnn](https://discuss.gnomad.broadinstitute.org/u/MariAnn)\
**Post date:** [August 19, 2024, 8:39am UTC](https://discuss.gnomad.broadinstitute.org/t/constraint-metric/429/1 "2024-08-19T08:39:07Z")

</div>

Why does the Lof observed not correlate with the number of LOF found in the gene?  
Example ASH1L  
In the constraint table: pLof, observed 18 and pLof score 1  
However there are reported 60 LOF in ASH1L Main transcript. Some might be artifacts, but LOF curration has not been performed.  
Best regards, Mari Ann

---

<div class="post-metadata">

**Author:** ![Kaitlin\_Samocha](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.gnomad.broadinstitute.org/kaitlin_samocha/32/38_2.png) [@Kaitlin\_Samocha](https://discuss.gnomad.broadinstitute.org/u/Kaitlin_Samocha)\
**Post date:** [August 19, 2024, 3:17pm UTC](https://discuss.gnomad.broadinstitute.org/t/constraint-metric/429/2 "2024-08-19T15:17:39Z")

</div>

Hi Mari Ann,

Please see this response:

> [@Number of expected and observed pLoF variants for CYP8B1 looks unusual](https://discuss.gnomad.broadinstitute.org/t/number-of-expected-and-observed-plof-variants-for-cyp8b1-looks-unusual/390/2):
>
> We may observe 74 pLoF variants in the database across all transcripts and variant types in this gene, but the constraint table only displays pLoF variants that meet the following criteria: single nucleotide variants in the MANE Select transcript with MAF \< 0.1% that are considered high confidence by LOFTEE in the exome sequenced samples For this particular gene, if you go to the page for the MANE select transcript ([gnomAD](https://gnomad.broadinstitute.org/transcript/ENST00000316161?dataset=gnomad_r4)), you will see 66 pLoF variants listed. Of those, only 5 are considere…

---

<div class="post-metadata">

**Author:** ![MariAnn](https://avatars.discourse-cdn.com/v4/letter/m/e5b9ba/32.png) [@MariAnn](https://discuss.gnomad.broadinstitute.org/u/MariAnn)\
**Post date:** [August 20, 2024, 7:31am UTC](https://discuss.gnomad.broadinstitute.org/t/constraint-metric/429/3 "2024-08-20T07:31:39Z")

</div>

Thanks. However, non of the LOF in ASH1L (Main select transcript) have a Flag for low confidence. Could that be that the process of LOFTEE quality test has jet not be performed for ASH1L?

---

<div class="post-metadata">

**Author:** ![jkgoodrich](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.gnomad.broadinstitute.org/jkgoodrich/32/167_2.png) [@jkgoodrich](https://discuss.gnomad.broadinstitute.org/u/jkgoodrich)\
**Post date:** [September 6, 2024, 2:38am UTC](https://discuss.gnomad.broadinstitute.org/t/constraint-metric/429/4 "2024-09-06T02:38:03Z")

</div>

Hi Mari Ann,

Thanks for your patience! I did some further digging and wanted to clarify a few points.

As detailed in our [gnomAD blog post](https://gnomad.broadinstitute.org/news/2024-03-gnomad-v4-0-gene-constraint) and the [constraint documentation](https://gnomad.broadinstitute.org/help/constraint), the observed variant count in the constraint table only includes unique single nucleotide variants (SNVs) with a minor allele frequency (MAF) \< 0.1% and a median depth of at least 30 in exome samples. The reasoning behind this is to limit the inclusion of false positives, which can be more common among higher-frequency pLoF variants.

To confirm, I ran a small analysis on the gnomAD v4.1 dataset for the ASH1L gene using these criteria. After filtering for:

- High-confidence LOFTEE variants (without any flags),
- Only variants in the MANE Select transcript,
- PASS variants that are SNVs with MAF ≤ 0.1%, and
- Exome median depth ≥ 30,

```python
import hail as hl
from gnomad.resources.grch38.gnomad import public_release, coverage
from gnomad.utils.vep import filter_vep_transcript_csqs

ASH1L_interval = "chr1:155335268-155563162"

# Get v4.1 exome sites Hail Table and exome coverage.
ht = public_release("exomes").ht()
coverage_ht = coverage("exomes").ht()

# Filter the exome release Hail Table to the ASH1L gene interval.
ht = hl.filter_intervals(ht, [hl.parse_locus_interval(ASH1L_interval, reference_genome="GRCh38")])

# Filter to variants in ASH1L that are LOFTEE high-confidence (with no flags) in the MANE select transcript.
ht = filter_vep_transcript_csqs(
    ht, 
    synonymous=False, 
    mane_select=True,
    genes=["ASH1L"],
    match_by_gene_symbol=True,
    additional_filtering_criteria=[lambda x: (x.lof == "HC") & hl.is_missing(x.lof_flags)],
)

#Filter to PASS SNVs with AF <= 0.1% and median exome depth ≥ 30.
ht = ht.filter(
    (hl.len(ht.filters) == 0) 
    & (ht.allele_info.allele_type == "snv")
    & (ht.freq[0].AF <= 0.001)
    & (coverage_ht[ht.locus].median_approx >= 30)
)

print(f"Number of variants: {ht.count()}")
ht.select(
    freq=ht.freq[0],
    csq=ht.vep.transcript_consequences[0].consequence_terms,
    coverage=coverage_ht[ht.locus],
).show(-1)

```

I found **18 variants** , which matches the count observed in the constraint table.

 ![Screenshot 2024-09-05 at 8.33.18 PM](https://us1.discourse-cdn.com/flex016/uploads/broadinstitute1/original/1X/c8909e06bf736146aece8fb3ac02652783b92b73.png)

This suggests that the difference between comes from the additional filtering steps applied to the variants included in the constraint model, such as minor allele frequency and depth thresholds.

I hope this provides some clarity! Please feel free to reach out with any more questions.

---

<div class="post-metadata">

**Author:** ![MariAnn](https://avatars.discourse-cdn.com/v4/letter/m/e5b9ba/32.png) [@MariAnn](https://discuss.gnomad.broadinstitute.org/u/MariAnn)\
**Post date:** [September 11, 2024, 7:41am UTC](https://discuss.gnomad.broadinstitute.org/t/constraint-metric/429/5 "2024-09-11T07:41:05Z")

</div>

Thanks for clarifing.
