gaynorr / AlphaSimR

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

Flexibility to add extra slot #134

Open mab658 opened 1 year ago

mab658 commented 1 year ago

In the course of simulation, one may simulate genetic estimated total genetic value (GETGV) in addition to EBV. It is advisable to allow the user to be able to add extra slot so that such effect could be added to the population object.

gregorgorjanc commented 1 year ago

@mab658 you could store this in the misc slot. See getMisc() and setMisc().

gaynorr commented 1 year ago

I'd asked Moshood to post this here earlier. I probably won't act on in soon, but it is something I want to keep here as a potential future enhancement. I'm currently shoving everything through the EBV slot even if it isn't really and EBV. This expansion may also consider covering complex traits that are a function of multiple traits.

gregorgorjanc commented 1 year ago

I hear you @gaynorr! I have been wondering the same myself! The question becomes what are all the slots we want/need!

gv (current slot) & egv (not a slot currently)

bv (not a slot currently and depends on the pop anyway) & ebv (current slot)

dd and aa as above for the bv

index trait? Should we have an option to define a trait that is a function of other traits and always comes at the end of the traits (say gv[, nTraits+1]) and we define such a mapping in the SP function? Or the finalisePop() function?

gregorgorjanc commented 7 months ago

Recent change in the pop@misc slot will make this very easy for the users. See tests code at https://github.com/gaynorr/AlphaSimR/blob/69c30388e067ba4bf73192a1f0a4a446508b3afe/tests/testthat/test-misc.R on how to use pop@misc.