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 rateNe::Float64: Effective population sizesequence_length::Float64: Sequence lengthpositions::Vector{Float64}: Marker's positionscoefs::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 /home/runner/work/Moonshine.jl/Moonshine.jl/src/Sample.jl:40.
Sample(H; μ, ρ, Ne, positions, sequence_length)defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Sample.jl:56.
Sample(treesequence)defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Sample.jl:71.
Sample(rng, n, μ, ρ, Ne, sequence_length)defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Sample.jl:138.
Sample(mat, positions; μ, ρ, Ne)defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Sample.jl:141.
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).