Genetic values#
For some background, see Definitions.
- class fwdpy11.DiploidGeneticValue#
ABC for genetic value calculations for diploid members of
fwdpy11.DiploidPopulation
- property genetic_values#
Return the list of genetic values.
New in version 0.3.0.
- property maps_to_fitness#
Returns True if object represents a mapping directly to fitness, and False otherwise.
New in version 0.7.0.
- property maps_to_trait_value#
Returns True if object represents a trait value, and False otherwise.
New in version 0.7.0.
- property shape#
Return the dimensions of the genetic values.
New in version 0.3.0.
- class fwdpy11.Additive(scaling, gvalue_to_fitness=None, noise=None, ndemes=1)#
Additive effects on genetic values.
This class has the following attributes, whose names are also kwargs for intitialization. The attribute names also determine the order of positional arguments:
- Parameters:
scaling (float) – How to treat mutant homozygotes.
gvalue_to_fitness (fwdpy11.GeneticValueIsTrait) – How to map trait value to fitness
noise (fwdpy11.GeneticValueNoise) – Random effects on trait values
When gvalue_to_fitness is None, then we are modeling additive effects on fitness.
For a model of fitness, the genetic value is 1, 1+e*h, 1+`scaling`*e for genotypes AA, Aa, and aa, respectively, where e and h are the effect size and dominance, respectively.
For a model of a trait (phenotype), meaning gvalue_to_fitness is not None, the values for the three genotypes are 0, e*h, and e, respectively.
Changed in version 0.8.0: Refactored to use attrs and inherit from low-level C++ class
- asblack()#
Return a string representation formatted with black
- asdict()#
Return dict representation
- classmethod fromdict(d)#
Build an instance from a dictionary
- property genetic_values#
Return the list of genetic values.
New in version 0.3.0.
- property maps_to_fitness#
Returns True if object represents a mapping directly to fitness, and False otherwise.
New in version 0.7.0.
- property maps_to_trait_value#
Returns True if object represents a trait value, and False otherwise.
New in version 0.7.0.
- property shape#
Return the dimensions of the genetic values.
New in version 0.3.0.
- class fwdpy11.Multiplicative(scaling, gvalue_to_fitness=None, noise=None, ndemes=1)#
Multiplicative effects on genetic values.
This class has the following attributes, whose names are also kwargs for intitialization. The attribute names also determine the order of positional arguments:
- Parameters:
scaling (float) – How to treat mutant homozygotes.
gvalue_to_fitness (fwdpy11.GeneticValueIsTrait) – How to map trait value to fitness
noise (fwdpy11.GeneticValueNoise) – Random effects on trait values
When gvalue_to_fitness is None, then we are modeling multiplicative effects on fitness.
For a model of fitness, the genetic value is 1, 1+e*h, 1+`scaling`*e for genotypes AA, Aa, and aa, respectively, where e and h are the effect size and dominance, respectively.
For a model of a trait (phenotype), meaning gvalue_to_fitness is not None, the values for the three genotypes are 0, e*h, and e, respectively.
Changed in version 0.8.0: Refactored to use attrs and inherit from low-level C++ class
- asblack()#
Return a string representation formatted with black
- asdict()#
Return dict representation
- classmethod fromdict(d)#
Build an instance from a dictionary
- property genetic_values#
Return the list of genetic values.
New in version 0.3.0.
- property maps_to_fitness#
Returns True if object represents a mapping directly to fitness, and False otherwise.
New in version 0.7.0.
- property maps_to_trait_value#
Returns True if object represents a trait value, and False otherwise.
New in version 0.7.0.
- property shape#
Return the dimensions of the genetic values.
New in version 0.3.0.
- class fwdpy11.GBR(gvalue_to_fitness, noise=None)#
The “gene-based recessive” trait model described in Thornton et al. 2013 http://dx.doi.org/10.1371/journal.pgen.1003258 and Sanjak et al. 2017 http://dx.doi.org/10.1371/journal.pgen.1006573.
The trait value is the geometric mean of the sum of effect sizes on each haplotype. It is undefined for the case where these sums are negative.
This class has the following attributes, whose names are also kwargs for intitialization. The attribute names also determine the order of positional arguments:
- Parameters:
gvalue_to_fitness (fwdpy11.GeneticValueIsTrait) – How to map trait value to fitness
noise (fwdpy11.GeneticValueNoise) – Random effects on trait values
Changed in version 0.8.0: Refactored to use attrs and inherit from low-level C++ class
- asblack()#
Return a string representation formatted with black
- asdict()#
Return dict representation
- classmethod fromdict(d)#
Build an instance from a dictionary
- property genetic_values#
Return the list of genetic values.
New in version 0.3.0.
- property maps_to_fitness#
Returns True if object represents a mapping directly to fitness, and False otherwise.
New in version 0.7.0.
- property maps_to_trait_value#
Returns True if object represents a trait value, and False otherwise.
New in version 0.7.0.
- property shape#
Return the dimensions of the genetic values.
New in version 0.3.0.
- class fwdpy11.AdditivePleiotropy(ndimensions, focal_trait, gvalue_to_fitness, noise=None)#
Multivariate trait values under strictly additive effects.
Calculate the trait value for a diploid in a
fwdpy11.DiploidPopulation
for a multidimensional trait.This class is restricted to the case of simple additive effects, meaning that any dominance terms associated with mutations are ignored.
During a simulation,
fwdpy11.DiploidMetadata.g
is filled with the genetic value corresponding to a “focal” trait specified upon object construction. This class has the following attributes, whose names are also kwargs for intitialization. The attribute names also determine the order of positional arguments:- Parameters:
ndimensions (int) – Number of trait dimensions
focal_trait (int) – Index of the focal trait
gvalue_to_fitness (
fwdpy11.GeneticValueToFitnessMap
) – Function mapping trait value to fitnessnoise (
fwdpy11.GeneticValueNoise
) – Function adding random additive noise to trait value
Changed in version 0.8.0: Refactored to use attrs and inherit from low-level C++ class
- asblack()#
Return a string representation formatted with black
- asdict()#
Return dict representation
- classmethod fromdict(d)#
Build an instance from a dictionary
- property genetic_values#
Return the list of genetic values.
New in version 0.3.0.
- property maps_to_fitness#
Returns True if object represents a mapping directly to fitness, and False otherwise.
New in version 0.7.0.
- property maps_to_trait_value#
Returns True if object represents a trait value, and False otherwise.
New in version 0.7.0.
- property shape#
Return the dimensions of the genetic values.
New in version 0.3.0.