mst: Minimum Spanning Tree and Network

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

View source: R/haplotype.R

Description

Computes a minimum spanning tree using Kruskal's algorithm, the minimum spanning network using Bandelt et al.'s algorithm, or the randomized minimum spanning tree (Paradis 2017).

Usage

1
2
3
mst(d)
msn(d)
rmst(d, B = 100)

Arguments

d

a distance matrix, either as an object of class "dist", or a (square symmetric) matrix.

B

number of randomizations.

Value

an object of class "haploNet".

Note

ape has a function named mst which is older (and used by other packages) and returns its results in a different form. The present version is more efficient. If you want to use the older version after loading pegas, use ape::mst since ape will certainly always be loaded before pegas.

Author(s)

Emmanuel Paradis

References

Bandelt, H. J., Forster, P. and Rohl, A. (1999) Median-joining networks for inferring intraspecific phylogenies. Molecular Biology and Evolution, 16, 37–48.

Kruskal, J. B., Jr. (1956) On the shortest spanning subtree of a graph and the traveling salesman problem. Proceedings of the American Mathematical Society, 7, 48–50.

Paradis, E. (2018) Analysis of haplotype networks: the randomized minimum spanning tree method. Methods in Ecology and Evolution, 9, 000–000. DOI: 10.1111/2041-210X.12969.

See Also

haploNet, mjn

Examples

1
2
3
4
data(woodmouse)
d <- dist.dna(woodmouse, "n")
(r <- mst(d))
plot(r)

Example output

Loading required package: ape
Loading required package: adegenet
Loading required package: ade4

   /// adegenet 2.0.1 is loaded ////////////

   > overview: '?adegenet'
   > tutorials/doc/questions: 'adegenetWeb()' 
   > bug reports/feature requests: adegenetIssues()



Attaching package: 'pegas'

The following object is masked from 'package:ade4':

    amova

The following object is masked from 'package:ape':

    mst

Haplotype network with:
   15 haplotypes
   14 links
   0 alternative links
   link lengths between 2 and 14 steps

Use print.default() to display all elements.

pegas documentation built on July 13, 2018, 1:02 a.m.