Sex ratio becomes zero after loading msprime sequence in SLiM

103 views
Skip to first unread message

Devashish Tripathi

unread,
Feb 1, 2024, 4:14:26 PM2/1/24
to slim-discuss
Hi, 

I have performed a demographic model simulation in msprime, annotated the tree sequence using pyslim and loaded the sequence back into SLiM. The SLiM simulation works fine with hermaphrodites, but the issue arises when I implement the separate sex in msprime (as described in SLiM document).  After loading the tree sequence in SLiM, I can see that there are 5 populations with a sex ratio close to 0.5, which means the sex assignment by pyslim was correct. After the first generation of evolution, SLiM gives an error that the population is unisexual. 

Further, in Pyslim individual metadata, I observe that both parents are assigned a value of -1. I wonder whether SLiM is considering no information on parents or selfing when after loading the tree sequence. 

I have attached the msprime and SliM code for your reference.

Thanks
Devashish
test_model1.slim
msprime_sim_2D_SLiM.py

Devashish Tripathi

unread,
Feb 2, 2024, 3:02:45 AM2/2/24
to slim-discuss
I found the step I skipped while preparing the pyslim tree sequence metadata. I assumed that after setting sex for individuals, the population would, by default, set the sex ratio. However, looking into the population metadata, I found that the sex ratio is 0 by default. So, I updated the sex ratio for all populations, and now it's working fine in SLiM.

Ben Haller

unread,
Feb 2, 2024, 8:53:50 AM2/2/24
to slim-discuss
I'm glad you found the problem, Devashish, because I was a bit mystified!  Sounds like there might be a bug here; I'll follow up with Peter Ralph.  Thanks.

Cheers,
-B.

Benjamin C. Haller
Messer Lab
Cornell University

Reply all
Reply to author
Forward
0 new messages