Description
As discussed in #3168, something we'd like to do is squash together tree sequences describing different bits of the genome. For instance: say I've got simulations of 3L and 3R and would like to make a tree sequence of the entire chromosome 3. One possible not-very-good name: ts1.union_span(ts2)
? (Or: merge
?)
Possible functionality:
- the span covered by all edges in ts1 and in ts2 do not overlap (no overlap)
- any edge in ts2 describes a parent for a node in ts2 that has no parent on that span (no node-wise overlap)
- ts1 and ts2 can overlap but they must be identical where they do
So, where ts.union
was a node-wise union, this would be an edge-wise union. Case (3) is the most general, but also definitely the most annoying to code up and I am not aware of any use cases. Case (1) would be easy and efficient: simply loop through edges in each in insertion order and check for any overlap; @hyanwong suggested special-casing this one anyhow. Case (2) would require building the trees, I think, so I'm not sure if it'd be much easier than (3).
So I think I'm proposing doing (1), and am looking for a name? Edit: this is covered by concatenate
. Suggestions of use cases for (2) or (3) welcome?