Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support migrations in simplify #20

Open
jeromekelleher opened this issue Feb 2, 2018 · 16 comments
Open

Support migrations in simplify #20

jeromekelleher opened this issue Feb 2, 2018 · 16 comments
Labels
C API Issue is about the C API enhancement New feature or request Python API Issue is about the Python API
Milestone

Comments

@jeromekelleher
Copy link
Member

Simplify current ignores migration records. We need to update simplify so that migrations are also processed. This should be simple to do; we just use the node ID map to translate the node IDs in the old table into new node IDs. If the old node ID maps to -1, we leave the migration out.

@jeromekelleher
Copy link
Member Author

#567 changed the behaviour to raise an error when attempting to simplify a set of tables with migrations.

@jeromekelleher
Copy link
Member Author

jeromekelleher commented Aug 25, 2018

When tackling this, add a check to the simulate_from_demography statistical check to see if the number of migrations is conserved when we have simulate_from. See #597 and #596 for background.

Another aspect of migration simplification is that we should take references to populations from migrations into account too.

@petrelharp petrelharp transferred this issue from tskit-dev/msprime Jan 10, 2019
@hyanwong
Copy link
Member

hyanwong commented Dec 4, 2019

Ping @Chris1221 who was interested in taking a look at this. I'm not sure how complex an issue this would be for someone unfamiliar with the codebase, but Jerome's comment at the top gives me hope that it's not too bad

@jeromekelleher
Copy link
Member Author

Not the ideal place to start, as simplify is pretty hairy and multi-layered. But, would be a great way to learn the codebase and how the top-to-bottom development process works.

@Chris1221
Copy link

Perfect, thank you @hyanwong! Yes, probably won't start here, but I'll keep it on my radar. This feature would be particularly useful for the smcsmc conversion to tskit, which is why I was interested in it. But you're right @jeromekelleher, it is probably pretty hairy.

@jeromekelleher
Copy link
Member Author

It's not so bad @Chris1221 --- I'd be happy to help you get up to speed. It'd be great to get smcsmc converted to tskit!

@Chris1221
Copy link

Yea I think so too. I was talking to @hyanwong a little about it, but we've implemented a very hacky conversion to the basic tables in text format -- it needs quite a bit of refining but the major issue was that we treat migration events as nodes, which is different than tskit. I'm going to look at the tsconvert work done so far and see if I can do it in a better way. I think it's pretty crucial to get everything in comparable formats, then we can compare apples to apples for the inference methods.

@jeromekelleher
Copy link
Member Author

I think it's pretty crucial to get everything in comparable formats, then we can compare apples to apples for the inference methods.

Amen brother! I think it'd be well worth while spending a few days with us at the BDI then, I'm sure we can iron out the details between us.

@Chris1221
Copy link

That sounds great! I'm going home for Christmas soon, so realistically I don't think I'll have enough time in the next week or so, but we should try to find some time early in the new year. It's pretty high on my to-do list for smcsmc. Having it tied into the tskit ecosystem will also make it more easy for users to approach the output (and better integrated into stdpopsim).

@Chris1221
Copy link

I'm going to take a look at this in the next few days. If anyone else has been working on it, let me know!

@jeromekelleher
Copy link
Member Author

Nope, this is all yours @Chris1221! I'm happy to have a quick chat to get you up to speed - do send me an email/slack if you have any questions.

@benjeffery benjeffery added C API Issue is about the C API enhancement New feature or request Python API Issue is about the Python API labels Sep 29, 2020
@hyanwong
Copy link
Member

This seems to have dropped off the radar. It would be nice to have for one of the tuts. Any takers to finish it off? @Chris1221 I assume you never found time to do it?

@Chris1221
Copy link

So sorry @hyanwong, I started working on it but time in my PhD is running out so I never got around to finishing it. My apologies. :(

@benjeffery
Copy link
Member

I've added this to C 1.0 as we should think if it has any effect on the simplify API. (I don't think so but worth some more thought)

@benjeffery
Copy link
Member

Moving to C upcoming as doesn't have an impact on the public API.

@hyanwong
Copy link
Member

Just to record that we should remember to update the doc strings for the TSK_SIMPLIFY_NO_UPDATE_SAMPLE_FLAGS (C) and update_sample_flags (Python) API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C API Issue is about the C API enhancement New feature or request Python API Issue is about the Python API
Projects
None yet
Development

No branches or pull requests

4 participants