View source: R/permute_all_treeshape_labellings.r
permute_all_treeshape_labellings | R Documentation |
Given a treeshape and set of labels, permutes all possible labelled phylogenetic trees.
permute_all_treeshape_labellings(treeshapes, labels)
treeshapes |
A vector of treeshape(s) in the same format as permute_treeshapes. |
labels |
A character vector of tip labels to use for labelling. |
A treeshape is an unlabelled phylogenetic tree and as such can be labelled to produce a phylogenetic tree. This function takes a treeshape and a set of labels and generates (permutes) all possible labellings, i.e., all phylogenetic trees which a treeshape represents.
Note that the star tree always allows only a single labelling, whereas any more resolved treeshape will have multiple labellings.
Here treeshapes are encoded in the same pseudo-Newick format as the permute_treeshapes function, e.g.:
(((3),1),(1,(2)));
(Where each pair of parentheses represents an internal node, each number the number of tips, each comma separates sets of tips, and the semicolon denotes the root clade.)
A list of the same length as treeshapes
composed of character vectors of labelled phylogenetic trees in the Newick format (Felsenstein 2004).
Graeme T. Lloyd graemetlloyd@gmail.com
Felsenstein, J., 2004. Inferring Phylogenies. Sinauer Associates, Inc., Sunderland.
# Label some six-tip treeshapes with the letters A-F:
permute_all_treeshape_labellings(
treeshapes = c(
"(6);",
"((3),(3));",
"(1,(1,(1,(1,(2)))));"
),
labels = LETTERS[1:6]
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.