ms to msprime code conversion #1897
-
Hello All! I have published Thanks in advance for any and all help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hi @David-Peede. Demes-python has an ms -> Demes converter: see the import demes
import msprime
cmd = (
"-I 3 1 1 1 "
"-n 1 1.682020 "
"-n 2 3.736830 "
"-n 3 7.292050 "
"-eg 0 2 116.010723 "
"-eg 0 3 160.246047 "
"-ma x 0.881098 0.561966 0.881098 x 2.797460 0.561966 2.797460 x "
"-ej 0.028985 3 2 "
"-en 0.028985 2 0.287184 "
"-ema 0.028985 3 x 7.293140 x 7.293140 x x x x x "
"-ej 0.197963 2 1 "
"-en 0.303501 1 1"
)
graph = demes.from_ms(cmd, N0=7310, deme_names=["YRI", "CEU", "CHB"])
demography = msprime.Demography.from_demes(graph) We also have a CLI for this (and a Demes -> ms converter), but these are not yet in a released version of demes-python. Feel free to grab the latest git code if you're curious: https://github.com/popsim-consortium/demes-python/ |
Beta Was this translation helpful? Give feedback.
Hi @David-Peede.
Demes-python has an ms -> Demes converter: see the
demes.from_ms()
function. The demes model can then be imported to msprime usingmsprime.Demography.from_demes()
.