sim.coaltree.sp {phybase}R Documentation

simulate a gene tree from the species tree

Description

The function simulates a gene tree from the species tree using Rannala and Yang's formula

Usage

sim.coaltree.sp(rootnode, nodematrix, nspecies, seq, name)

Arguments

rootnode the root node of the species tree
nodematrix the tree node matrix of the species tree
nspecies the number of species
seq a vector of number of sequences in each species
name species names used in the simulated gene tree

Value

gt the gene tree generated from the species tree
height the tree height of the gene tree

Author(s)

Liang Liu lliu@oeb.harvard.edu

References

Rannala, B. and Z. Yang. 2003. Bayes estimation of species divergence times and ancestral population sizes using DNA sequences from multiple loci. Genetics 164: 1645-1656.

See Also

sim.coaltree

Examples

tree<-"(((H:0.00402#0.01,C:0.00402#0.01):0.00304#0.01,G:0.00707#0.01):0.00929#0.01,O:0.01635#0.01)#0.01;"
nodematrix<-read.tree.nodes(tree)$nodes
rootnode<-7
spname<-species.name(tree)
##define the vector seq as [2,2,2,2] which means that there are 2 sequences in each species
seq<-rep(2,4)
str<-sim.coaltree.sp(rootnode,nodematrix,4,seq,name=spname)$gt


[Package phybase version 1.1 Index]