Skip to content

Merging tree sequences from SLiM for neutral mutations and recapitation in msprime #187

Answered by mufernando
elissasoroj asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Elissa,

It is possible to "merge" tree sequences! This merge operation you are looking for is called union in tskit (also see this related vignette in pyslim). For two tree sequences in which part of the past history is shared, union works by copying the non-shared parts of one of the ts onto the other. As you realized, the trickiest part of this operation is defining the parts that are equivalent in the two tree sequences. For that, you will have to create an array that serves as a map of node ids between the two tree sequences.

Now, let's go through what you could do to simulate one ancestral population that splits into two:

  • Simulate the ancestral population and save the resulting t…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
3 replies
@petrelharp
Comment options

@mufernando
Comment options

@elissasoroj
Comment options

Answer selected by elissasoroj
Comment options

You must be logged in to vote
3 replies
@petrelharp
Comment options

@elissasoroj
Comment options

@mufernando
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants