sim.coaltree.sp: simulate a gene tree from the species tree

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

Description

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

Usage

1
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. the order of the names must be consistent with that in "nodematrix"

Value

gt

the gene tree generated from the species tree

height

the tree height of the gene tree

Author(s)

Liang Liu lliu@uga.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

1
2
3
4
5
6
7
8
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;"
spname<-species.name(tree)
nodematrix<-read.tree.nodes(tree, spname)$nodes
rootnode<-7
##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

bomeara/phybase documentation built on May 12, 2019, 11:35 p.m.