popgenmethods / momi2

Infer demographic history with the Moran model
GNU General Public License v3.0
47 stars 11 forks source link

Better error message for ascertained population with 1 allele #55

Open jackkamm opened 2 years ago

jackkamm commented 2 years ago

The estimated missing allele probability requires 2 alleles per population, and will crash if a population only has 1 allele.

When this happens, the error message is cryptic, and it is not clear to the user what is going on.

To get around the issue, a population with only 1 allele can be set as non-ascertained, then this missing allele probability won't be computed. Alternatively, we could allow the user to manually specify the missing allele probability, or to specify that the dataset doesn't have any missing data, but I don't think we've exposed any such option to the user.

See also: https://github.com/popgenmethods/momi2/issues/53