Consider a 1000bp exonic region with 500 synonymous sites and 500 non-synonymous sites (for simplicity). Suppose that, in the absence of natural selection, we expect 1 variant every 10 bases. Then we expect 100 variants in the region: 50 at synonymous sites and 50 at non-synonymous sites. If we observe 100 at synonymous sites and 0 at non-synonymous sites, then the observed number of mutations in the entire region is in accord with neutral expectations, but the numbers observed in the two functional categories are not.
Currently constraint-tools report reports observed mutation count irrespective of functional category. As illustrated above, that can lead to false negative calls of constraint.
One approach is to compute the expected mutation count across just the non-synonymous sites of the region (as opposed to using all sites in the region, as the code currently does). Similarly, the code could report the observed mutation count across just the non-synonymous sites of the region.
One could do the same, but for the synonymous sites. This would enable us to capture variants that exert a functional effect without necessarily altering protein sequence or structure, e.g. splice variants.