getcoaltime: Get coalescence times

Description Usage Arguments Value Author(s) Examples

Description

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

Usage

1
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

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

 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)

bomeara/phybase documentation built on May 12, 2019, 11:35 p.m.