loglikeSP: loglikelihood of the species tree, i.e., Rannala and Yang...

Description Usage Arguments Value Author(s) References Examples

Description

This function calculates the loglikelihood of a species tree from a set of gene trees using the Rannala and Yang formula

Usage

1
loglikeSP(gtree, sptree, taxaname,spname,species.structure,strict=T)

Arguments

gtree

a collection of gene trees

sptree

a species tree in newick format

taxaname

the names of taxa

spname

the names of species

species.structure

define which sequence belong to which species

strict

whether or not to check the result

Value

The function returns the log likelihood score.

Author(s)

Liang Liu

References

Rannala, B. and Z. Yang. 2003. Bayes estimation of species divergence times and ancestral population sizes using DNA sequences from multiple loci. Genetics 164: 1645-1656.

Examples

1
2
3
4
5
6
7
8
9
gtree<-"(((A:1,B:1):3,C:4):2,D:6);"
stree<-"(((A:0.5,B:0.5):1#0.1,C:1.5):1#0.1,D:2.5)#0.1;"
taxaname<-c("A","B","C","D")
spname<-taxaname
ntax<-length(taxaname)
nspecies<-length(spname)
species.structure<-matrix(0,nrow=nspecies,ncol=ntax)
diag(species.structure)<-1
loglikeSP(gtree,stree,taxaname,spname,species.structure)

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