Hello wonderful SLiM community,
Is there a way to simulate monozygotic (MZ) twins in SLiM? I could not find any recipes or examples in the manual.
Based on my experience with SLiM, I assume this would only be possible in a nonWF model. Perhaps it could be accomplished with a modifyChild() callback, or see an idea below.
In my simulation, I have something like a human reproductive pattern, with many full sibs and some half sibs. I would like to include MZ twins at some small rate, say 1%.
So for example if I just made a new offspring within a reproduction() callback:
```
child = subpop.addCrossed(mother, bio_father);
```
Could I then make a MZ twin of it like so?
```
mz_twin = subpop.addCrossed(mother, bio_father);
mz_twin.haplosomes = child.haplosomes
```
It doesn’t seem fully accommodated by SLiM, e.g. the relatedness() as calculated by SLiM I would still expect to be be 0.5 (i think). And I think I would need to log the specific twin pairs as needed. But otherwise this seems like it might work.
Is this a reasonable way to make MZ twins? Is there anything to watch out for?
Thanks
Ryan
initialize() {
defineConstant("MU", 1e-7); // mutation rate
defineConstant("P_MZTWIN", 0.02); // probability of an MZ twin
defineConstant("K", 500); // carrying capacity
initializeSLiMModelType("nonWF");
initializeSex();
initializeMutationType("m1", 0.5, "f", 0.0).convertToSubstitution = T;
initializeGenomicElementType("g1", m1, 1.0);
initializeGenomicElement(g1, 0, 1e7 - 1);
initializeMutationRate(MU);
initializeRecombinationRate(1e-8);
}
reproduction(NULL, "F") {
mate = subpop.sampleIndividuals(1, sex="M");
if (rdunif(1) < (1 - P_MZTWIN))
{
// make two non-twinned offspring most of the time
child1 = subpop.addCrossed(individual, mate);
child2 = subpop.addCrossed(individual, mate);
}
else
{
// make monozygotic twins with probability P_MZTWIN
ind_haplos = sample(individual.haplosomes, 2, replace=F);
mate_haplos = sample(mate.haplosomes, 2, replace=F);
breaks1 = sim.chromosome.drawBreakpoints(individual);
breaks2 = sim.chromosome.drawBreakpoints(mate);
sex = sample(c("M", "F"), 1);
tick = community.tick;
// twin1 gets new mutations as usual
twin1 = subpop.addRecombinant(ind_haplos[0], ind_haplos[1], breaks1,
mate_haplos[0], mate_haplos[1], breaks2, sex,
individual, mate, randomizeStrands=F);
// twin2 gets no new mutations
sim.chromosome.setMutationRate(0.0);
twin2 = subpop.addRecombinant(ind_haplos[0], ind_haplos[1], breaks1,
mate_haplos[0], mate_haplos[1], breaks2, sex,
individual, mate, randomizeStrands=F);
sim.chromosome.setMutationRate(MU);
// twin2 copies new mutations from twin1
twin1_muts_hap0 = twin1.haplosomes[0].mutations;
twin1_newmuts_hap0 = twin1_muts_hap0[twin1_muts_hap0.originTick == tick];
twin2.haplosomes[0].addMutations(twin1_newmuts_hap0);
twin1_muts_hap1 = twin1.haplosomes[1].mutations;
twin1_newmuts_hap1 = twin1_muts_hap1[twin1_muts_hap1.originTick == tick];
twin2.haplosomes[1].addMutations(twin1_newmuts_hap1);
}
}
1 early() {
sim.addSubpop("p1", K);
}
early() {
p1.fitnessScaling = K / p1.individualCount;
}
2000 late() { sim.outputFixedMutations(); }
--
SLiM forward genetic simulation: http://messerlab.org/slim/
Before posting, please read http://benhaller.com/slim/bugs_and_questions.html
---
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 visit https://groups.google.com/d/msgid/slim-discuss/f1e9d95f-e129-4869-87ac-890435d60169n%40googlegroups.com.