Calculating inbreeding depression

60 views

Yaniv Brandvain

Sep 9, 2021, 5:33:53 PM9/9/21
to slim-discuss
Hi SLiMers

Does anyone know of an easy method to calculate inbreeding depression for a population (ie the difference in mean fitness of the same population if all individuals were selfed vs is all were outcrossed?)

I have schemed up various hacks that I haven't yet implemented, but wonder if there is a simple subroutine coded somewhere?

Thanks!
yaniv

Ben Haller

Sep 9, 2021, 5:50:36 PM9/9/21
to slim-discuss

If your google-fu is better than mine, perhaps you can find others.  But these are about calculating the degree of inbreeding that exists; you seem to be asking about calculating the fitness effect of that inbreeding, which is another matter, right?  How large of a fitness effect will result from a given degree of inbreeding will depend greatly upon the biology/genetics of the species, right?  Like how common deleterious recessives are in the gene pool, that sort of thing?  So that seems like something that you would have to either (a) just assume, (b) vary with different parameter values to explore, or (c) parameterize from empirical data.  Sorry if I'm misunderstanding.

Cheers,
-B.

Benjamin C. Haller
Messer Lab
Cornell University

Yaniv Brandvain

Sep 9, 2021, 10:39:20 PM9/9/21
to slim-discuss
Thanks Ben!

Right - I was thinking of calculating inbreeding depression, not the inbreeding coefficient.
So I was thinking of evaluating the extent of inbreeding depression as its standard  measure δ = (w_out - w_self)/w_out,  in a given generation of a SLiM run (where w_out is the mean fitness of the population at a point in time if all individuals hypothetically generated by outcrossing and selfing selfed, w_self is the mean fitness of the population at a point in time if all individuals hypothetically generated by selfing).

My thought was to run a SLiMulation under some combination of parameters and then at when I want to calculate  δ I would somehow keep track of the state of the population,  , then have one generation of obligate selfing and calculate mean fitness, then go back to the previous generation and have everyone outcross and caculate mean fitness. output these two mean fitnesses and then calclulate δ . Ideally I'd be able to do this smoothly and then keep the SLiMulation going with the actual parameters rather than the hypothetical selfing rate of 1 or zero I use for that one generation for the purpose of calculating δ .

We'll try to implement this soon and can share code, but I'd appreciate any hints / tips / gotchas that come to mind!

thanks
yaniv

Ben Haller

Sep 9, 2021, 11:12:01 PM9/9/21
to slim-discuss
Oh, I see – you don't want to calculate the fitness effect of inbreeding depression given a measured degree of inbreeding, you want to calculate the fitness effect of inbreeding depression from the actual fitness values observed in the model versus what the fitness values would be under obligate selfing, or some such.

OK, well.  The simple way to do this would be to write it as a nonWF model.  Suppose you have a subpopulation p0, and the reproduction() callback for p0 generates new offspring, also in p0, for the next generation.  All you need to do is add code to that reproduction() callback – or write a second one, you can have more than one reproduction() callback for a given subpop – that generates a separate batch of offspring into a temporary dummy subpopulation, p1, under obligate selfing.  Let fitness get evaluated in both p0 and p1 as it normally would, then get the mean fitness for each subpop from SLiM and do your calculation of delta, then kill off p1 since you're done with it.  Should work fine; no need to keep track of the state, go backwards, etc.  Just generate the additional subpopulation under selfing, measure it, and destroy it.  I can write up a quick example if this is unclear.  Should be trivial.

If it needs to be a WF model, then it is much harder, and probably does have to involve saving and restoring simulation state.  Don't do that :->.  This sort of non-standard stuff is precisely why the nonWF model type exists.

Cheers,
-B.

Gregor Gorjanc

Sep 10, 2021, 3:59:28 AM9/10/21
to Yaniv Brandvain, slim-discuss
Yaniv,

Your measure seems to be a bit flawed because it does not take into account the actual level of homozygosity - if say you would, say, have all alleles fixed then there would be no difference in fitness of two types of progeny, but in fact both would have some inbreeding depression.

I would check Falconer and Mackay green book or an equivalent for the more general measure of inbreeding depression.

gg
--
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+unsubscribe@googlegroups.com.

--
Sent from mobile device

Yaniv Brandvain

Sep 10, 2021, 8:51:47 AM9/10/21
to Gregor Gorjanc, slim-discuss
Hi Gregor

This measure widely applied and standard definition of inbreeding depression and is relevant for the evolutionary process within a population. But as you note it does not include other features (e.g. the fixed load and other aspects that would reveal heterosis between populations), so a different measure like the "inbreeding load" rather than "inbreeding depression" can capture the issues you're concerned about. Box 1 of Willis and Charlesworth clarifies a bunch of this [although sadly this is a common misunderstanding, as it seems like the technical definition of inbreeding depression does not line up with what people want from it intuitively]

yaniv

yaniv

To unsubscribe from this group and stop receiving emails from it, send an email to slim-discuss...@googlegroups.com.

--
Sent from mobile device

--
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/CANpJD8JQvX03926FHFP7Rmai4zpcT4AWUxJTvN2%3DCfrev0_Acw%40mail.gmail.com.

Gregor Gorjanc

Sep 10, 2021, 9:46:45 AM9/10/21
to Yaniv Brandvain, slim-discuss

ckyri...@gmail.com

Sep 10, 2021, 10:33:16 AM9/10/21
to slim-discuss
Hi Yaniv,

I coded up this function to get an estimate of the inbreeding load (2B) from a population, which you could easily get δ from (δ=1-exp(-B/2) for the case of selfing, unless I'm mistaken). I've tested it a bit and am pretty certain its working the way I want, but would also be eager to get other eyes on it to make sure I didnt miss anything.

Here is the function. Note that it does estimate 2B, although I confusingly coded it up as B.

function (s) getInbreedingLoad(o pop, i sampSize)

{

i = sample(pop.individuals, sampSize, F);

B_pop = c();

for (individual in i) {

//get all deleterious mutation types

del_muts = c(individual.genomes.mutationsOfType(m1));

B_ind = c();

if (del_muts.length()>0) {

for(m in del_muts){

//check if mut is heterozygous

if(individual.genomes.mutationCountsInGenomes(m)==1){

//protect against case where s < -1 (can happen with gamma DFE)

s = max(m.selectionCoeff,-1.0);

//difference in fitness between het and hom is s*(h-1) (1+sh -(1+s))

B_ind = c(B_ind, s*(m.mutationType.dominanceCoeff-1));

}

}

// this is summed rather than multiplied, even if fitness is multiplicative

B_pop = c(B_pop, sum(B_ind));

}

else{

B_pop = c(B_pop, 0.0);

}

}

return(asString(mean(B_pop)));

}