epistasis: mutation that modifies the past and current selection coefficients

24 views
Skip to first unread message

Ana Yansi MORALES ARCE

unread,
Aug 23, 2022, 12:02:28 PM8/23/22
to slim-discuss
Dear Team,

I wonder if I could ask you for advice on the way to simulate a specific form of epistasis. I am trying to simulate a case in which a mutation could alter the selection coefficients on an individual carrying it. I am modeling a haploid organism that also experiences Muller's ratchet (section 5.1.5), and then I followed the epistasis examples from section 10.3.1.

 The idea is that when a mutation is present, the genome (individual) carrying it will have new selection coefficients that I arbitrarily change using setDistribution(). I expect it only modifies the future new values for the individual, not the whole population. But also, I would like to know if there is a way in which it also changes the selective values of any previous mutations (accumulated) to the new selective value. Unfortunately, The mutationEffect() callback mechanism doesn't work for me because it will change the relative fitness. I am afraid it would then be something like a positive selection which is not the goal of my model. I am sharing the script below.  Do you have any advice?

Thanks very much!

Ana  


initialize() {

   initializeMutationRate(2.5e-6);//

   initializeMutationType("m1", 1, "f", 0.0);//manual section 10.5

   initializeMutationType("m2", 1, "f", -0.023);

   c(m1,m2).convertToSubstitution = F; // manual section 24.10.1

   m1.mutationStackPolicy = "f"; //prevents stacking by keeping only the first mutation of type m1 at a given site

   initializeGenomicElementType("g1", m1, 1); //epistatic locus

   initializeGenomicElementType("g2", m2, 1);

   initializeGenomicElement(g2, 0, 500);

   initializeGenomicElement(g1, 501, 502);

   initializeGenomicElement(g2, 503, 1000);

   initializeRecombinationRate(0);

}

1 { sim.addSubpop("p1", 500);

   p1.setCloningRate(1.0);

   defineConstant("simID", getSeed());

}

{

   meanFitness = mean(p1.cachedFitness(NULL));

   newSize = asInteger(500 * meanFitness);

   p1.setSubpopulationSize(newSize);

   

   if (newSize == 0) {

       line = paste(simID, sim.generation);

       writeFile("./extinction.txt", line, append=F);

       

       // remove any new mutations added to the disabled diploid genomes

       sim.subpopulations.individuals.genome2.removeMutations();

       

       // remove mutations in the haploid genomes that have fixed

       muts1 = sim.mutationsOfType(m1);

       freqs1 = sim.mutationFrequencies(NULL, muts1);

       if (any(freqs1 == 0.5))

           sim.subpopulations.genomes.removeMutations(muts1[freqs1 == 0.5], T);

       

       muts2 = sim.mutationsOfType(m2);

       freqs2 = sim.mutationFrequencies(NULL, muts2);

       if (any(freqs2 == 0.5))

           sim.subpopulations.genomes.removeMutations(muts2[freqs2 == 0.5], T);

       sim.simulationFinished();

   }


}



1:5000{

   counts = p1.genomes.countOfMutationsOfType(m1);

   for (individual in counts)

   {

       m2.setDistribution("f", -2.3e-05);

   }

}



5000 late() {   

//check on selection coefficient values  

 m2muts = sim.mutationsOfType(m2);

   freqs = sim.mutationFrequencies(NULL, m2muts);

   effects = m2muts.selectionCoeff;

   catn();

   print(cbind(freqs, effects));


      // remove any new mutations added to the disabled diploid genomes

   sim.subpopulations.individuals.genome2.removeMutations();

   

   // remove mutations in the haploid genomes that have fixed

   muts1 = sim.mutationsOfType(m1);

   freqs1 = sim.mutationFrequencies(NULL, muts1);

   if (any(freqs1 == 0.5))

       sim.subpopulations.genomes.removeMutations(muts1[freqs1 == 0.5], T);

   

   muts2 = sim.mutationsOfType(m2);

   freqs2 = sim.mutationFrequencies(NULL, muts2);

   if (any(freqs2 == 0.5))

       sim.subpopulations.genomes.removeMutations(muts2[freqs2 == 0.5], T);

   

   sim.outputFixedMutations();

   sim.simulationFinished();

}

Ben Haller

unread,
Aug 23, 2022, 12:09:50 PM8/23/22
to slim-discuss
Hi Ana.  You write "The mutationEffect() callback mechanism doesn't work for me because it will change the relative fitness".  I'm afraid I don't understand that objection.  You seem to want to change various selection coefficients, due to epistasis, in individuals that possess a particular mutation, if I understand correctly.  That means changing the fitness of those individuals, right?  I think the mutationEffect() callback is exactly the mechanism you want to use; but perhaps I'm misunderstanding something.  Can you explain further, perhaps with a more specific example?  (I didn't look at your script at all, since I think I need conceptual clarity first.)

Cheers,
-B.

Benjamin C. Haller
Messer Lab
Cornell University

Reply all
Reply to author
Forward
0 new messages