MesserLab / SLiM

SLiM is a genetically explicit forward simulation software package for population genetics and evolutionary biology. It is highly flexible, with a built-in scripting language, and has a cross-platform graphical modeling environment called SLiMgui.
https://messerlab.org/slim/
GNU General Public License v3.0
160 stars 30 forks source link

missing parents when using addRecombinant() #428

Closed ShyamieG closed 6 months ago

ShyamieG commented 6 months ago

Hello,

I'm trying to create haploid recombinant individuals using addRecombinant(). I've noticed that these offspring have null parents, which is not what I expected.

I've attached two SLiM scripts, one that generates offspring using addRecombinant (hap_recomb.slim) and the other using addCrossed (crossed.slim). The python script (parents.py) shows that parents are correctly tracked when using addCrossed(), but not addRecombinant(). I've also attached some sample tree sequence output of the slim scripts.

If this is the intended behaviour for addRecombinants(), how could I go about creating haploid recombinants that track the individuals that produced them?

Thanks in advance!

bhaller commented 6 months ago

Hi! Please see the documentation for addRecombinant(), which says:

By default, the offspring is considered to have no parents for the purposes of pedigree tracking, since there may be more than two “parents” in the general case. If pedigree tracking of parentage is desired, parent1 and/or parent2 may be passed to explicitly establish particular individuals as the parents of the offspring for purposes of pedigree tracking. In this case, if only one of parent1 and parent2 is non-NULL, that individual will be set as both of the parents of the offspring, mirroring the way that parentage is tracked for other cases such as addCloned() and addSelfed(). It is not required for parent1 or parent2 to actually be a genetic parent of the offspring at all, although typically they would be.

I think this answers your question, so I'm going to close this issue; feel free to reopen it if there is some further issue.

ShyamieG commented 6 months ago

Sorry, I'm not sure how I missed that! Thanks for pointing me in the right direction.