Setting different selection coefficients of the same mutation in different populations

8 views
Skip to first unread message

Carlos Sarabia

unread,
Jun 10, 2024, 10:11:55 AMJun 10
to slim-discuss
Hi,

II work with a model in which one mutation appears as neutral in a source population, and when this pop splits in two, in one of them this mutations is beneficial and in another is not.

I have modified recipe 10.5 successfully:
#############################################

// Keywords: environmental change, temporal change


initialize() {

initializeMutationRate(1e-7);

initializeMutationType("m1", 0.5, "f", 0.0); // neutral

initializeMutationType("m2", 1.0, "f", 0.1); // balanced

initializeGenomicElementType("g1", c(m1,m2), c(999,1));

initializeGenomicElement(g1, 0, 99999);

initializeRecombinationRate(1e-8);

}

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

2 early() { sim.addSubpop("p2", 500); } // I added this pop

late() {

m2muts = p1.individuals.genomes.mutationsOfType(m2);

freqs = sim.mutationFrequencies(NULL, m2muts);

for (mut in m2muts, freq in freqs)

mut.setSelectionCoeff(0.5 - freq);

}

10000 early() { sim.simulationFinished(); }

#############################################
And I have seen that it works well, with the setSelectionCoeff working in p1 but not in p2.

However, when I try to do the same with setSelectionCoeff:
#############################################

1 early() { sim.addSubpop("p1", N); } //


1328 late() {

target = sample(p1.genomes, N); // N = popsize.

target.addNewDrawnMutation(m2, 49999);

catn("nFADS is " + nFADS);

}


1993 early () {

sim.addSubpopSplit("p2", N, p1);

p1.setSubpopulationSize(N);

}


1993 late () {

mut2 = p2.individuals.genomes.mutationsOfType(m2);

mut2.setSelectionCoeff(0.1); // turn all mutations m2 of population p2 into beneficial with sFADS coefficient.

mut1 = p1.individuals.genomes.mutationsOfType(m2);

mut1.setSelectionCoeff(0.0);

}

###########################################
setSelectionCoeff changes ALL mutations in all populations to either 0.1 or 0.0:

gen 1987 p1.m2 0.241 sel 0.0

gen 1988 p1.m2 0.2345 sel 0.0

gen 1989 p1.m2 0.215 sel 0.0

gen 2000 p1.m2 0.2345 sel 0.0 p2.m2 0.228 sel 0.0

gen 2001 p1.m2 0.237 sel 0.0 p2.m2 0.229 sel 0.0

gen 2002 p1.m2 0.233 sel 0.0 p2.m2 0.234 sel 0.0

gen 2003 p1.m2 0.2335 sel 0.0 p2.m2 0.242 sel 0.0

gen 1990 p1.m2 0.2965 sel 0.0

gen 1991 p1.m2 0.287 sel 0.0

gen 1992 p1.m2 0.2985 sel 0.0

gen 1993 p1.m2 0.289 sel 0.1

gen 1993 p1.m2 0.289 sel 0.1 p2.m2 0.2805 sel 0.1

gen 1994 p1.m2 0.3095 sel 0.1 p2.m2 0.289 sel 0.1

gen 1995 p1.m2 0.3115 sel 0.1 p2.m2 0.2965 sel 0.1

gen 1996 p1.m2 0.3255 sel 0.1 p2.m2 0.311 sel 0.1


Update: using a loop over the mut1 or mut2 vectors as in recipe 10.5 gave the same result:

for (mut in mut1)

mut.setSelectionCoeff(0.0);


for (mut in mut2)

mut.setSelectionCoeff(0.1);


I wonder why this is, and if some other approaches (aka mutationEffect() ) are recommended?

Thanks

Carlos

Ben Haller

unread,
Jun 10, 2024, 10:34:53 AMJun 10
to Carlos Sarabia, slim-discuss
Hi Carlos!  Yes, this sort of thing is what a mutationEffect() callback is for (see section 10.2 of the manual).  Your code doesn't do what you want because the same mutations are in both p1 and p2; so for a mutation that is in both subpopulations, you are setting its selection coefficient first to 0.1, and then to 0.0.  One mutation has one selection coefficient; it cannot have two different values at the same time.  :->  Just as if I write:

x = 5;
x = 8;

then x now has a value of 8; it cannot be both 5 and 8 at the same time.

Cheers,
-B.

Benjamin C. Haller
Messer Lab
Cornell University


Carlos Sarabia wrote on 6/10/24 3:11 PM:
--
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/338940ad-8145-441f-9162-eb879447dc4fn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages