Add a dummy site at the end of the sequence #1058
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since we use half-open intervals in tskit, and tsinfer works with discrete sites, ancestors that include the rightmost inference site (let's call its index
r) have to be defined as ending at site indexr+1. Since this extra site has no position or haplotypes, we have to handle it as a special case at times, hard-coding it to have a position ofts.sequence_length.This work-in-progress PR seeks to explicitly encode this rightmost extra site, which I've tentatively called a breakpoint, in the ancestor data. This is the first step toward adding support for multiple user-provided breakpoints; for example, the user could specify the start of the centromere as a breakpoint, such that tsinfer would run on each chromosome arm separately.
So far, I've implemented the extra site in the Python engine up until ancestor generation. Next step is to get ancestor and sample matching to work. Here is a small simulated example to show how the change affects ancestral haplotypes: