getcoaltime {phybase} | R Documentation |
This function can get gene coalescence times in the species tree.
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 |
~~ If necessary, more details than the description above ~~
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
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)