PopSim
Documentation for PopSim.
PopSim.Segment
— TypeSegment(start::T, stop::T)
A genomic segment defined by its start and stop positions. The start and end positions are inclusive.
PopSim.StationaryPopulation
— TypeStationaryPopulation(ploidy::Int, size::Int)
A simple demography for population modeling.
A stationary population with a fixed ploidy and size.
PopSim.UniformRate
— TypeUniformRate(rate::Float64)
A uniform rate distribution for genetic processes.
PopSim.VaryingPopulation
— MethodVaryingPopulation(; ploidy = 2, population_sizes = [1_000], times = [0.0],
genome_length = 1_000_000, recombination_rate = 1.0e-8, mutation_rate = 1.0e-8)
Create a varying population with the given parameters.
Arguments
ploidy::Int
: The ploidy of the population. Default is 2.genome_length::Int
: The length of the genome. Default is 1000000.recombination_rate::Float64
: The recombination rate. Default is 1.0e-8.mutation_rate::Float64
: The mutation rate. Default is 1.0e-8.population_sizes::Vector{Int}
: The sizes of the population at different times. Default is [1_000].times::Vector{Float64}
: The times at which the population sizes are specified. Default is [0.0].
Notes
- The population sizes and times must have the same length.
- The times must be sorted in ascending order.
- The first time must be 0.0.
Example
To model a population which starts at N=1000, goes throw a bottleneck (N=200) from 150 genertions ago to 120 generations ago and then recovers to N=2000 individuals, you can use the following:
times = [0.0, 120.0, 150.0]
population_sizes = [2000, 200, 1000]