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

Serialization "gotcha" with tree sequences #161

Closed molpopgen closed 3 years ago

molpopgen commented 5 years ago

Serialization doesn't write the "mcounts" field for populations. This decision was made to save a bit of space. However, deserialization calls fwdpp's default mutation counting, which means that mutations only in tree sequences end up with wrong counts. The workaround is to call fwdpp::ts::count_mutations for that case, but it seems that a less error-prone solution is needed.

molpopgen commented 3 years ago

The sane solution here is to simply serialize the counts. This will change the binary file format, etc., but it is the least-bad option.

molpopgen commented 3 years ago

Let's do it for 0.9.0 since this is already breaking so much...