Setting up genomic intervals

class fwdpy11.Region(beg: float, end: float, weight: float, coupled: bool = True, label: int = 0)

A genomic region, defined by half-open interval [beg, end)

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

Parameters
  • beg (float) – the beginning of the region

  • end (float) – the end of the region

  • weight (float) – the weight to assign

  • coupled (bool) – if True, the weight is converted to (end-beg)*weight

  • label (numpy.uint16) – Not relevant to recombining regions. Otherwise, this value will be used to fill fwdpy11.Mutation.label.

When coupled is True, the “weight” may be interpreted as a “per base pair” (or per unit, generally speaking) term.

Changed in version 0.3.0: Refactored from a pure Python class to a C++/pybind11 class

Changed in version 0.8.0: Refactored to use attrs and inherit from low-level C++ class

class fwdpy11.Sregion

Representation of a “region” in a simulation with a dominance term.

This class is an ABC.

Changed in version 0.13.a2: Added “scaling” attribute.

Changed in version 0.3.0: Refactored from a pure Python class to a C++/pybind11 class

Changed in version 0.8.0: C++ version of class API minimized in favor of attrs.

This class is an ABC derived from fwdpy11.Region

class fwdpy11.ConstantS(beg: float, end: float, weight: float, s: float, h: float = 1.0, coupled: bool = True, label: int = 0, scaling: float = 1.0)

Mutations with fixed effect sizes

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

Parameters
  • beg (float) – the beginning of the region

  • end (float) – the end of the region

  • weight (float) – the weight to assign

  • s (float) – the selection coefficient

  • h (float) – the dominance

  • coupled (bool) – if True, the weight is converted to (end-beg)*weight

  • label (numpy.uint16) – Fill fwdpy11.Mutation.label with this value.

  • scaling (float) – The scaling of the DFE

When coupled is True, the “weight” may be interpreted as a “per base pair” (or per unit, generally speaking) term.

Changed in version 0.8.0: Refactored to use attrs and inherit from low-level C++ class

class fwdpy11.UniformS(beg: float, end: float, weight: float, lo: float, hi: float, h: float = 1.0, coupled: bool = True, label: int = 0, scaling: float = 1.0)

Uniform distrubution of effect sizes

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

Parameters
  • beg (float) – the beginning of the region

  • end (float) – the end of the region

  • weight (float) – the weight to assign

  • lo (float) – lower bound on s

  • hi (float) – upper bound on s

  • h (float) – the dominance

  • coupled (bool) – if True, the weight is converted to (end-beg)*weight

  • label (numpy.uint16) – Fill fwdpy11.Mutation.label with this value.

  • scaling (float) – The scaling of the DFE

When coupled is True, the “weight” may be interpreted as a “per base pair” (or per unit, generally speaking) term.

Changed in version 0.8.0: Refactored to use attrs and inherit from low-level C++ class

class fwdpy11.ExpS(beg: float, end: float, weight: float, mean: float, h: float = 1.0, coupled: bool = True, label: int = 0, scaling: float = 1.0)

Exponential distribution of effect sizes

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

Parameters
  • beg (float) – the beginning of the region

  • end (float) – the end of the region

  • weight (float) – the weight to assign

  • mean – the mean selection coefficient

  • h (float) – the dominance

  • coupled (bool) – if True, the weight is converted to (end-beg)*weight

  • label (numpy.uint16) – Fill fwdpy11.Mutation.label with this value.

  • scaling (float) – The scaling of the DFE

When coupled is True, the “weight” may be interpreted as a “per base pair” (or per unit, generally speaking) term.

Changed in version 0.8.0: Refactored to use attrs and inherit from low-level C++ class

class fwdpy11.GammaS(beg: float, end: float, weight: float, mean: float, shape_parameter: float, h: float = 1.0, coupled: bool = True, label: int = 0, scaling: float = 1.0)

Gamma distribution of effect sizes

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

Parameters
  • beg (float) – the beginning of the region

  • end (float) – the end of the region

  • weight (float) – the weight to assign

  • mean (float) – the mean selection coefficient

  • shape (float) – the shape parameter of the distribution

  • h (float) – the dominance

  • coupled (bool) – if True, the weight is converted to (end-beg)*weight

  • label (numpy.uint16) – Fill fwdpy11.Mutation.label with this value.

  • scaling (float) – The scaling of the DFE

When coupled is True, the “weight” may be interpreted as a “per base pair” (or per unit, generally speaking) term.

Changed in version 0.8.0: Refactored to use attrs and inherit from low-level C++ class

class fwdpy11.GaussianS(beg: float, end: float, weight: float, sd: float, h: float = 1.0, coupled: bool = True, label: int = 0, scaling: float = 1.0)

Gaussian distribution of effect sizes

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

Parameters
  • beg (float) – the beginning of the region

  • end (float) – the end of the region

  • weight (float) – the weight to assign

  • sd (float) – standard deviation of effect sizes

  • h (float) – the dominance

  • coupled (bool) – if True, the weight is converted to (end-beg)*weight

  • label (numpy.uint16) – Fill fwdpy11.Mutation.label with this value.

  • scaling (float) – The scaling of the DFE

When coupled is True, the “weight” may be interpreted as a “per base pair” (or per unit, generally speaking) term.

Changed in version 0.8.0: Refactored to use attrs and inherit from low-level C++ class

class fwdpy11.MultivariateGaussianEffects(beg: float, end: float, weight: float, cov_matrix: numpy.ndarray, fixed_effect: float = 0.0, h: float = 1.0, coupled: bool = True, label: int = 0)

Pleiotropic effects via a multivariate Gaussian distribution.

This class can be used to generate mutations with both vectors of effect sizes as well as a separate fixed effect.

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

Parameters
  • beg (float) – Beginning of the region

  • end (float) – End of the region

  • weight (float) – Weight on the region

  • matrix (numpy.ndarray) – Variance-covariance matrix

  • fixed_effect (float) – Fixed effect size. Defaults to 0.0.

  • h (float) – Dominance. Defaults to 1.0

  • coupled (bool) – Specify if weight is function of end-beg or not. Defaults to True

  • label (numpy.uint16) – Fill fwdpy11.Mutation.label with this value.

The input matrix must be square and semi-positive definite. If either of these conditions are not met, ValueError will be raised. ValueError will also be raised if the input matrix contains any non-finite values.

Note

The dominance parameter (h) applies to both the fixed effect and those drawn from a multivariate normal.

New in version 0.3.0.

Changed in version 0.8.0: Refactored to use attrs and inherit from low-level C++ class

class fwdpy11.LogNormalS(beg: float, end: float, weight: float, zeta: Optional[float], sigma: Optional[float], h: float = 1.0, coupled: bool = True, label: int = 0, scaling: float = 1.0)

Log-normal distribution of effect sizes.

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

Parameters
  • beg (float) – the beginning of the region

  • end (float) – the end of the region

  • weight (float) – the weight to assign

  • zeta (float) – the zeta parameter

  • sigma (float) – the sigma parameter

  • h (float) – the dominance

  • coupled – if True, the weight is converted to(end-beg)*weight

  • label (numpy.uint16) – Fill fwdpy11.Mutation.label with this value.

  • scaling (float) – The scaling of the DFE

When coupled is True, the “weight” may be interpreted as a “per base pair” (or per unit, generally speaking) term.

New in version 0.7.0.

Changed in version 0.8.0: Refactored to use attrs and inherit from low-level C++ class

classmethod mv(beg: float, end: float, weight: float, h: float = 1.0, coupled: bool = True, label: int = 0, scaling: float = 1.0)

Factory method to create an instance compatible with fwdpy11.mvDES. See Different effect sizes of mutations in different demes for details.

Parameters
  • beg (float) – the beginning of the region

  • end (float) – the end of the region

  • weight (float) – the weight to assign

  • h (float) – the dominance

  • coupled (bool) – if True, the weight is converted to(end-beg)*weight

  • label (numpy.uint16) – Fill fwdpy11.Mutation.label with this value.

  • scaling (float) – The scaling of the DFE

class fwdpy11.mvDES(des: object, means: object, matrix: Optional = None)

General multivariate distribution of effect sizes.

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

Parameters
  • des (list) – Distributions of effect sizes

  • means (numpy.ndarray) – means marginal gaussian Distributions

  • matrix (numpy.ndarray) – Variance/covariance matrix

New in version 0.7.0.

Changed in version 0.8.0: Refactored to use attrs and inherit from low-level C++ class

class fwdpy11.GeneticMapUnit

ABC for components of genetic maps

New in version 0.3.0.

Changed in version 0.5.0: Refactored back-end to be based on fwdpp types

class fwdpy11.PoissonInterval(beg: float, end: float, mean: float)

Generate poisson number of crossover breakpoints.

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

Parameters
  • beg (float) – The beginning of the region

  • end (float) – The end of the region

  • mean (float) – The mean number of breakpoints per meiosis

New in version 0.3.0.

Changed in version 0.5.0: Refactored back-end to be based on fwdpp types

Changed in version 0.7.1: Add __repr__

Changed in version 0.8.0: Refactored to use attrs and inherit from low-level C++ class

This class inherits from fwdpy11.GeneticMapUnit

class fwdpy11.PoissonPoint(position: float, mean: float)

Generate a recombination breakpoint at a fixed position if the number of crossover events is odd.

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

Parameters
  • position (float) – The position of the crossover

  • mean (float) – The mean number of breakpoints per meiosis

New in version 0.3.0.

Changed in version 0.5.0: Refactored back-end to be based on fwdpp types

Changed in version 0.7.1: Add __repr__

Changed in version 0.8.0: Refactored to use attrs and inherit from low-level C++ class

This class inherits from fwdpy11.GeneticMapUnit

class fwdpy11.BinomialPoint(position: float, probability: float)

Generate a crossover breakpoint at a fixed position with a fixed probability. This class represents genetic distance as centiMorgans/100.

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

Parameters
  • position (float) – The beginning of the region

  • probability (float) – The probability of a recombination (per meiosis).

New in version 0.3.0.

Changed in version 0.5.0: Refactored back-end to be based on fwdpp types

Changed in version 0.7.1: Add __repr__

Changed in version 0.8.0: Refactored to use attrs and inherit from low-level C++ class

This class inherits from fwdpy11.GeneticMapUnit

class fwdpy11.FixedCrossovers(beg: float, end: float, num_xovers: int)

Generate a fixed number of crossover breakpoints.

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

Parameters
  • beg (float) – The beginning of the region

  • end (float) – The end of the region

  • num_xovers (float) – The number of breakpoints per meiosis

New in version 0.3.0.

Changed in version 0.5.0: Refactored back-end to be based on fwdpp types

Changed in version 0.7.1: Add __repr__

Changed in version 0.8.0: Refactored to use attrs and inherit from low-level C++ class

This class inherits from fwdpy11.GeneticMapUnit

class fwdpy11.BinomialInterval(beg: float, end: float, probability: float)

Generate exactly one crossover with a given probability

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

Parameters
  • beg (float) – The beginning of the region

  • end (float) – The end of the region

  • probability (float) – The probability of a recombination (per meiosis).

New in version 0.5.2.

Changed in version 0.7.1: Add __repr__

Changed in version 0.8.0: Refactored to use attrs and inherit from low-level C++ class

This class inherits from fwdpy11.GeneticMapUnit