initialize() {
defineConstant("Y", 0.2); // probability of a crossover
defineConstant("L", 1e5); // chromosome length
initializeMutationRate(1e-7);
initializeMutationType("m1", 0.5, "f", 0.0);
initializeGenomicElementType("g1", m1, 1.0);
initializeGenomicElement(g1, 0, L-1);
initializeRecombinationRate(0.0); // rec. rate of 0.0!
}
1 early() {
sim.addSubpop("p1", 500);
// initialize the global flag used by recombination()
defineGlobal("FIRST_GAMETE", T);
}
recombination() {
// make the crossing decision once per offspring
if (FIRST_GAMETE)
{
defineGlobal("CROSSED", runif(1) < Y);
defineGlobal("FIRST_GAMETE", F);
}
else
{
defineGlobal("FIRST_GAMETE", T);
}
if (CROSSED)
{
// crossover positions are to the left of base positions,
// so start at 1, not 0, for the rdunif() call
breakpoints = rdunif(1, 1, L-1);
// return T to indicate that changes were made
return T;
}
// return F to indicate changes were not made
return F;
}
2000 late() { }
initialize() {
defineConstant("Y", 0.2); // probability of a crossover
defineConstant("L", 1e5); // chromosome length
initializeMutationRate(1e-7);
initializeMutationType("m1", 0.5, "f", 0.0);
initializeGenomicElementType("g1", m1, 1.0);
initializeGenomicElement(g1, 0, L-1);
initializeRecombinationRate(0.0); // rec. rate of 0.0!
}
1 early() {
sim.addSubpop("p1", 500);
}
recombination() {
if (runif(1) < Y)
{
// crossover positions are to the left of base positions,
// so start at 1, not 0, for the rdunif() call
breakpoints = rdunif(1, 1, L-1);
// return T to indicate that changes were made
return T;
}
// return F to indicate changes were not made
return F;
}
2000 late() { }
--
SLiM forward genetic simulation: http://messerlab.org/slim/
---
You received this message because you are subscribed to the Google Groups "slim-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to slim-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/slim-discuss/4e6084bb-a563-496b-8841-0e1621fec1b8n%40googlegroups.com.