Description Usage Arguments Value Author(s) Examples
This function can get gene coalescence times in the species tree.
1 | getcoaltime(genetree, sptree, ntax, nspecies, species.structure)
|
genetree |
a genetree matrix |
sptree |
a species tree matrix |
ntax |
number of taxa in the gene tree |
nspecies |
number of species in the species tree |
species.structure |
sequence-species relationship |
The function returns a two-column matrix, the first column is the ancestral node in the species tree, the second column is the gene coalescence time at the corresponding ancestral node in the species tree.
Liang Liu
1 2 3 4 5 6 7 8 9 10 11 12 13 | genetree<-"(((A:1,B:1):3,C:4):2,D:6);"
sptree<-"(((A:0.5,B:0.5):1,C:1.5):1,D:2.5);"
name<-c("A","B","C","D")
genetree<-read.tree.nodes(genetree,name)$nodes
sptree<-read.tree.nodes(sptree,name)$nodes
ntax<-length(name)
nspecies<-length(name)
species.structure<-matrix(0,nrow=nspecies,ncol=ntax)
diag(species.structure)<-1
getcoaltime(genetree,sptree,ntax,nspecies,species.structure)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.