Model with additive fitness effects

253 views
Skip to first unread message

Manas G. A.

unread,
Sep 22, 2023, 5:40:48 AM9/22/23
to slim-discuss
Hi Ben,

I want to run a model where fitnesses of individuals are computed by summing over the contributions of all loci. I understand that the default model in SLiM multplies fitness effects of all loci to obtain fitnesses of individuals.

I was looking at the recipe given in section 13.2 (A simple model of variable QTL effect sizes) of the SLiM manual. 

initialize() {
initializeMutationRate(1e-7);
initializeMutationType("m1", 0.5, "f", 0.0); // neutral
initializeMutationType("m2", 0.5, "n", 0.0, 0.5); // QTLs
m2.convertToSubstitution = F;
initializeGenomicElementType("g1", m1, 1);
initializeGenomicElementType("g2", m2, 1);
initializeGenomicElement(g1, 0, 20000);
initializeGenomicElement(g2, 20001, 30000);
initializeGenomicElement(g1, 30001, 99999);
initializeRecombinationRate(1e-8);
}
mutationEffect(m2) { return 1.0; }
1 early() { sim.addSubpop("p1", 500); }
1: late() {
inds = sim.subpopulations.individuals;
phenotypes = inds.sumOfMutationsOfType(m2);
inds.fitnessScaling = 1.5 - (phenotypes - 10.0)^2 * 0.005;
if (sim.cycle % 100 == 0)
catn(sim.cycle + ": Mean phenotype == " + mean(phenotypes));
}
5000 late() {
m2muts = sim.mutationsOfType(m2);
freqs = sim.mutationFrequencies(NULL, m2muts);
effects = m2muts.selectionCoeff;
catn();
print(cbind(freqs, effects));
}

I was thinking of replacing the line highlighted in red by the following line so that fitnesses of individuals would now just be the phenotype (which itself is the sum of all selection coefficients):

inds.fitnessScaling = phenotypes;


Does this sound correct?


Additionally, if I understand correctly, this reicpe computes phenotypes of individuals by simply additing selection coeffients of all mutations in each of the two genomes present in each individual. This would mean, dominance effects (if any) specified in the initialize() callback would simply be ignored.

Is there some way of defining a model, where one computes the phenotypes of each individual by summing over the contributions of all loci while retaining dominance effects (as defined in the initialize() callback) within each locus?

Cheers,

Manas

Ben Haller

unread,
Sep 26, 2023, 11:55:14 AM9/26/23
to Manas G. A., slim-discuss
Hi Manas!

The combination of additive effects and dominance is not supported in any intrinsic way by SLiM.  It might be in the future, and I've made a note of that on an issue here:

https://github.com/MesserLab/SLiM/issues/387

In the meantime, you can certainly compute the mutational effects in script; for a given individual, you can look in the two genomes, find the mutations present, determine whether they are homozygous or heterozygous, calculate the mutational effect that results given dominance, and add those effects up to produce the fitness value for that individual.  This will probably be slow, if you have many mutations and many individuals, but for a small model it would be fine.  The uniqueMutations property and the set operations in Eidos would probably be useful for doing this.

I do wonder, however, why you want to do this.  The reason it isn't supported intrinsically by SLiM is that this model – additive effects with dominance – is not thought to be very biologically relevant, I gather – it falls outside the usual approaches in both population genetics and quantitative genetics.  (Dominance effects are not entirely outside quantitative genetics, to be fair, but they are usually ignored because they aren't relevant for "breeding values", and my impression is that empirical data indicates that dominance effects are usually small for QTLs and for quantitative traits.  I'm certainly not an expert on this though!)  So, are you really sure that this is what you want to do?  What's the motivation?

Cheers,
-B.

Benjamin C. Haller
Messer Lab
Cornell University


Manas G. A. wrote on 9/22/23 5:40 AM:
--
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/aa98b7c4-7dc2-437f-a2a4-84ff9d3242ebn%40googlegroups.com.

Gregor Gorjanc

unread,
Sep 26, 2023, 12:07:59 PM9/26/23
to slim-discuss
Ben,

Breeding values are based on average allele substitution effects, which are statistically a main effect, while dominance deviations are statistically an interaction. The standard quantitative genetic model does not impose orthogonality between the additive and dominance effects, meaning that breeding value is a function of additive and dominance effects - see below.

Looking at the classic green book from Falconer and MacKay we can see that the average allele substitution effect is alpha = a + d(q-p) (or is it p-q, I can't remember that), showing the above-stated relationship as well as dependency on frequencies! A more general version with epistasis, which also affects breeding values, is, for example, shown in https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4174947 (see equation 1).

Gregor

Ben Haller

unread,
Sep 26, 2023, 12:21:22 PM9/26/23
to Gregor Gorjanc, slim-discuss
Hi Gregor!

OK, thanks for the correction.  Interesting – this is not what I was taught when I learned quantitative genetics, I think, but I never took a formal course in it, I just picked things up along the way.  Hmm.  Well, would you agree that dominance effects are typically small, for quantitative traits, and are usually neglected in quantitative-trait models?  That is certainly my impression, but again, I'm certainly no expert on this!  What is your opinion of what Manas is proposing to do?  Do you think it is important for SLiM's support for this kind of thing to be better than it presently is?  (Sounds like a good topic for discussion when I'm in Edinburgh!  I certainly have lots to learn in this area!  :->)


Cheers,
-B.

Benjamin C. Haller
Messer Lab
Cornell University


Gregor Gorjanc wrote on 9/26/23 12:07 PM:

Gregor Gorjanc

unread,
Sep 27, 2023, 5:49:32 AM9/27/23
to slim-discuss

Hi,


See below within the lines ...


> On Tue, Sep 26, 2023 at 17:21:52, Ben Haller <bha...@mac.com> wrote:

> OK, thanks for the correction.  Interesting – this is not what I

> was taught when I learned quantitative genetics, I think, but I

> never took a formal course in it, I just picked things up along the way. 


I think the challenge is in the words used - the term additive is used in multiple ways!


1) The quantitative genetics model


phenotypic_value = intercept + genetic_value + environmental_value


is **additive** by construction to being with, but nobody mentions this!


2) Then we further decompose


genetic_value = additive_genetic_value + dominance_deviation + epistasis_deviation


where additive_genetic_value is the breeding value, which is allele substitution effects (alpha) multipled by allele dosage (if dosages are, say, 0, 1, and 2, then we have 0alpha, 1alpha, 2alpha) summed over all causal loci. There are two "additivities" here - adding up allele substitution effects within a locus, and then across the loci.


3) The allele substitution effect are obtained by regressing phenotypic values onto allele dosages, which (in a randomly mating population and without epistasis and GxE) turns out to be


alpha = a + d(q-p)


where -a and +a are values for the two homozygotes (with "origin" in the middle) and d is a value of the heterozygote relative to the "origin" - this is the standard quantitative genetics parameterisation (ala Falconer & MacKay green book page 109 - 1996 version). These -a, d, and +a values are the values of genotypes (genetic values) in the first phenotype model shown at the top. 


The a value above is sometimes referred to additive gene action at a locus, and d as a dominant gene action at a locus. 


> Hmm.  Well, would you agree that dominance effects are typically

> small, for quantitative traits, and are usually neglected in

> quantitative-trait models?  That is certainly my impression,

> but again, I'm certainly no expert on this! 


It depends! I think we need to distinguish between:


A) what is happening in reality - we don't really know, but clearly biology is highly non-linear (=non-additive), BUT obviously 1st order approximations (=additive) will capture the majority of variation


B) what we simulate - relevant discussion here, but obviously we want simulations to mimic A, but we can only set parameters based on C


C) what we can estimate from the data - indeed many studies find that the variance of breeding values seems to explain most of variance in genetic values, leading to the usual statement that most genetic variance is additive, BUT there is a caveat that breeding values are a 1st order approximation and as such capture additive and some of non-additive gene effects. Studies that report dominance variance, technically variance between dominance deviations (the part not captured by breeding values), often report small values, again indicating that most variation is additive. BUT, some of these studies are underpowered to get accurate estimates of dominance variation. On the other hand, there is quite a lot of studies of inbreeding depression and heterosis, indicating that there is dominance variation. I know that there is large inbreeding depression in maize inbred lines, which then generates very large heterosis in their hybrids. This is probably an extreme case!? Sometimes there are real dominance gene effects, but selection is keeping allele frequency low, meaning that variance at that locus will be low ...


So, its complicated. These two papers touch on some of these points


Data and Theory Point to Mainly Additive Genetic Variance for Complex Traits

https://journals.plos.org/plosgenetics/article?id=10.1371/journal.pgen.1000008


The Genetic Architecture of Quantitative Traits Cannot Be Inferred from Variance Component Analysis

https://journals.plos.org/plosgenetics/article?id=10.1371/journal.pgen.1006421


> What is your opinion of what Manas is proposing to do?

> Do you think it is important for SLiM's support for this

> kind of thing to be better than it presently is?  (Sounds

> like a good topic for discussion when I'm in Edinburgh!

> I certainly have lots to learn in this area!  :->)


If I understand Manas' question correctly, he wants to use something like the standard quantitative genetics model where -a, d, and +a values are assigned to the three genotypes, but he wants this for the population genetics model with selection coefficients? I do think this is important and done regularly with the quantitative genetics model (though arguably many skip simulation of dominance due to results discussed above). Is there a population genetics model version with additive and dominance effects on selection coefficients?


gg




Manas G. A.

unread,
Sep 29, 2023, 5:26:06 AM9/29/23
to Gregor Gorjanc, slim-discuss
Dear Gregor and Ben,

Apologies for taking an eternity to respond.

Thanks a lot for your help. Thanks Gregor for clarifying the distinction between additivity within a locus and additivity among loci.

My motivation of trying to implement an additive model is the following:

I wish to have control over the initial additive genetic variance for fitness. I hoped to do that by having an additive model for fitness among loci, while not strictly assuming additivity within each locus. This would have allowed me to compute effect sizes for each locus using the expression described by Gregor (alpha = a + d(q-p)) adapted for the "s, h" parameterization. The additive genetic variance for fitness then would  be alpha %*% L %*% (transpose(alpha)), where alpha is the vector of effect sizes for all loci, L is the diversity matrix (diagonal elements are diversities at different loci and off-diagonal elements are signed linkage disequilibria), and "%*%" is matrix multiplication.

Cheers,

Manas

--
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.

Ben Haller

unread,
Sep 29, 2023, 11:21:40 AM9/29/23
to Manas G. A., Gregor Gorjanc, slim-discuss
Hi Manas and Gregor,

Well, interesting stuff; I will ponder all of this.  :->  Gregor, let's have some conversations about this in Edinburgh next year; there's no urgency to sorting all this out (since SLiM is not going to change in this area for a while), and I think these conversations will be much easier in person.

In any case, Manas, the substance of my answer before remains unchanged: SLiM does not support doing what you want intrinsically (although it sounds like it probably should), and you can do it in script yourself but that will probably be rather slow/clumsy if there are a large number of such loci in your model.  Good luck!


Cheers,
-B.

Benjamin C. Haller
Messer Lab
Cornell University


Manas G. A. wrote on 9/29/23 5:25 AM:

Manas G. A.

unread,
Sep 29, 2023, 1:12:15 PM9/29/23
to Ben Haller, Gregor Gorjanc, slim-discuss
Thanks Ben!

Ben Haller

unread,
Oct 3, 2023, 3:38:39 PM10/3/23
to slim-discuss
Hi Manas, Gregor, and others,

A followup on this thread about additive fitness effects including dominance.  I had a bit of off-list correspondence with Katie Lotterhos, who pointed me to this file on GitHub:


This is a model by Sara Schaal with Katie, I guess (apologies if I have omitted some credit where credit is due, I'm not sure which paper(s) this code is connected to).  See lines 277-309 for the relevant bit of code for the discussion here, but here is the crux of it:

for (ind in inds){
g1_m2 = ind.genome1.mutationsOfType(m2);
g2_m2 = ind.genome2.mutationsOfType(m2);

hom = setIntersection(g1_m2, g2_m2);
het = setSymmetricDifference(g1_m2, g2_m2);

phenotype = 0.0;
if (size(hom))
phenotype = sum(hom.selectionCoeff * 2.0);
if (size(het))
phenotype = phenotype + sum(het.selectionCoeff * 2.0 * het.getValue("dom"));
ind.tagF = phenotype;

}

Looks like Sara took the same route towards implementation that I suggested earlier in this thread: using the set operations (intersection, symmetric difference) that are in Eidos to find the set of mutations that are homozygous and the set of mutations that are heterozygous.  It then handles each set in vectorized fashion.  It processes one individual at a time, so it's much less efficient than sumOfMutationsOfType() which can process a whole vector of individuals in one call; but it handles dominance.  This implementation supports a different dominance coefficient for each mutation, kept as a value in the mutation objects; see the model on GitHub for more detail on that, or also recipe 10.6 in the manual which does the same thing.  If you just wanted a fixed dominance coefficient, the recipe could be a bit simpler/faster.

Thanks to Sara and Katie for sharing this code publicly.  Now that I realize that this is a thing people commonly want to do in quantitative-genetics models, the impetus for me to provide a cleaner (and faster) way of doing it in SLiM is increased.  Stay tuned (but don't hold your breath).  :->

Cheers,
-B.

Benjamin C. Haller
Messer Lab
Cornell University

Reply all
Reply to author
Forward
0 new messages