gaynorr / AlphaSimR

R package for breeding program simulations
https://gaynorr.github.io/AlphaSimR/
Other
40 stars 17 forks source link

Faster multitrait simulations #151

Open gaynorr opened 11 months ago

gaynorr commented 11 months ago

Is your feature request related to a problem? Please describe. AlphaSimR's performance slows down as more traits are added due to QTL genotypes being pulled for each trait separately before calculating genetic values.

Describe the solution you'd like Pull genotypes for all QTLs first before proceeding to calculation of genetic values. This will reduce computational costs associated with pulling genotypes multiple times with perhaps a small penalty to memory usage. This could be accomplished using an active QTL list in SimParam that tracks all QTL and relative positions (positions within all QTL) for each trait.

Describe alternatives you've considered Keep track of pleiotropic traits added by a single call to addTrait_ so that their QTL are pulled together. This could increase performance further, but adds complexity due to needing to track when traits are removed or modified.

Pull all genotypes first. This is easier to code because it avoids the need for an active QTL list, but increases memory usage further. It would effectively revert AlphaSimR back to byte storage.