hadamard {phangorn} | R Documentation |
A collection of functions to perform Hadamard conjugation.
hadamard(x) fhm(v) h2st(obj, levels=c("r","y")) h4st(obj, levels = c("a","c","g","t")) write.nexus.splits(obj, file="")
x |
a vector of length 2^n, where n is an integer. |
v |
a vector of length 2^n, where n is an integer. |
obj |
a data.frame or character matrix, typical a sequence alignment. |
levels |
levels of the sequences. |
file |
a file name. |
h2st
and h4st
perform Hadamard conjugation
for 2-state (binary, RY-coded) or 4-state (DNA/RNA) data.
write.nexus.splits
writes splits returned from h2st
or
distanceHadamard
to a nexus file, which can be processed by
Spectronet or Splitstree.
hadamard
returns a Hadamard matrix. fhm
returns the
fast Hadamard multiplication.
Klaus Schliep K.P.Schliep@massey.ac.nz
Hendy, M.D. (1989). The relationship between simple evolutionary tree models and observable sequence data. Systematic Zoology, 38 310–321.
Hendy, M. D. and Penny, D. (1993). Spectral Analysis of Phylogenetic Data. Journal of Classification, 10, 5–24.
Hendy, M. D. (2005). Hadamard conjugation: an analytical tool for phylogenetics. In O. Gascuel, editor, Mathematics of evolution and phylogeny, Oxford University Press, Oxford
Waddell P. J. (1995). Statistical methods of phylogenetic analysis: Including hadamard conjugation, LogDet transforms, and maximum likelihood. PhD thesis.
H = hadamard(3) v = 1:8 H fhm(v) ## Not run: data(Laurasiatherian) dat = as.character(Laurasiatherian)[1:10,] # RY-coding dat[dat=="a"] = "r" dat[dat=="g"] = "r" dat[dat=="c"] = "y" dat[dat=="t"] = "y" fit = h2st(dat) write.nexus.splits(fit[fit$edges>1e-4, ][-1,], file = "test.nxs") # read this file into Spectronet or Splitstree to show the network unlink("test.nxs") ## End(Not run)