Skip to content

Conversation

@duncanMR
Copy link
Contributor

@duncanMR duncanMR commented Oct 14, 2025

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 index r+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 of ts.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:

image

@duncanMR duncanMR marked this pull request as draft October 14, 2025 12:33
@jeromekelleher
Copy link
Member

I'm not sure "breakpoint" here is a great bit of terminology as @hyanwong points out. It can be confused with ts.breakpoints() which is quite a different thing.

How about terminal_positions as the name of the array in AncestorData? (This is basically what you suggested Yan?)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants