tracts.demography.base_parametrized_demography.FounderEvent#

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

Bases: BaseFounderEvent

A class that sets up a founder event. See BaseFounderEvent for details.

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.

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.

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.

Type:

str | None

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

Initializes the founder 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.

  • 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.

  • 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.

execute(parametrized_demography, params)#

Executes the founder event by modifying the migration matrix of the demography according to the parameters of the founder event.

Parameters:
  • parametrized_demography (BaseParametrizedDemography) – The demography object that the founder event is being executed on. The migration matrix of the demography will be modified according to the parameters of the founder event.

  • params (list[float]) – The list of parameters for the founder event.

Returns:

The migration matrix of the demography after the founder event has been executed.

Return type:

np.ndarray