getcoaltime {phybase}R Documentation

Get coalescence times

Description

This function can get gene coalescence times in the species tree.

Usage

getcoaltime(genetree, sptree, ntax, nspecies, species.structure)

Arguments

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

Details

~~ If necessary, more details than the description above ~~

Value

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.

Author(s)

Liang Liu

Examples

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)

[Package phybase version 1.1 Index]