Mapping genetic values to fitness#

class fwdpy11.GeneticValueToFitnessMap#

ABC for functions translating genetic values into fitness.

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#

Returns the shape (dimensonality) of the object

New in version 0.7.0.

class fwdpy11.GeneticValueIsTrait#

ABC for functions mapping genetic values representing traits to fitness.

class fwdpy11.GeneticValueIsFitness#

Type implying the the genetic value is fitness.

class fwdpy11.Optimum(optimum, VS, when=None)#

Parameters for a trait optimum.

This class has the following attributes, whose names are also kwargs for intitialization. The attribute names also determine the order of positional arguments:

Parameters:
  • optimum (float) – The trait value

  • VS (float) – Strength of stabilizing selection

  • when (int or None) – The time when the optimum shifts

New in version 0.7.1.

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

class fwdpy11.PleiotropicOptima(optima, VS, when=None)#

Parameters for multiple trait optima

This class has the following attributes, whose names are also kwargs for intitialization. The attribute names also determine the order of positional arguments:

Parameters:
  • optima (List[float]) – The trait values

  • VS (float) – Strength of stabilizing selection

  • when (int or None) – The time when the optimum shifts

New in version 0.7.1.

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

class fwdpy11.GaussianStabilizingSelection(is_single_trait, optima)#

Define a mapping of phenotype-to-fitness according to a Gaussian stabilizing selection model.

Instances of this trait must be constructed by one of the various class methods available.

classmethod pleiotropy(optima)#

Stabilizing selection with pleiotropy.

Parameters:

optima (List[fwdpy11.PleiotropicOptima]) – The optimum values. Multiple values specify a moving optimum.

classmethod single_trait(optima)#

Stabilizing selection on a single trait

Parameters:

optima (List[fwdpy11.Optimum]) – The optimum values. Multiple values specify a moving optimum.