requiprobable: Sample trees from an equiprobable labeled, semi-labeled or...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

An equiprobable distribution assumes that all tree topologies are equally likely. The degree of tip labeling affects the number of possible tree topologies. In labeled trees all the tips are different, in unlabeled trees all the tips are the same and in semi-labeled trees the tips fall into groups in which any individual tip may or may not be the same as any other.

Usage

1
requiprobable(n, labels, label.counts = rep(1, length(labels)))

Arguments

n

An integer. The number of trees to sample.

labels

A character vector. The different labels for the tips of the trees.

label.counts

An integer vector of length length(labels). The number of tips using each label.

Details

To sample from labeled trees, use the default for label.counts, where every value is 1. To sample from unlabeled trees use a labels of length 1 and set label.counts as a single integer equal to the number of tips in the tree. To sample semilabeled trees label.counts should be the number of tips of the tree for each tip label from labels.

Value

If n=1, a tree of class “phylo”. Otherwise, multiple trees in a list of class “multiPhylo”.

Author(s)

Nathaniel Malachi Hallinan

References

For labeled trees:

G. Furnas, The generation of random, binary unordered trees, J. Classif. 1 (1984) 187-233.

For unlabeled trees:

L. Cavalli-Sforza, A. Edwards, Phylogenetic analysis: Models and esti- mation procedures, Am. J. Hum. Genet. 19 (1967) 233-257.

For semi-labeled trees:

N. Hallinan. Null models for gene family trees, Math. Biosci. (In review).

See Also

plot.phylo, recon.score

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
##We are going to sample 10 labeled 10 unlabeled and 10 semi labeled 10 tip trees
labeled<-requiprobable(10,c("A1","A2","B1","B2","B3","C1","C2","C3","C4","C5"))
plot(labeled)

unlabeled<-requiprobable(10,"?",10)
plot(unlabeled)
##If you want to add tip labels to these trees
for (i in 1:10) unlabeled[[i]]$tip.label<-sample(c("A1","A2","B1","B2","B3","C1","C2","C3","C4","C5"))

semilabeled<-requiprobable(10,c("A","B","C"),c(2,3,5))
plot(semilabeled)

HyPhy documentation built on May 2, 2019, 3:34 p.m.