Sample
Moonshine.Sample — Type
struct Sample <: AbstractVector{Sequence}Contain a sample of haplotypes and informations about them.
Implements the iteration interface and the array interface.
Fields
H::Vector{Sequence}: Vector of haplotypes
μ::Float64: Unscaled (per-locus) mutation rate
ρ::Float64: Unscaled (per-locus) recombination rate
Ne::Float64: Effective population size
sequence_length::Float64: Sequence length
positions::Vector{Float64}: Marker's positions
coefs::Tuple{Float64, Float64}: Coefficients for positions' line
Constructors
Random constructor sample sequences via msprime using a binary mutation model.
Sample(H, μ, ρ, Ne, sequence_length, positions, coefs)Sample(H, μ, ρ, Ne, sequence_length, positions, coefs)defined at src/Sample.jl:37.
Sample(H; μ, ρ, Ne, positions, sequence_length)defined at src/Sample.jl:67.
Sample(treesequence)defined at src/Sample.jl:87.
Sample(rng, n, μ, ρ, Ne, sequence_length)defined at src/Sample.jl:164.
Sample(mat, positions; μ, ρ, Ne)defined at src/Sample.jl:167.
where:
H: haplotypesμ(-1): mutation rateρ(-1): recombination rateNe(1): effective population sizepositions: position of markerssequence_length(maximum(positions)): sequence lengthn: number of sequencesrng: random number generatorts: Tree Sequencemat: matrix of haplotypes (haplotypes -> columns)
Moonshine.effective_pop_size — Function
effective_pop_size(sample, haploid=true)Effective population size. If haploid=true, it is multiplied by 2; the resulting value is the haploid effective population size (assuming the stored value is for diploids).
Moonshine.mut_rate — Function
mut_rate(sample, haploid=true)Mutation rate. If haploid=true, it is multiplied by 2; the resulting value is the haploid mutation rate (assuming the stored value is for diploids).
Moonshine.rec_rate — Function
rec_rate(sample, haploid=true)Recombination rate. If haploid=true, it is multiplied by 2; the resulting value is the haploid recombination rate (assuming the stored value is for diploids).