Skip to content

Individual.parents should be added to integrity checks #1137

Closed

Description

@benjeffery
No description provided.

Activity

  1. added this to the Python 0.3.5 milestone on Jan 25, 2021
  2. jeromekelleher commented on Jan 25, 2021

    @jeromekelleher
    Member

    We should check at least for reference integrity, i.e., that individual parent IDs are valid.

    We should consider whether it's possible to detect inconsistencies in the data model, such that genetic information and pedigree information are inconsistent, and whether that is something we can detect during the integrity check. I suspect not, though, as we'd surely need to build the trees to detect any disagreements. See also #1136.

  3. petrelharp commented on Jan 25, 2021

    @petrelharp
    Contributor

    To check for inconsistencies, we'd have to assume something like diploidy, and that we have both nodes for each individual. If so, then every individual parent-child relationship must have at least one node parent-child relationship (since you get one copy of each chromosome from each parent). Then it's checkable on a single pass through the tables: initialize a vector of False for each individual.parent, then go through the edge table to see if the relationship validates it.

    Oh, maybe I'm speaking too soon: suppose that individual A is a parent to B, who is a parent to C, D, and E. The nodes of A are A1 and A2, etcetera. Suppose C1 and D1 inherit B1, while E1 inherits B2. They all coalesce in A1. Then simplification would remove B2, but B would remain, so the individual parent-child relationship of B-E wouldn't be reflected in the tree sequence. It wouldn't be inconsistent either, but it seems potentially very tricky to figure out if it is consistent.

    If instead C1 and D1 inherited the left half of B1 and the right half of B2, and E1 inherited the complement, then a similiar thing would happen except that B would retain both its nodes.

  4. jeromekelleher commented on Jan 25, 2021

    @jeromekelleher
    Member

    Thanks for thinking this through. I think it is too hard to spot that the pedigree is consistent in general. I think we could probably spot grosser things during simplify, like we have an edge (parent=1, child=0) and, node table says individual[0] = 0 and individual[1] =1, but the individual parents say parent[0] = 2 (or something). Basically, in the simplest possible case the edge and pedigree parents directly contradict each other.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions