satisfies_eventorder | R Documentation |
This function returns TRUE
if and only if the admixture graph is compatible with
all event orders listed in eventorder
satisfies_eventorder(graph, eventorder, strict = TRUE)
graph |
An admixture graph |
eventorder |
A data frame with columns |
strict |
What to do in case some events are not determined by the graph.
If |
Each row in eventorder
represents a constraint that earlier1
and earlier2
split earlier than later1
and later2
. If later2
is NA
, later2
will be set to the parent node of later1
. By default (type = 1
), a constraint will be satisfied as long as there is any lineage in which a split between earlier1
and earlier2
is ancestral to a split between later1
and later2
. type = 2
is stricter and requires that the earlier1
, earlier2
split is ancestral to the later1
, later2
split in all lineages. In graphs with multiple admixture events there can be multiple splits between earlier1
, earlier2
and later1
, later2
, and many ways in which these splits can relate to each other. The current implementation only covers some of the many possible topological relationships.
TRUE
if all constraints are satisfied, else FALSE
## Not run:
# Test whether the split between A and B is earlier than the split between C and D,
# and whether the split between C and D is earlier than the terminal branch leading to E
constrain_events = tribble(
~earlier1, ~earlier2, ~later1, ~later2,
'A', 'B', 'C', 'D',
'C', 'D', 'E', NA)
satisfies_eventorder(random_admixturegraph(5, 0), eventorder = constrain_events)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.