Hi again,
For Ben Haller: sorry for the previous message that has been deleted, but I misclicked before finishing post and had to redo it.
I think the following nonWF model properly simulates mitotic recombination for a clonal organism, by using addRecombinant() with the same individual as both parents and alternating genome1 and genome2 as the initial copy strand:
initialize()
{
initializeSLiMModelType("nonWF");
defineConstant("mu_base", 0); // mutation rate = 0 because I just want mutations that I introduce
initializeMutationRate(mu_base);
initializeMutationType("m1", 0.5, "f", 0.0);
initializeGenomicElementType("g1", m1, 1.0);
initializeGenomicElement(g1, 0, 1e4 - 1);
initializeRecombinationRate(1e-6);
initializeGeneConversion(0.8, 1000, 1.0);
}
reproduction()
// Reproduction callback is launched every generation
{
for (indv in sim.subpopulations.individuals)
{
breaks = sim.chromosome.drawBreakpoints(indv);
subpop.addRecombinant(indv.genome1, indv.genome2, breaks, indv.genome2, indv.genome1, breaks);
}
self.active = 0;
}
1 early()
{
sim.addSubpop("p1", 100);
}
1 late()
{
// Add mutations on the genome1 of each indv to visualize recombination events
allIndv = sim.subpopulations.individuals;
allIndv.genome1.addNewDrawnMutation(m1, 1000);
allIndv.genome1.addNewDrawnMutation(m1, 2000);
allIndv.genome1.addNewDrawnMutation(m1, 3000);
allIndv.genome1.addNewDrawnMutation(m1, 4000);
allIndv.genome1.addNewDrawnMutation(m1, 5000);
allIndv.genome1.addNewDrawnMutation(m1, 6000);
allIndv.genome1.addNewDrawnMutation(m1, 7000);
}
early()
{
// kills all non-juveniles to get non overlapping generations
// note: newly generated juveniles have age == 0
inds = sim.subpopulations.individuals;
inds[inds.age > 0].fitnessScaling = 0.0;
}
10000 late()
{
allIndv = sim.subpopulations.individuals;
allIndv.genomes.outputVCF(filePath = "test.vcf");
}
From the resulting haplotypes, it seems to do what I want. However, gene conversion (with initializeGeneConversion(0.8, 1000, 1.0); for example) does not seem to work in this case: I do not see any cases of loss of heterozygosity.
From the manual, "gene conversion tracts are not explicitly supported by" addRecombinant(), but "crossover breakpoints [...] may be used to implement crossovers or simple gene conversion tracts". So is there something I should add to the code to add gene conversion?
Best regards,
Yann