nj: Neighbor-Joining Tree Estimation

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/nj.R

Description

This function performs the neighbor-joining tree estimation of Saitou and Nei (1987).

Usage

1
nj(X)

Arguments

X

a distance matrix; may be an object of class “dist”.

Value

an object of class "phylo".

Author(s)

Emmanuel Paradis

References

Saitou, N. and Nei, M. (1987) The neighbor-joining method: a new method for reconstructing phylogenetic trees. Molecular Biology and Evolution, 4, 406–425.

Studier, J. A. and Keppler, K. J. (1988) A note on the neighbor-joining algorithm of Saitou and Nei. Molecular Biology and Evolution, 5, 729–731.

See Also

write.tree, read.tree, dist.dna, bionj, fastme, njs

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
### From Saitou and Nei (1987, Table 1):
x <- c(7, 8, 11, 13, 16, 13, 17, 5, 8, 10, 13,
       10, 14, 5, 7, 10, 7, 11, 8, 11, 8, 12,
       5, 6, 10, 9, 13, 8)
M <- matrix(0, 8, 8)
M[lower.tri(M)] <- x
M <- t(M)
M[lower.tri(M)] <- x
dimnames(M) <- list(1:8, 1:8)
tr <- nj(M)
plot(tr, "u")
### a less theoretical example
data(woodmouse)
trw <- nj(dist.dna(woodmouse))
plot(trw)

Example output



ape documentation built on April 25, 2021, 9:06 a.m.