-
Notifications
You must be signed in to change notification settings - Fork 34
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
(TSK_ERR_MUTATION_TIME_YOUNGER_THAN_NODE) #473
Comments
Hi @dylandebaun. Interesting issue. @petrelharp, bringing you in on this as well. In a debug build of SLiM, SLiM notices the problem before
emitted by
The variable
and indeed, here are the values it is based upon:
So we have a small tick offset, and because of that tick offset, there is a timing error in the derived state being recorded. As documented in
So there has been a call to (Genome_Class::ExecuteMethod_addNewMutation): addNewDrawnMutation() cannot add mutations to individuals of age > 0 when tree-sequence recording is enabled, to prevent internal inconsistencies. You can see that error in this simple example model, for example: initialize() { In tick 100 it draws a random sample of genomes and tries to add a mutation to them, and boom, you get the error since some of those genomes are not newborn. The reason for this restriction is clear: if an individual is no longer newborn, it could have descendants, and adding a mutation to an individual after it has already had descendants would imply that the descendants would also have that mutation... but they don't. SLiM has already created the descendants, and they did not inherit that mutation from their parent, because the mutation was not there. Rather than attempt to retroactively fix up all the mutational state for everybody (an impossible task, in general case, since a whole ancestry tree descending from the original individual could now exist, with any number of other mutational changes having happened at the same site since, etc.), SLiM throws an error. The unusual thing here is that this state of affairs happens within a single tick, in a WF model, because of the weirdness of So, @dylandebaun: the upshot is that the model you're trying to work with appears to have a bug in it, where it tries to change the genetics of an individual after it has already had a descendant (due to splitting off a subpopulation). That leaves the tree sequence in an inconsistent state. Apparently that error was not caught in SLiM 3.7; I guess But there is a SLiM bug here, that the error ought to be caught by SLiM, and a more readable error (the same error as my test model above) ought to be produced. Thanks for the report @dylandebaun! I hope the above makes sense. :-> Feel free to ask questions if anything remains unclear. @petrelharp do you have any thoughts on this, or shall I proceed as planned? |
Makes sense to me! Good sleuthing. |
Hi Ben!
Reposting this from the slim-discuss group. Thanks for helping out!
I tried on Slim 3.7 (when it was written) and updated the script for the newest version I believe but I get the bug for both versions. I may not have done the update correctly however.
Best,
Dylan
xiphophorus_birchmanni_10x_12Sep2018_yDAA6-ScyDAA6-1196-HRSCAF-1406_coding_nonoverlapping.tsv.txt
schumer.slim.txt
SLiM-ready-recmap-ScyDAA6-1196-HRSCAF-1406.tsv.txt
Hello,
I'm trying to run the following code from Schumer et al., 2020 (modified for debugging). It fails at a generation 646 (seemingly randomly) with the following error:
tsk_table_collection_deduplicate_sites: A mutation's time must be >= the node time, or be marked as 'unknown'. (TSK_ERR_MUTATION_TIME_YOUNGER_THAN_NODE)
schumer.slim.txt
I'm not exactly sure what could be happening. Thank you in advance for any assistance!
Best,
Dylan
Output:
// Starting run at tick :
1
"done1"
"done2"
600
"Mutation m1 at position 19117295 was added at time 600"
"Mutation m1 at position 23743212 was added at time 600"
"Mutation m1 at position 10785214 was added at time 600"
"Mutation m2 at position 31064592 was added at time 600"
"Mutation m2 at position 31064593 was added at time 600"
"Mutation m2 at position 31064594 was added at time 600"
"Mutation at position 19117295 was added at time 600"
"Mutation at position 23743212 was added at time 600"
"Mutation at position 10785214 was added at time 600"
"Mutation at position 31064592 was added at time 600"
"Mutation at position 31064593 was added at time 600"
"Mutation at position 31064594 was added at time 600"
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
The text was updated successfully, but these errors were encountered: