NJst: calculate the NJst tree

Description Usage Arguments Author(s) Examples

Description

This function can estimate species trees from a set of unrooted gene trees

Usage

1
NJst(genetrees, taxaname, spname, species.structure)

Arguments

genetrees

a set of unrooted gene trees

taxaname

names of taxa

spname

names of species

species.structure

the taxaname-spname table

Author(s)

Liang Liu

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
sptree<-"(A:0.4,(B:0.3,(C:0.2,(D:0.1,E:0.1):0.1):0.1):0.1);"

spname<-species.name(sptree)
nspecies<-length(spname)
rootnode<-9
nodematrix<-read.tree.nodes(sptree,spname)$node
seq<-rep(1,nspecies)
species.structure<-matrix(0,nspecies,nspecies)
diag(species.structure)<-1

##population size, theta
nodematrix[,5]<-0.1
ngene<-5
genetree<-rep("",ngene)

##generate gene trees
for(i in 1:ngene)
{
	genetree[i]<-sim.coaltree.sp(rootnode,nodematrix,nspecies,seq,spname)$gt
}
	
##construct the NJst tree
NJst(genetree,spname, spname, species.structure)

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