Closed szhan closed 3 months ago
@astheeggeggs suggested to add a test (probably in check_inputs
) to check that the n
in r/n
is <= 2 * number of ref. haps - 1
.
In the case of diploid, I think the n
should be <= (2 * number of ref. haps - 1)^2
.
Turns out that it is quite tedious to implement the check when we include ancestral haplotypes, because we need to pass the number of ref. sample haplotypes to various functions. Also, the get_ancestral_haplotypes
function doesn't generate 2 * number of ref. sample haplotypes - 1
ancestral haplotypes, so the check fails. This should be investigated in a separate issue.
When the reference panel contains partial ancestral haplotypes, the denominator of
r/n
at sitei
should exclude counting the haplotypes that haveNONCOPY
at sitei
. The various implementations have to be modified to handle this. Note thatn
is constant if all the marginal trees are binary (equal to2*number of ref. haps - 1
), but in practice,n
can vary due to polytomies in marginal trees.