AbstractGenealogy
Types
Moonshine.AbstractGenealogy
— Typeabstract type AbstractGenealogy <: Graphs.SimpleGraphs.AbstractSimpleGraph{Int32}
Abstract type for genealogies.
Implements the Graphs.jl interface so that subtypes implementing the AbstractGenealogy interface can additionally be treated as regular graphs.
Tree & Arg are subtypes that implement the AbstractGenealogy interface.
Moonshine.EdgesInterval
— Typestruct EdgesInterval{T, I, E}
Flexible edge iterators that supports various constraints.
Possible constraints are any combination of the following:
- An interval of genetic positions. Any non-ancestral edge is ignored.
- A minimum latitude. Any edge under that latitude is ignored. An edge
e
is considered under a latitudel
iflatitude(genealogy, dst(e)) < l
. - A set of predicates. If any of the predicates evaluate to true for a given edge, that edge is ignored.
Do not construct directly, use edges_interval
instead.
Fields
genealogy::Any
: Genealogy to iterate overωs::Any
: Interval to considerbuffer::CheapStack
: Edges buffervisited::UnsafeArrays.UnsafeArray{Bool, 1}
: True is associated recombination vertex has been visited previouslymin_latitude::Float64
: Only consider edges located above this latitudeblock_predicates::Array{FunctionWrappers.FunctionWrapper{Bool, Tuple{E}}, 1} where E
: Edges for which one of the predicates is true are blocked
Constructors
EdgesInterval(
genealogy,
ωs,
buffer,
visited,
min_latitude,
block_predicates
)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:1048
.
EdgesInterval(genealogy, ωs, stack, visited)
EdgesInterval(genealogy, ωs, stack, visited, root)
EdgesInterval(
genealogy,
ωs,
stack,
visited,
root,
min_latitude
)
EdgesInterval(
genealogy,
ωs,
stack,
visited,
root,
min_latitude,
block_predicates
)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:1062
.
EdgesInterval(genealogy, ωs, store, visited)
EdgesInterval(genealogy, ωs, store, visited, root)
EdgesInterval(
genealogy,
ωs,
store,
visited,
root,
min_latitude,
block_predicates
)
EdgesInterval(
genealogy,
ωs,
store,
visited,
root,
min_latitude
)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:1076
.
–Internal–
Functions
Interface
AbstractGenealogy
interface. Subtypes must implement every method unless otherwise specified.
General
Moonshine.dens
— Functiondens(genealogy; logscale = false)
Likelihood of a genealogy.
Implementation
Only mandatory if copulas are to be fitted on the genealogy.
Methods
dens(arg; logscale)
dens(tree; logscale)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/genealogy_common.jl:48
.
Moonshine.describe
— Functiondescribe(genealogy, long = true)
Return a string containing a long or short description of a genealogy. Used internally by pretty printing functions.
Methods
describe()
describe(, long)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:89
.
describe()
describe(, long)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Tree.jl:77
.
Moonshine.graph
— Functiongraph(genealogy)
Return the underlying graph of a genealogy.
Methods
graph(arg)
graph(tree)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/genealogy_common.jl:31
.
Vertices/Edges
Moonshine.latitudes
— Functionlatitudes(genealogy[, vs])
Return the latitudes of (a subset of) the internal vertices of a genealogy.
See also latitude
to get the latitude of a single vertex.
Implementation
A default implementation for latitudes(::AbstractGenealogy, ::Any)
is available; only latitudes(::T)
is required.
Methods
latitudes(genealogy, vs)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:80
.
latitudes(arg)
latitudes(tree)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/genealogy_common.jl:31
.
Moonshine.latitude
— Functionlatitude(genealogy, v)
Latitude of a vertex.
See also latitudes
to get the latitudes of internal vertices stored in a genealogy.
Methods
latitude(arg, v)
latitude(tree, v)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/genealogy_common.jl:42
.
Moonshine.leaves
— Functionleaves(genealogy)
Return an interable containing the leaves of a genealogy.
See also ivertices
for internal vertices and nleaves
for the number of leaves.
Implementation
Default implementations assume that the first nleaves(genealogy)
vertices are the leaves of the genealogy. If this is the case for your type, you do not need to implement this method.
Moonshine.ivertices
— Functionivertices(genealogy)
Return an interable containing the internal vertices of a genealogy.
See also leaves
for leaves and nivertices
for the number of leaves and internal vertices.
Implementation
Default implementations assume that the first nleaves(genealogy)
vertices are the leaves of the genealogy. If this is the case for your type, you do not need to implement this method.
Moonshine.maxdads
— Functionmaxdads(genealogy)
Maximum possible number of parents for a vertex. See also maxchildren
.
Implementation
Must be a generated function.
Methods
maxdads(_)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:111
.
maxdads(_)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Tree.jl:83
.
–Internal–
Moonshine.maxchildren
— Functionmaxchildren(genealogy)
Maximum possible number of children for a vertex. See also maxdads
.
Implementation
Must be a generated function.
Methods
maxchildren(_)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:113
.
maxchildren(_)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Tree.jl:85
.
–Internal–
Sequences
Moonshine.positions
— Functionpositions(genealogy)
Positions of the markers.
Methods
positions(sample)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Sample.jl:163
.
positions(arg)
positions(tree)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/genealogy_common.jl:35
.
Moonshine.sequences
— Functionsequences(genealogy[, e])
sequences(genealogy[, vs])
Sequences of a genealogy. If an edge is specified, return the sequences associated with the vertices incident to that edge. If an iterable of vertices is specified, return the sequences associated with these vertices.
See also sequence
to get the sequence associated with a vertex.
Implementation
Custom types only need to implement sequences(::T)
.
Methods
sequences(genealogy, vs)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:147
.
sequences(genealogy, e)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:149
.
sequences(arg)
sequences(tree)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/genealogy_common.jl:31
.
Ancestrality
Moonshine.ancestral_intervals
— Functionancestral_intervals(genealogy, x)
Interval for which x is ancestral. Default implementation assumes that anything is ancestral for [0, ∞).
See also ancestral_intervals!
for a non-allocating alternative.
Methods
ancestral_intervals(arg, e)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:191
.
ancestral_intervals(arg, v)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:204
.
ancestral_intervals(genealogy, x)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:204
.
Moonshine.ancestral_intervals!
— Functionancestral_intervals!(ωs, genealogy, x)
Interval for which x is ancestral. Default implementation assumes that anything is ancestral for [0, ∞).
See also ancestral_intervals
.
Methods
ancestral_intervals!(ωs, arg, e; wipe, simplify)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:183
.
ancestral_intervals!(ωs, arg, v; wipe)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:193
.
ancestral_intervals!(ωs, _, _)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:221
.
Moonshine.mrca
— Functionmrca(genealogy[, vs = leaves(genealogy), ωs = Ω(0, ∞)])
Most recent common ancestor of a set of vertices.
See also tmrca
for the time to the most recent common ancestor.
Methods
mrca(arg)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:107
.
mrca(arg, ωs)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:109
.
mrca(tree)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Tree.jl:79
.
mrca(tree, _)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Tree.jl:81
.
mrca(arg, vs, x; buffer)
mrca(tree, vs, x; buffer)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/genealogy_common.jl:77
.
mrca(arg, vs)
mrca(tree, vs)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/genealogy_common.jl:101
.
Recombinations
Moonshine.recombinations
— Functionrecombinations(genealogy)
Iterator over the recombination vertices of a genealogy.
Implementation
Default implementation returns an empty iterator.
Methods
recombinations(arg)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:95
.
recombinations(_)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:258
.
Moonshine.isrecombination
— Functionisrecombination(genealogy, v)
Returns true if vertex v
is a recombination for genealogy
.
Default implementation always returns false
.
Methods
isrecombination(_, v, n)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:91
.
isrecombination(arg, v)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:93
.
isrecombination(_, _)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:273
.
Moonshine.nrecombinations
— Functionnrecombinations(genealogy)
Number of recombinations.
Implementation
Default implementation returns 0.
Methods
nrecombinations(arg)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:105
.
nrecombinations(_)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:242
.
Plotting
Moonshine.plot_layout
— Functionplot_layout(genealogy)
Layout function for genealogy plotting.
Implementation
Defaults to Spring()
.
Methods
plot_layout(arg)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:167
.
plot_layout(_)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:290
.
–Internal–
General
Vertices/Edges
Moonshine.nleaves
— Functionnleaves(genealogy)
Number of leaves in a genealogy.
See also leaves
for an iterable over leaves and nivertices
for an internal vertices counterpart.
Methods
nleaves(arg)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:87
.
nleaves(genealogy)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:563
.
nleaves(tree)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Tree.jl:75
.
Moonshine.nivertices
— Functionnivertices(genealogy)
Number of internal vertices in a genealogy.
See also ivertices
for an iterable over internal vertices and nleaves
for a leaves counterpart.
Moonshine.isleaf
— FunctionMoonshine.isroot
— FunctionMoonshine.isivertex
— FunctionMoonshine.branchlength
— Functionbranchlength(genealogy)
branchlength(genealogy, ωs)
branchlength(genealogy, e)
Total branch length of a genealogy. If an interval is specified, returns the branch length of the associated marginal genealogy. If an edge is specified, returns the length of that edge.
Methods
branchlength(genealogy, e)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:615
.
branchlength(genealogy)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:618
.
branchlength(genealogy, ωs; buffer)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:620
.
branchlength(genealogy, s, d)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:1020
.
Moonshine.edges_interval
— Functionedges_interval(genealogy, ωs)
edges_interval(genealogy, ωs, buffer, visited, root = mrca(genealogy), min_latitude = zero(Float64), block_predicates = [])
Iterage over a genealogy's edges via EdgesInterval
.
buffer
can be either a CheapStack
or an UnsafeArray
that will be used as buffer for a newly constructed CheapStack
.
Methods
edges_interval(
genealogy,
ωs,
buffer,
visited,
root,
min_latitude;
block_predicates
)
edges_interval(genealogy, ωs, buffer, visited, root; ...)
edges_interval(genealogy, ωs, buffer, visited; ...)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:1137
.
edges_interval(genealogy, ωs)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:1142
.
Moonshine.edgesmap
— Functionedgesmap(genealogy)
Return a Dict
that maps every edge of a genealogy to an integer in 1:ne(genealogy)
.
Moonshine.nlive
— Functionnlive(genealogy, lat, ωs; block_predicates, buffer)
Number of live edges in a (marginal) genealogy at a given latitude.
block_predicate
is passed directly to edges_interval
.
See also nlive!
.
Moonshine.nlive!
— Functionnlive!(counts, genealogy, lats, ωs[, stack]; block_predicates = [], buffer = default_buffer())
Number of live edges in a (marginal) genealogy at a given latitude.
Counts are stored in counts
which is filled with 0s initially. ̀lats
must be the same size as counts
.
block_predicate
and stack
are passed directly to edges_interval
.
See also nlive
.
Methods
nlive!(
counts,
genealogy,
lats,
ωs,
stack;
block_predicates,
buffer
)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:1208
.
nlive!(
counts,
genealogy,
lats,
ωs;
block_predicates,
buffer
)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:1237
.
Moonshine.ismutation_edge
— Functionismutation_edge(genealogy, e, idx)
Determines if an edge is a mutation edge for a given marker.
Sequences
Moonshine.sequence
— Functionsequence(genealogy, v)
Sequence of a genealogy associated with a vertex.
See also sequences
to get all the sequences of a genealogy.
Moonshine.idxtopos
— Functionidxtopos(genealogy, idx)
Return the position of the marker given its index.
Methods
idxtopos(genealogy, idx)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:377
.
idxtopos(sample, idx)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Sample.jl:169
.
Moonshine.postoidx
— Functionpostoidx(genealogy, pos)
Return the largest marker's index that is at a position lesser than the one given.
Methods
postoidx(genealogy, pos)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:377
.
postoidx(sample, pos)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Sample.jl:177
.
postoidx(sample, ω)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Sample.jl:220
.
Moonshine.nmarkers
— Functionnmarkers(genealogy[, ωs])
Number of markers in the sequences of a genealogy. If an interval ωs
is specified, returns the number of markers contained in that interval.
Methods
nmarkers(genealogy, ωs)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:598
.
nmarkers(sample)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Sample.jl:165
.
nmarkers(sample, ω)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Sample.jl:167
.
Moonshine.nmutations
— Functionnmutations(genealogy[, e])
Number of mutation on a genealogy. If an edge is specified, return the number of mutations on that edge.
See also nmutations!
for a non-allocating alternative.
Methods
nmutations(genealogy)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:1007
.
nmutations(genealogy, e)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:1013
.
nmutations(genealogy, s, d)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:1020
.
Moonshine.nmutations!
— Functionnmutations!(mask, genealogy, e)
Number of mutation on a genealogy. If an edge is specified, return the number of mutations on that edge.
See also nmutations
.
Ancestrality
Moonshine.dad
— Functiondad(genealogy, v)
Return the parent of a vertex or 0 if none. It only makes sense to use this method if you know v
has a single parent. Otherwise use dads
.
See also child
, descendants
, ancestors
and ̀siblings
.
Moonshine.dads
— Functiondads(genealogy, v[, ωs])
Parents of a vertex, optionally restricted to a marginal genealogy. If you know in advance that v
has a single dad, use ̀̀dad
instead.
The following rules are used to decide if an edge e
is ancestral:
- If ωs is a number, the ancestral interval of
e
must cover ωs. - If ωs is an Ω or a set of Ωs, the intersection of the ancestral interval of
e
with ωs must be non-empty.
Return a reference to the underlying adjacency lists. No touchy!
See also child
, children
, sibling
, siblings
, descendants
and ancestors
.
Methods
dads(arg, v, ωs)
dads(arg, v, ωs)
dads(arg, v, ωs)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:123
.
dads(genealogy, v)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:735
.
Moonshine.child
— Functionchild(genealogy, v)
Return the child of a vertex or 0 if none. It only makes sense to use this method if you know v
has a single child. Otherwise use children
.
See also dad
, ancestors
, descendants
and ̀siblings
.
Moonshine.children
— Functionchildren(genealogy, v[, ωs])
Children of a vertex, optionally restricted to a marginal genealogy. If you know in advance that v
has a single child, use ̀̀child
instead.
The following rules are used to decide if an edge e
is ancestral:
- If ωs is a number, the ancestral interval of
e
must cover ωs. - If ωs is an Ω or a set of Ωs, the intersection of the ancestral interval of
e
with ωs must be non-empty.
Return a reference to the underlying adjacency lists. No touchy!
See also dad
, dads
, sibling
, siblings
, descendants
and ancestors
.
Methods
children(arg, v, ωs)
children(arg, v, ωs)
children(arg, v, ωs)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:123
.
children(genealogy, v)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:735
.
Moonshine.ancestors
— Functionancestors(genealogy, v[, ωs])
ancestors(genealogy, v[, ωs], buf_ptr)
Ancestors of a vertex, optionally restricted to a marginal genealogy.
A pointer to some kind of buffer (an array for instance) can be provided to avoid allocation. In that case, an UnsafeArray
wrapped around it will be returned.
The following rules are used to decide if an edge e
is ancestral:
- If ωs is a number, the ancestral interval of
e
must cover ωs. - If ωs is an Ω or a set of Ωs, the intersection of the ancestral interval of
e
with ωs must be non-empty.
See also child
, dad
, children
, dads
, sibling
, siblings
and descendants
.
Methods
ancestors(genealogy, v)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:822
.
ancestors(genealogy, v, ω)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:855
.
Moonshine.descendants
— Functiondescendants(genealogy, v[, ωs])
descendants(genealogy, v[, ωs], buf_ptr)
Descendants of a vertex, optionally restricted to a marginal genealogy.
A pointer to some kind of buffer (an array for instance) can be provided to avoid allocation. In that case, an UnsafeArray
wrapped around it will be returned.
The following rules are used to decide if an edge e
is ancestral:
- If ωs is a number, the ancestral interval of
e
must cover ωs. - If ωs is an Ω or a set of Ωs, the intersection of the ancestral interval of
e
with ωs must be non-empty.
See also child
, dad
, children
, dads
, sibling
, siblings
and ancestors
.
Methods
descendants(genealogy, v)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:822
.
descendants(genealogy, v, ω)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:855
.
Moonshine.sibling
— Functionsibling(genealogy, v)
Sibling of a vertex, that is the other vertex in the genealogy that have the same parent. It only makes sense to use this method if you know v
has a single sibling. Otherwise use siblings
.
See also child
, dad
, children
, dads
, descendants
and ancestors
.
Moonshine.siblings
— Functionsiblings(genealogy, v[, ωs])
siblings(genealogy, v[, ωs], buf_ptr)
Siblings of a vertex, that is the other vertices in the genealogy that share at least one parent, optionally restricted to a marginal genealogy.
A pointer to some kind of buffer (an array for instance) can be provided to avoid allocation. In that case, an UnsafeArray
wrapped around it will be returned.
If you know in advance that v
has a single sibling, you can use sibling
instead.
See also child
, dad
, children
, dads
, descendants
and ancestors
.
Methods
siblings(genealogy, v, args)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:913
.
Moonshine.ancestral_mask
— Functionancestral_mask(reference, x; ωs_buf = Set{Ω}())
Mask non ancestral positions to 0. If wipe = true
, all markers in η
will be initialized to 0.
Methods
ancestral_mask(arg, x)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:224
.
ancestral_mask(e, arg)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:229
.
ancestral_mask(genealogy, x)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:392
.
ancestral_mask(sample, x)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Sample.jl:326
.
Moonshine.ancestral_mask!
— Functionancestral_mask!(η, reference, x; ωs_buf = Set{Ω}(), wipe = true)
Mask non ancestral positions to 0. If wipe = true
, all markers in η
will be initialized to 0.
Methods
ancestral_mask!(η, arg, e; wipe)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:206
.
ancestral_mask!(h, arg, v; wipe)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Arg/Arg.jl:209
.
ancestral_mask!(η, genealogy, x; wipe)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:408
.
ancestral_mask!(v, sample, ω; wipe)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Sample.jl:300
.
ancestral_mask!(η, sample, ω; wipe)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Sample.jl:310
.
ancestral_mask!(η, sample, ωs; wipe)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Sample.jl:316
.
ancestral_mask!(η, sample, pos; wipe)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Sample.jl:329
.
Moonshine.tmrca
— Functiontmrca(genealogy[, vs])
Time to the most recent common ancestor (MRCA) of (a subset of) vertices.
Methods
tmrca(genealogy)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:642
.
tmrca(genealogy, vs)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/Genealogy.jl:649
.
tmrca(arg, vs, ωs)
tmrca(tree, vs, ωs)
defined at /home/runner/work/Moonshine.jl/Moonshine.jl/src/genealogy_common.jl:103
.
Plotting
Moonshine.plot_genealogy
— Functionplot_genealogy(genealogy[, ω]; kwargs...)
Plot a genealogy.
Only edges and vertices ancestral for ω
are plotted.
Implemented as an extension to Moonshine.jl
. To use this method, you have to import GraphMakie
(and a Makie backend).
See also plot_layout
.
Arguments
wild_color
(:blue
): color of wild vertices, that is those having only wild markers inω
.derived_color
(:red
): color of derived (non-wild) verticesarrow_show
(false
): whether or not to draw arrowsedge_color
(:gray
): color of edgesedge_width
(3
): width of edgeslayout
(plot_layout(genealogy)
): layout functionattributes...
: attributes passed directly toGraphMakie.graphplot
Moonshine.plot_latitudes
— Functionplot_latitudes(genealogy; kwargs...)
Unicode histogram of a genealogy's latitudes. Additional keywords arguments are passed directly to UnicodePlots.histogram
.