Mapping genetic values to fitness

class fwdpy11.GeneticValueToFitnessMap

ABC for functions translating genetic values into fitness.

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

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.GSS(optimum: Union[fwdpy11.genetic_values.Optimum, float], VS: Optional[float] = None)

Gaussian stabilizing selection on a single trait.

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

Parameters

Note

VS should be None if optimum is an instance of fwdpy11.Optimum

Changed in version 0.7.1: Allow instances of fwdpy11.Optimum for intitialization

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.GSSmo(optima: List[fwdpy11.genetic_values.Optimum])

Gaussian stabilizing selection on a single trait with moving 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

optima (list[fwdpy11.Optimum]) – The optimal trait values

Note

Instances of fwdpy11.Optimum must have valid values for when.

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.Optimum(optimum: float, VS: float, when: Optional[int] = 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

Note

When used to model a stable optimum (e.g., fwdpy11.GSS), the when parameter is omitted. The when parameter is used for moving optima (fwdpy11.GSSmo).

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: List[float], VS: float, when: Optional[int] = 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

Note

When used to model stable optima (e.g., fwdpy11.MultivariateGSS), the when parameter is omitted. The when parameter is used for moving optima (fwdpy11.MultivariateGSSmo).

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.MultivariateGSS(optima: Union[fwdpy11.genetic_values.PleiotropicOptima, List[float]], VS: Optional[float] = None)

Multivariate gaussian stablizing selection.

Maps a multidimensional trait to fitness using the Euclidian distance of a vector of trait values to a vector of optima.

Essentially, this is Equation 1 of

Simons, Yuval B., Kevin Bullaughey, Richard R. Hudson, and Guy Sella. 2018. “A Population Genetic Interpretation of GWAS Findings for Human Quantitative Traits.” PLoS Biology 16 (3): e2002985.

For the case of moving optima, see fwdpy11.MultivariateGSSmo. This class has the following attributes, whose names are also kwargs for intitialization. The attribute names also determine the order of positional arguments:

Parameters

Note

VS should be None if optima is list[fwdpy11.PleiotropicOptima]

VS is \(\omega^2\) in the Simons et al. notation

Changed in version 0.7.1: Allow initialization with list of fwdpy11.PleiotropicOptima

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.MultivariateGSSmo(optima: List[fwdpy11.genetic_values.PleiotropicOptima])

Multivariate gaussian stablizing selection with moving 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[fwdpy11.PleiotropicOptima]) – list of optima over time

Changed in version 0.7.1: Allow initialization with list of fwdpy11.PleiotropicOptima

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