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

Move minimal data for mutations into fwdpp::ts::mutation_record #194

Closed molpopgen closed 5 years ago

molpopgen commented 5 years ago

After a lot of work with fwdpp::ts, the only reasons a mutation vector is passed to tree sequence functions is to access the pos or neutral fields of a mutation. Since these fields represent the minimal API requirements for a mutation, they should be added as fields to fwdpp::ts::mutation_record.

This change would simplify the API but break serialization. The latter point would be solved with a mock struct mimicking the current mutation_record and setting the new fields to "NULL" values upon deserialization.

An additional plus is that locality of reference would improve for several operations on mutation tables, but the performance improvement may not be noticeable as these ops are already quite fast.

molpopgen commented 5 years ago