Giter VIP home page Giter VIP logo

Comments (6)

jeromekelleher avatar jeromekelleher commented on September 14, 2024 1

I think this makes sense @petrelharp, and can be tried without needing to make any changes internally to msprime. I guess msprime could provide a function remap_coordinates(ts, recombination_map) which does what you describe, if it works. You can then recapitate with the output of remap_coordinates (this is better than doing this internally within msprime.simulate I think, because the interface is already complex enough).

Unfortunately I don't have time to work on this at the moment though.

from pyslim.

petrelharp avatar petrelharp commented on September 14, 2024 1

Sounds good. I don't have time to do this quite at the moment either, but can populate an issue over at msprime with our notes on this process if someone else wants to start on it.

from pyslim.

jeromekelleher avatar jeromekelleher commented on September 14, 2024 1

This problem should go away entirely after msprime 1.0.

from pyslim.

petrelharp avatar petrelharp commented on September 14, 2024

So far, we haven't been able to see how to do this without major replumbing under the msprime hood.

But, as I write this...

The basic problem is that the recombination breakpoints output by SLiM may not match the possible recombination breakpoints that msprime will use. Because of how msprime works under the hood, they have to. But, we could

  1. make a maximally-fine-but-still-discrete recombination map in msprime
  2. remap the breakpoint positions in the input tree sequence to their nearest smaller position in the msprime map
  3. warn/error if this has moved any breakpoints more than some distance or has caused anything else bad to happen
  4. proceed with recapitation

Perhaps steps 2 and 3 would be a method that would take a tree sequence and a recombination map. This should work just fine, moving breakpoints by no more than something very small unless there are regions with zero recombination rate. At first I thought it should be in pyslim because you're doing something not-quite-right with a tree sequence that is mostly useful for SLiM->msprime; but actually you'd run into the same problem if you tried to do msprime.simulate(... from_ts=ts) with a ts that was made with a different recombination map.

What do you think, @jeromekelleher? Does this, vaguely, make sense?

from pyslim.

mufernando avatar mufernando commented on September 14, 2024

This has been possible since 1223afd (?)

from pyslim.

petrelharp avatar petrelharp commented on September 14, 2024

This has been possible since 1223afd (?)

True - you can pass in a recombination map - the thing quoted above was saying that it's not always possible to have exactly the same recombination map, for reasons related to discretization.

But - not an issue any more. I'll close this and open an issue saying that we should document this or give an example.

from pyslim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.