You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a set of tables doesn't have mutation parents computed, one can do many things with the tree sequence without this ever raising an error. This could lead to wrong answers somewhere; it seems like this should be detected by check_integrity? And, maybe checked at load time?
Here's a test:
def test_no_mutation_parents(self):
tables = tskit.TableCollection(sequence_length=1)
tables.nodes.add_row(time=0, flags=tskit.NODE_IS_SAMPLE)
tables.sites.add_row(position=0, ancestral_state='A')
tables.mutations.add_row(site=0, node=0, derived_state='X', time=0.5)
tables.mutations.add_row(site=0, node=0, derived_state='C', time=0.5)
ts = tables.tree_sequence()
# ts.tables.mutations.parent, if computed, would be [-1, 0]
This would most easily be checked by verifying that the mutations.parent column is identical to what compute_mutation_parents would return.
I think we went around this originally and came the to the conclusion that this was a bit icky, but there's not much that could be done. If we run compute_mutation_parents each time we create a tree sequence from a set of tables, then there's no real point in storing the mutations.parent column at all.
Activity
jeromekelleher commentedon Jan 4, 2021
I think we went around this originally and came the to the conclusion that this was a bit icky, but there's not much that could be done. If we run
compute_mutation_parentseach time we create a tree sequence from a set of tables, then there's no real point in storing themutations.parentcolumn at all.petrelharp commentedon Jan 4, 2021
Oh, right. This does sound familiar. Sounds good.