cassiopeia.sim.SimpleFitSubcloneSimulator#

class cassiopeia.sim.SimpleFitSubcloneSimulator(branch_length_neutral, branch_length_fit, experiment_duration, generations_until_fit_subclone)[source]#

Simulates a clonal population which develops one fit subclone.

This TreeSimulator simulates a (binary) clonal population that evolves neutrally with constant or generated branch length ‘branch_length_neutral’, until in generation ‘generations_until_fit_subclone’ one of the lineages develops fitness and starts to expand with the new constant or generated branch length ‘branch_length_fit’. The total length of the experiment is given by ‘experiment_duration’. This TreeSimulator is useful because (1) it generates both deterministic and stochastic phylogenies and (2) the phylogenies are as simple as possible while being non-neutral. The ability to control the branch lengths of the neutrally evolving population and of the fit subpopulation allows us to simulate different degrees of fitness as well as stochasticity.

Note that the branches for the leaves of the tree need not have length exactly equal to ‘branch_length_neutral’ nor ‘branch_length_fit’, because the population gets assayed at the arbitrary time specified by ‘experiment_duration’, which is not necessarily the time at which a division event happens.

The names of the leaf nodes will be given by a unique integer ID, followed by “_neutral” for the neutrally evolving individuals, and by “_fit” for the fit individuals.

Finally, note that it is possible to make the subclone less fit, i.e. expand slower, for there is no constraint in the branch lengths, although the most typical use case is the simulation of a more fit subpopulation.

Parameters:
branch_length_neutral Union[float, Callable[[], float]]

Branch length of the neutrally evolving individuals. All individuals are neutrally evolving until generation ‘generations_until_fit_subclone’, when exactly one of the lineages develops fitness. A callable can be provided instead of a constant, which is useful for simulating random branch lengths.

branch_length_fit Union[float, Callable[[], float]]

The branch length of the fit subclone, which appears exactly at generation ‘generations_until_fit_subclone’. A callable can be provided instead of a constant, which is useful for simulating random branch lengths.

experiment_duration float

The total length of the experiment.

generations_until_fit_subclone int

The generation at which one lineage develops fitness, giving rise to a fit subclone.

Methods

simulate_tree()[source]#

See base class.

Return type:

CassiopeiaTree