molpopgen / fwdpp

fwdpp is a C++ template library for implementing efficient forward-time population genetic simulations
http://fwdpp.readthedocs.io
GNU General Public License v3.0
27 stars 11 forks source link

Incorrect use of std::lower_bound #26

Closed molpopgen closed 9 years ago

molpopgen commented 9 years ago

In fwdpp 0.3.2, mutation- and recombination- related functions were changed to use std::lower_bound instead of std::upper_bound during searches. This resulted in a tricky bug that we have discovered. In cases with very large mutation rates, there is a chance that a mutation position equals a recombination breakpoint position. When such events happen, that site gets "dropped" from the recombinant gamete, and thus one copy of the mutation is lost. The result is slightly too few segregating sites and incorrect numbers of effective recombination events (R_min, etc., calculated from samples).

We believe that this has been fixed (by switching back to upper_bound), but pushing to github is pending further testing.

molpopgen commented 9 years ago

The fix for this bug is currently in the dev_rec_bugfix branch. This will become master soon.

molpopgen commented 9 years ago

Fixed in 0.3.9