Module fwdpy11.conditional_models#

Defining models with specific outcomes.

The API of this module may be subjet to change. Hence, the documentation is minimal.

exception fwdpy11.conditional_models.AddMutationFailure#
class fwdpy11.conditional_models.AlleleCount(count)#

Specify a number of copies of a mutation.

Parameters:

count (int) – Initial number of copies of a mutation. This value must be > 0.

count#
class fwdpy11.conditional_models.AlleleCountRange(minimum, maximum)#

Specify a range for a number of copies of a mutation.

Parameters:
  • minimum (int) – Minimum number of copies of a mutation. This value must be > 0.

  • maximum (int) – Maximum number of copies of a mutation. This value must be > minimum.

maximum#
minimum#
class fwdpy11.conditional_models.AncientSamplePolicy(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)#

When to record “preserved” or “ancient” samples:

COMPLETION = 2#

Only record the generation when the terminiation condition is first met.

DURATION = 1#

During the entire sojourn of the mutation from when it is first added to when the terminiation condition is first met.

NEVER = 0#

Never.

class fwdpy11.conditional_models.ConditionalModelOutput(*, pop, params, mutation_index, fixation_index, num_descendant_nodes)#
fixation_index#

The index of the new mutation in pop.fixations

mutation_index#

The index of the new mutation in pop.mutations

num_descendant_nodes#

The number of alive nodes initially containing the new mutation

params#

The evolved model parameters

pop#

The population with the added mutation

class fwdpy11.conditional_models.EvolveOptions(simplification_interval=100, suppress_table_indexing=True, record_gvalue_matrix=False, preserve_first_generation=False)#

Options to pass on too fwdpy11.evolvets().

asdict()#

Return dict representation

classmethod fromdict(d)#

Build an instance from a dictionary

preserve_first_generation#
record_gvalue_matrix#
simplification_interval#
suppress_table_indexing#
class fwdpy11.conditional_models.FocalDemeFixation(deme)#

A terminiation condition checking for fixation in a specific deme.

deme#
class fwdpy11.conditional_models.FrequencyRange(minimum, maximum)#

Specify a range for the initial frequency of a mutation

Parameters:
  • minimum (float) – Minimum frequency of a mutation. This value must be > 0.0 and < 1.0.

  • maximum (float) – Maximum frequency of a mutation. This value must be > minimum.

maximum#
minimum#
class fwdpy11.conditional_models.GlobalFixation#

A terminiation condition monitoring for global fixation of the mutation.

class fwdpy11.conditional_models.NewMutationParameters(*, deme=None, frequency, position, data)#

Details of a new mutation to add to a population.

Class instances are created via keyword arguments that become attribute names:

Parameters:
data#
deme#
frequency#
position#
exception fwdpy11.conditional_models.OutOfAttempts#
class fwdpy11.conditional_models.PositionRange(*, left, right)#

Specify a half-open interval within which to place a mutation.

Parameters:
  • left (float) – The left edge, inclusive, of the interval

  • right (float) – The right edge, exclusive, of the interval

left#
right#
class fwdpy11.conditional_models.SimulationStatus(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)#
Continue = 1#
Restart = 0#
Success = 2#
fwdpy11.conditional_models.track_added_mutation(rng, pop, params, mutation_parameters, *, when=None, until=None, max_attempts=None, sampling_policy=None, stopping_condition=None, evolvets_options=None, return_when_stopping_condition_met=False)#

Track the fate of a specific mutation added to the population.

Parameters:
fwdpy11.conditional_models.selective_sweep(rng, pop, params, mutation_parameters, stopping_condition, **kwargs)#

This function is a wrapper around fwdpy11.conditional_models.track_added_mutation().

This function requires a stopping_condition. If when is not given as a keyword argument, it is assumed to be 0. The keyword argument until is not allowed.