tracts.demography.base_parametrized_demography.BaseFounderEvent#

class BaseFounderEvent(found_time, source_populations, remainder_population, end_time=None)#

Bases: ABC

Base class for founder events. A founder event is an event in which a new population is formed from one or more source populations. The source populations contribute to the new population according to certain proportions, which can be fixed or parametrized.

found_time#

The name of the parameter defining the time of the founder event.

Type:

str

source_populations#

A dict mapping source population names to their contribution proportions. Proportions should sum to 1, but this is not enforced by the model. If they do not sum to 1, the remainder will be assigned to the remainder population.

Type:

dict[str, str]

remainder_population#

The population that contributes the remaining proportion to the new population after the source populations have contributed according to their specified proportions. This population can be one of the source populations or a different population.

Type:

str

end_time#

The name of the parameter defining the end time of the founder event. If None, the founder event is a pulse event. If not None, the founder event is a continuous event that starts at found_time and ends at end_time. In a continuous founder event, the migration rates are constant between found_time and end_time, and the total migration rate is 1 at found_time and 0 at end_time. In a pulse founder event, the migration rates are applied only at found_time.

Type:

str | None

__init__(found_time, source_populations, remainder_population, end_time=None)#

Initializes the founder event. The founder event is defined by the time of the event, the source populations and their contribution proportions, the remainder population, and the end time of the event (if it is a continuous event).

Parameters:
  • found_time (str) – The name of the parameter defining the time of the founder event.

  • source_populations (dict[str, str]) – A dict mapping source population names to their contribution proportions. Proportions should sum to 1, but this is not enforced by the model. If they do not sum to 1, the remainder will be assigned to the remainder population.

  • remainder_population (str) – The population that contributes the remaining proportion to the new population after the source populations have contributed according to their specified proportions. This population can be one of the source populations or a different population.

  • end_time (str | None) – The name of the parameter defining the end time of the founder event. If None, the founder event is a pulse event. If not None, the founder event is a continuous event that starts at found_time and ends at end_time. In a continuous founder event, the migration rates are constant between found_time and end_time, and the total migration rate is 1 at found_time and 0 at end_time. In a pulse founder event, the migration rates are applied only at found_time.