-
Notifications
You must be signed in to change notification settings - Fork 94
Traits #1792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Traits #1792
Conversation
- made distribution language more general - wrote more informative errors
|
WIP ... Some thoughts on the lower part of #1792 (comment), as in these are some standard use cases and an attempt to produce each of these with ease. While thinking about these I struck me that the Stabilizing selectionDirectional selectionTODO: Discuss how to handle multiple traits here. Truncation selectionTODO: Discuss how to handle multiple traits here - the above assumes a single trait. Truncation selection (on a binary trait)The same as directional selection above, but applied to 0/1 scores? Direct effects on fitness (previous behavior)TODO: This is just a special case of directional selection on a trait, NeutralDo nothing? |


This is just (so far) taking the code from @jeffspence's
masterbranch that he and @roshnipatel have got together and making a PR so we can write out a plan and discuss things.Proposed rough API:
Note: we could alternatively instantiate
EnvironmentandFitnessFunctions to pass into theTraitconstructor,but these have to refer to "which traits do I work with", so it's cleaner to have the traits set up
before we make them.
Questions:
make_traits( )should be a dictionary, whose keys are the names of traits and values are the link functions?Notes:
exp( )Traits:Has
Environments (each of which can affect a collection of the traits)FitnessFunctions (each of which operate on a collection of the traits)EffectSizeDistributionMaps mutations to traits, so has
MultivariateMutationTypesMultivariateMutationTypeIs a (biological?) class of mutations, and so:
FitnessFunctionPossibly not public?
Has:
EnvironmentThis affects how the genetic value maps to phenotype,
including the part that changes with time/space.
Environments can affect more than one trait (so you have correlated noise).
Possibly not public?
Adds "noise" to the genetic value. Has:
Link Function
This produces the observed biological phenotype:
for instance, describes how disease liability translates to disease incidence,
so it should not change with time or location.
Link functions map only a single trait, independently of others.
GeneticValueTransform?PhenotypeTransform? Well, this applies to "genetic value plus environment" so it's not a "genetic value transform"? Something else?This transforms the underlying (genetic value plus environemtn) to the "observed trait". Has:
Examples:
List of standard use cases:
We should make it very easy to produce one of each of these,
something like
stdpopsim.traits.StabilizingSelectionOnTrait(n, sigma)Stabilizing selection on quantiative trait(s)
Directional selection on a quantitative trait
Truncation selection on a binary trait
Direct effects on fitness (previous behavior)
Neutral