Tree & ARG
Tree
Moonshine.Tree — Typestruct Tree <: AbstractGenealogyCoalescent tree.
See also Arg.
Fields
graph::Moonshine.ThreeTree{Int32}: Tree's topologylatitudes::Vector{Float64}: Vertices' latitudessequences::Vector{Sequence}: Vertices' haplotypessample::Sample: AssociatedSamplelogdensity::Base.RefValue{DoubleFloats.Double64}: Log-value of the associated pdf
Constructors
Random constructor calls Sample's random constructor.
These do not actually build the tree. For that, see build!(rng, tree).
Tree(graph, latitudes, sequences, sample, logdensity)
Tree(graph, latitudes, sequences, sample, logdensity)defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Tree.jl:40.
Tree(sample)defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Tree.jl:52.
Tree(rng, n, μ, ρ, Ne, sequence_length)defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Tree.jl:64.
Arguments
Arguments are the same as for Sample.
Moonshine.depth — Functiondepth(tree, v)
Depth of a vertex.
Arg
Moonshine.Arg — Typestruct Arg <: AbstractGenealogyAncestral recombination graph.
See also Tree.
Fields
graph::Moonshine.ThreeTree{Int32}: Graph's topologylatitudes::Vector{Float64}: Vertices' latitudesrecombination_mask::Vector{AncestralIntervals{Vector{IntervalSets.Interval{:closed, :open, Float64}}}}: ∩-mask for ancestral intervalsmrca::Base.RefValue{Int32}: Arg's grand MRCAsequences::Vector{Sequence}: Vertices' haplotypesancestral_intervals::Dict{Graphs.SimpleGraphs.SimpleEdge{Int32}, AncestralIntervals{Vector{IntervalSets.Interval{:closed, :open, Float64}}}}: Edges' ancestral intervalssample::Sample: AssociatedSamplelogdensity::Base.RefValue{DoubleFloats.Double64}: Log-value of the associated pdf
Constructors
Random constructor calls Sample's random constructor.
These do not actually build the arg. For that, see build!(rng, arg).
Arg(
graph,
latitudes,
recombination_mask,
mrca,
sequences,
ancestral_intervals,
sample,
logdensity
)
Arg(
graph,
latitudes,
recombination_mask,
mrca,
sequences,
ancestral_intervals,
sample,
logdensity
)defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:41.
Arg(tree)defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:59.
Arg(rng, n, μ, ρ, Ne, sequence_length)defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:75.
Arguments
Moonshine.breakpoints — Functionbreakpoints(arg)
Recombination events' positions
Moonshine.plot_breakpoints — Functionplot_breakpoints(arg; nbins, height, kwargs...)
Heatmap of recombination events' positions.
See also breakpoints
Keywords
nbins(clamp(nrecombinations(arg) ÷ 100, 1, 69)): number of bins. Its default maximum value of 69 produces a nice 80 columns wide plot.height(7): height of the plot.kwargs...: additional keywords arguments are passed directly toUnicodePlots.histogram.
Moonshine.otherdad — Functionotherdad(arg, s, d)
otherdad(arg, e)Return the parent of d that is not s for a recombination vertex d. If d is not a recombination vertex, returns s. Can also take an edge as argument.
Methods
otherdad(arg, s, d)defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:345.
otherdad(arg, e)defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:356.
–Internal–
Moonshine.rlat_min — Functionrlat_min(arg, e, nextidx)Compute the minimum latitude for a recombination event rooted on e.
–Internal–
Moonshine.recombination_mask — Functionrecombination_mask(arg, e)
Intervals of the partition of [0, ∞) induced by a recombination event for
which an edge is ancestral.Moonshine.recombine! — Functionrecombine!(arg, redge, cedge, breakpoint, rlat, clat[, stack]; buffer = default_buffer())Add a recombination event to an ARG.
Methods
recombine!(
arg,
redge,
cedge,
breakpoint,
rlat,
clat,
stack;
buffer
)defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Recombination.jl:86.
recombine!(
arg,
redge,
cedge,
breakpoint,
rlat,
clat;
buffer
)defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Recombination.jl:152.
MMN
Moonshine.next_inconsistent_idx — Functionnext_inconsistent_idx(
arg,
idx,
stack;
mutations_edges,
buffer
)
Index of the next inconsistent marker, that is the next which mutates more than once in a given ancestral recombination graph.
stack must be of type CheapStack{Edge{VertexType}} (see CheapStack).
Common
Moonshine.build! — Functionbuild!(rng, genealogy; kwargs...)Build a genealogy.
Methods
build!(rng, arg; winwidth, buffer, noprogress, conversion)defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Recombination.jl:741.
build!(rng, tree; Dist, bias0, threshold_prop)defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Tree.jl:236.
Arguments
winwidth(∞): width of the window of positions to considernoprogress(false): hide progress barDist(Hamming{Int}()): distance used to compute coalescence probabilitiesbias0(10): distance multiplier: higher values favour coalescence events between similar haplotypesthreshold_prop(1): proportion of events to consider when sampling