Skip to content

span-wise union #3181

Open
Open
@petrelharp

Description

@petrelharp

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:

  1. the span covered by all edges in ts1 and in ts2 do not overlap (no overlap)
  2. any edge in ts2 describes a parent for a node in ts2 that has no parent on that span (no node-wise overlap)
  3. 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions