sim.coaltree.sp | 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. the order of the names must be consistent with that in "nodematrix" |
gt |
the gene tree generated from the species tree |
height |
the tree height of the gene tree |
Liang Liu lliu@uga.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.
sim.coaltree
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.