Skip to content

missing mutation parents is not detected #1097

@petrelharp

Description

@petrelharp

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions