ivan-krukov / aligning-genealogies

The genealogy-coalescent alignment project
3 stars 0 forks source link

Time-aware Pedigree climbling #19

Open ivan-krukov opened 4 years ago

ivan-krukov commented 4 years ago

If probands are found at different generations (e.g. some early individuals did not leave offspring), we need to be careful when climbing up the Pedigree, so we don't double count the nodes.

For example, if we have the following Pedigree:

depth_example

Probands are 7 and 8. For example, 7 climbs path 7-3-1, and 8: 8-6-3-2. This will lead to a undesired fork in the resulting tree. Instead, we want the path climbing from 7 to "wait" until 8 catches up. This can be done if we only process nodes at a given backward depth.

This is already done correctly in Pedigree.sample_haploid_path, but we want to make sure it's implemented everywhere. Perhaps another iterator, like Genealogical.iter_edges?

ivan-krukov commented 4 years ago

This is really a part of #6