Sample

Moonshine.SampleType
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

Info

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 rate
  • Ne (1): effective population size
  • positions: position of markers
  • sequence_length (maximum(positions)): sequence length
  • n: number of sequences
  • rng: random number generator
  • ts: Tree Sequence
  • mat: matrix of haplotypes (haplotypes -> columns)
source
Moonshine.effective_pop_sizeFunction
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).

source
Moonshine.mut_rateFunction
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).

source
Moonshine.rec_rateFunction
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).

source