sim.coaltree.sp {phybase} | R Documentation |
The function simulates a gene tree from the species tree using Rannala and Yang's formula
sim.coaltree.sp(rootnode, nodematrix, nspecies, seq, name)
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 |
gt |
the gene tree generated from the species tree |
height |
the tree height of the gene tree |
Liang Liu lliu@oeb.harvard.edu
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.
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