-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weight = -1 for CloneGenoTransmitter tries to create more offspring than it can handle #114
Comments
Without looking at your code in detail, the error message was produced because, when there are both negative and positive weights, the negative weights are processed (cloned), and simuPOP requires the offspring subpopuation is larger than the parental generation (with If you are proficient enough at compiling simuPOP from source, I can create a patch and change this behavior. Otherwise, you will have to go through a more tedious route, namely using a pop.dvars().demo = demo
pop.evolve(...
preOps = [
sim.Stat(popSize=True),
],
sim.Conditionalmating('popSize > demo(gen)',
sim.CloneMating(...),
simu.HeteroMating(...), # existing one
)
) The |
I created a branch issue114. Please checkout the branch, compile simuPOP from the source (generally |
Awesome, thank you so much!! Will let you know if I find any issues. |
Hi Bo, Is this the right way to handle it?
` The error message I am getting is:
|
Please create a separate ticket with versions of OS, Python etc and the error messages. I suspect that you forgot to install packages like |
I think |
The expression is likely wrong since pop.dvars().demo = demo
sim.stat(pop, popSize=True)
sim.pyEval(pop, 'you expression') to find the correct syntax to use. |
Hi Bo, Thank you very much, once again. mtdna_1.txt Versions:
Error message:
|
Line 1882 of the source code no longer has that error message so you must have been running the older version. To verify, use
to see what version of simuPOP is imported. Then, you can remove the directory shown and re-install simuPOP from source. |
Hi Bo, Thanks
|
Is the problem still there? The patch does not change the version number so I really cannot tell. |
I just deleted the folder and installed it again (inside my virtual environment) using:
The error is still the same:
Version and Revision:
I don't know where exactly I went wrong in this. |
I think I found some source of error here:
|
Why do you need to manually apply the patch? You can just checkout the right branch. |
Like this? I will try to reset it and then switch to branch #115.
|
That was it! I needed to checkout the branch and not apply the patch itself, indeed. Thank you so much for your help! |
Glad that it works. I have merged the PR and will make a minor release, although help may be needed for conda release to work. |
Hi Bo,
I am simulating this New Zealand population of whales that went from 30,000 individuals to 40 after whaling.
I want to calculate haplotype frequencies at each generation since, given that this species has miraculously survived whaling and it's been recovering for the last few generations.
The problem I am facing is that I need to use CloneGenoTransmitter to simulate the mitochondrial transmission, and I want to use weight = -1 for this mating option so it is processed before the other mating scheme I have coded (which has been mentioned in [issues #12 , #15 and #75 ]). However, since I have some lethal events (which I coded), I keep facing the error "Mating scheme with a negative weight of 1 would like to produce 14696 offspring, but there are only 1500 unclaimed offspring left.". If I comment out the weight, it all works well.
Is there a downside to not adding weight to this function? Everything else I wanted to achieve has been completed.
Thank you for your help!
PS: if needed, the script and two supporting txt files follow here.
mtdna_1.txt
snp_1.txt
whale_for_Bo.txt
The text was updated successfully, but these errors were encountered: