Tree & ARG
Tree
Moonshine.Tree
— Typestruct Tree <: AbstractGenealogy
Coalescent tree.
See also Arg
.
Fields
graph::Graphs.SimpleGraphs.SimpleDiGraph{Int32}
: Tree's topologylatitudes::Vector{Float64}
: Vertices' latitudessequences::Vector{Sequence}
: Vertices' haplotypessample::Sample
: AssociatedSample
logdensity::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:42
.
Tree(sample)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Tree.jl:54
.
Tree(rng, n, μ, ρ, Ne, sequence_length)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Tree.jl:66
.
Arguments
Arguments are the same as for Sample
.
Moonshine.depth
— Functiondepth(tree, v)
Depth of a vertex.
Arg
Moonshine.Arg
— Typestruct Arg <: AbstractGenealogy
Ancestral recombination graph.
See also Tree
.
Fields
graph::Graphs.SimpleGraphs.SimpleDiGraph{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
: AssociatedSample
logdensity::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:43
.
Arg(tree)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:61
.
Arg(rng, n, μ, ρ, Ne, sequence_length)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:77
.
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:359
.
otherdad(arg, e)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:370
.
–Internal–
Moonshine.rlat_min
— Functionrlat_min(arg, e, nextidx)
Compute the minimum latitude for a recombination event rooted on e
.
–Internal–
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:96
.
recombine!(
arg,
redge,
cedge,
breakpoint,
rlat,
clat;
buffer
)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Recombination.jl:160
.
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)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Recombination.jl:697
.
build!(rng, tree; Dist, bias0, threshold_prop)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Tree.jl:243
.
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