# four_leaves_graphs: Four leaves graphs. In mailund/admixture_graph: Admixture Graph Manipulation and Fitting

## Description

Kind of obsolete since the introduction of `all_graphs`. A comprehensive listing of all the 37 admixture graphs with four leaves and at most two admixture events. Our convention is that the position of the root does not matter (as long as it's not after an admixture event) and that graphs that have eyes, two inner nodes with the property that all the paths between any two leaves visits both or neither of them, are excluded. The reason is that the f statistics can't detect the exact position of the root or distinguish between an eye and a simple branch. The position of the root can be moved later with the function `make_an_outgroup`.

## Usage

 `1` ```four_leaves_graphs ```

## Format

A list of functions on four leaves and a parameter `permutations` which is `FALSE` by default. The outputs of these functions are either single `agraph` objects with the input vector as leaves, or if `permutations` is `TRUE`, lists of all the possible `agraph` objects with that leaf set up to symmetry.

`all_graphs`

`make_permutations`

`fit_permutations_and_graphs`

`fit_graph_list`

`add_a_leaf`

`add_an_admixture`

`add_an_admixture2`

`make_an_outgroup`

Other graphs: `eight_leaves_trees`, `five_leaves_graphs`, `seven_leaves_graphs`, `six_leaves_graphs`

## Examples

 ```1 2 3 4 5 6 7 8``` ```# While the usage of this function is pretty self-explanatory, let's plot all the graphs # just for browsing. for (i in seq(1, length(four_leaves_graphs))) { graph <- four_leaves_graphs[[i]](c("A", "B", "C", "D")) # This is how you include quotation marks in strings by the way: title <- paste("four_leaves_graphs[[", i, "]](c(\"A\", \"B\", \"C\", \"D\"))", sep = "") plot(graph, color = "tomato3", title = title) } ```

mailund/admixture_graph documentation built on April 3, 2018, 9:28 p.m.