tskit-dev / tskit-site

tskit website
Other
0 stars 8 forks source link

SLiM snippet #2

Closed benjeffery closed 3 years ago

benjeffery commented 3 years ago

@bhaller suggests:

initialize() {
    initializeMutationRate(1e-7);
    initializeMutationType(“m1”, 0.5, “f”, 0.0);
    initializeGenomicElementType(“g1”, m1, 1.0);
    initializeGenomicElement(g1, 0, 99999);
    initializeRecombinationRate(1e-8);
}
1 { sim.addSubpop(“p1", 500); }
2000 late() { sim.outputFixedMutations(); }
jeromekelleher commented 3 years ago

I'm no SLiM expert, but I'm not sure this outputs a tree sequence? I think the snippet should save a ".trees" file, or it'll be confusing for people.

petrelharp commented 3 years ago

How about this? Outputs a tree sequence, has selection, and no smart quotes:

initialize() {
    initializeTreeSeq();
    initializeMutationRate(1e-8);
    initializeMutationType("m1", 0.5, "e", 0.001);
    initializeGenomicElementType("g1", m1, 1.0);
    initializeGenomicElement(g1, 0, 999999);
    initializeRecombinationRate(1e-8);
}
1 { sim.addSubpop("p1", 500); }
2000 late() { sim.treeSeqOutput("out.trees"); }
bhaller commented 3 years ago

Good point @jeromekelleher. Let's use Peter's snippet, I wasn't thinking inside the tskit-dev box. :->