Mutations with sex-specific DFEs

10 views
Skip to first unread message

Mark Hibbins

unread,
Jun 7, 2024, 12:29:53 PMJun 7
to slim-discuss
Hello,

I'm working with a nonWF model where I'd like to implement sexually antagonistic mutations. I came across a solution in this post:

https://groups.google.com/g/slim-discuss/c/cS7d1_xvKW4/m/LQXVfc50AgAJ

Which works, but is somewhat unrealistic as it basically assigns equal and opposing fitness effects of the mutation in the two sexes. What I'd ideally like to do is draw from DFEs separately for males and females and assign those effects to the same mutation, which would allow for the possibility of antagonistic fitness effects with some element of probability. The LaPlace distribution would be great for this, since it allows for distributions that are mostly deleterious but with a long tail for beneficial fitness effects. I have the backbone of an implementation I think might work for this, but I get stuck on drawing from the DFEs, since it doesn't seem like Eidos has a function to sample from a LaPlace distribution explicitly, and only lets you use it when initializing the mutation type: 

initialize() {


initializeSLiMModelType("nonWF");

defineConstant("L", 200000);

//Population carrying capacity; this is for

//population regulation in non-WF models

defineConstant("K", 1000);

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

initializeMutationType("m2", 0.5, "f", 0.0); //Sex chromosome neutral mutations

// Convert neutral mutations to substitutions

// to improve simulation performance:

m1.convertToSubstitution = T;

initializeMutationType("m3", 1, "f", 0.0); //Y-marker

initializeMutationType("m4", 1, "f", 0.0); //X chromosome neutral test mutation

initializeMutationType("m5", 1, "f", 0.0); //Autosomal neutral test mutation

initializeMutationType("m6", 0.5, "f", 0.0); //Autosome sexually antagonistic mutations

initializeMutationType("m7", 0.5, "f", 0.0); //Sex chromosome SA mutations

//m1.color = "green";

//m2.color = "blue";

//m3.color = "red";

//m4.color = "yellow";


//Autosome

initializeGenomicElementType("g1", c(m1, m6), c(1.0, 0.1));

//Sex chromosome

initializeGenomicElementType("g2", c(m2, m7), c(1.0, 0.1));

initializeGenomicElement(g1, 0, asInteger((L/2)-1)); //Autosome

initializeGenomicElement(g2, asInteger(L/2), L-1); //Sex chromosome

//Free recombination between chromosomes

rates = c(1e-8, 0.5, 1e-8);

ends = c(asInteger((L/2)-1), asInteger(L/2), L-1);

initializeRecombinationRate(rates, ends);

//Parameters

defineGlobal("MU", 1e-7);

initializeMutationRate(MU);

}

reproduction() {


//Draw random males and females

repfemales = subpop.sampleIndividuals(asInteger(K/2), replace = T, tag = 1);

repmales = subpop.sampleIndividuals(asInteger(K/2), replace = T, tag = 0);

//Mate randomly sampled pairs

for (i in seqLen(asInteger(K/2))) {

offspring = subpop.addCrossed(repfemales[i], repmales[i]);

//Sex determination

if (offspring.genome2.containsMarkerMutation(m3, L-1))

offspring.tag = 0; //male

else

offspring.tag = 1; //female

}

self.active = 0; //turn off reproduction ("big bang" style)

}

mutationEffect(m6) {

// Draw fitness effects from the Laplace DFE

maleEffect = rlaplace(-0.05, 0.04); //turns out this function doesn't exist.

//Post to slim-discuss.

femaleEffect = rlaplace(-0.05, 0.04);

// Define a custom fitness function that differentiates by sex

if (individual.tag == 0) {

return 1 + maleEffect;

} else {

return 1 + femaleEffect;

}

}


Is there another way I could model a distribution of deleterious and beneficial mutations that I can draw from separately in both sexes? Maybe by combining other distributions or modifying fitness in a different place? Open to any suggestions. Many thanks,

Mark Hibbins

Peter Ralph

unread,
Jun 7, 2024, 6:50:13 PMJun 7
to Mark Hibbins, slim-discuss
Well, here's an implementation of rlaplace(), taking the parameterization from Wikipedia:

mu = 0.005
b = 0.001
size = 10
rexp(size, mu=sample(c(-1,1), size=size, replace=T) / b + mu)

If you wanted the asymmetric Laplace then you'd need to do it somewhat differently.

Just for fun, here's another implementation, representing the Laplace as a mixture of Normals:
rnorm(size, mean=mu, sd=sqrt(rexp(size) * 2)/b)

--peter

From: slim-d...@googlegroups.com <slim-d...@googlegroups.com> on behalf of Mark Hibbins <mark.rea...@gmail.com>
Sent: Friday, June 7, 2024 9:29 AM
To: slim-discuss <slim-d...@googlegroups.com>
Subject: Mutations with sex-specific DFEs
 
--
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/e30fcc13-9a4d-4a3d-bb94-27bde63f0149n%40googlegroups.com.

Ben Haller

unread,
Jun 7, 2024, 10:48:05 PMJun 7
to Peter Ralph, Mark Hibbins, slim-discuss
Thanks Peter!  That said, it would be trivial to add an rlaplace() function; I just wait for people to request distributions.  If you'd like it to be added, Mark, please just open an issue on GitHub for it.  :->  Happy modeling!

Cheers,
-B.

Benjamin C. Haller
Messer Lab
Cornell University


Peter Ralph wrote on 6/8/24 12:50 AM:
Reply all
Reply to author
Forward
0 new messages