sptree.njst: calculate the sptree.njst tree

sptree.njstR Documentation

calculate the sptree.njst tree

Description

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

Usage

sptree.njst(genetrees, spname, taxaname, species.structure)

Arguments

genetrees

a set of unrooted gene trees

spname

names of species

taxaname

names of taxa

species.structure

the taxaname-spname table

Author(s)

Liang Liu

Examples

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 sptree.njst tree
sptree.njst(genetree,spname, spname, species.structure)

lliu1871/phybase documentation built on April 21, 2024, 3:16 a.m.