 Research article
 Open Access
 Published:
MCNet: a method for the construction of phylogenetic networks based on the MonteCarlo method
BMC Evolutionary Biology volumeÂ 10, ArticleÂ number:Â 254 (2010)
Abstract
Background
A phylogenetic network is a generalization of phylogenetic trees that allows the representation of conflicting signals or alternative evolutionary histories in a single diagram. There are several methods for constructing these networks. Some of these methods are based on distances among taxa. In practice, the methods which are based on distance perform faster in comparison with other methods. The NeighborNet (NNet) is a distancebased method. The NNet produces a circular ordering from a distance matrix, then constructs a collection of weighted splits using circular ordering. The SplitsTree which is a program using these weighted splits makes a phylogenetic network. In general, finding an optimal circular ordering is an NPhard problem. The NNet is a heuristic algorithm to find the optimal circular ordering which is based on neighborjoining algorithm.
Results
In this paper, we present a heuristic algorithm to find an optimal circular ordering based on the MonteCarlo method, called MCNet algorithm. In order to show that MCNet performs better than NNet, we apply both algorithms on different data sets. Then we draw phylogenetic networks corresponding to outputs of these algorithms using SplitsTree and compare the results.
Conclusions
We find that the circular ordering produced by the MCNet is closer to optimal circular ordering than the NNet. Furthermore, the networks corresponding to outputs of MCNet made by SplitsTree are simpler than NNet.
Background
Phylogenetics is concerned with the construction and analysis of phylogenetic trees or networks to understand the evolution of species, populations, and individuals. Evolutionary processes such as hybridization between species, lateral transfer of genes, recombination within a population, and convergent evolution can all lead to evolutionary histories that are distinctly nontreelike. Moreover, even when the underlying evolution is treelike, the presence of conflicting or ambiguous signals can make a single tree representation inappropriate. In these situations, phylogenetic network methods can be particularly useful.
Phylogenetic network is a generalization of phylogenetic trees that can represent several trees simultaneously. For any network construction method, the conflicting signals should be represented in the network but it is vital that the network does not depict more conflict than is found in the data. At the same time, when the data fits well to a tree, the method should return a network that is close to a tree. Recently, in addition to biology, the phylogenetic networks methods are widely used for classifying different types of data such as those finding in linguistics, music, etc. There are many different methods to construct phylogenetic trees or networks which are based on distance matrix such as ME (minimum evolution) [1], LS (least squares) [2, 3], NJ (neighborjoining) [4], AddTree [5], NNet (neighbornet) [6] and QNet [7]. All these methods are called distancebased methods.
ME is one of the most wellknown methods. It was first introduced by Kidd and SgamarellaZonta [1]. Given a distance matrix, the ME principle consists of selecting the tree whose length (sum of its branch lengths) is minimal among all tree topologies for taxa. Comparative studies of treebuilding methods show that ME generally is an accurate criterion for selecting a true tree. Nei and Rzhetsky have shown that ME principle is statistically consistent when branch lengths are assigned by ordinary leastsquares (OLS) fitting [8]. In the OLS framework, we simply minimize
where Î´_{ ij } is an estimation of input d_{ ij } and X is the set of taxa. In fact, the main goal is to find a tree whose induced metric is closer to d_{ ij } . The LS was first introduced in [2] and [3].
Nearly 20 years have passed by since the landmark paper in Molecular Biology and Evolution introducing NJ [4]. The method has become the most widely used method for building phylogenetic trees from distances. Steel and Gascuel showed that NJ is a greedy algorithm for ME principle [9]. The NNet is a hybrid of NJ and split decomposition [10]. It is applicable to data sets containing hundreds of taxa. The NNet is an algorithm for constructing phylogenetic networks.
Split decomposition, implemented in SplitsTree [11], decomposes the distance matrix into simple components based on weighted splits. These splits are then represented using a special type of phylogenetic network called split network. The NNet works in a similar way: it first produces a circular ordering from distance matrix and then constructs a collection of weighted splits. Dan Levy and Lior Patcher showed that the NNet is a greedy algorithm for the traveling salesman problem that minimizes the balanced length of the split system at every step and it is optimal for circular distance matrices [12]. Balanced minimum evolution (BME) is designed under the ME principle [13]. The BME is a special version of the ME principle where tree length is estimated by the weighted least squares [13].
In this work, we introduce MCNet algorithm (MonteCarlo Network algorithm) which works in a similar way: First, it finds a circular ordering for taxa, based on MonteCarlo with simulated annealing, it then extracts splits from the circular ordering and uses nonnegative least squares for weighting splits. We compare the results of the NNet and the MCNet for several data sets.
Preliminaries
A split of a given set X of taxa is a bipartition of the set X into two nonempty subsets of X. A split is called trivial if one of the two subsets contains only one taxon. Let T be a nonempty tree. Let the leaves of the T are labeled by the set of taxa, X ={x_{1},...,x_{ n } }. Every edge e of T defines a split S = AB, where A and B are two sets of taxa contained in the two components of T  e. For example, Figure 1 shows an eightleaf tree. Removing the edge e from the tree produces two sets of leaves
In an edgeweighted tree, the weight of each edge is assigned to its corresponding split. The Phyletic distance between any two taxa x and y in an edgeweighted tree is the sum of the weights of the edges along the path from x to y. Hence, the phyletic distance between x and y equals the sum of split weights for all those splits in which x and y belong to separate components.
Two different splits S_{1} = A_{1}B_{1}, and S_{2} = A_{2}B_{2}, are compatible, if one of the following conditions holds:
A collection of splits is called compatible, if all possible pairing of splits are compatible. A compatible collection of splits is represented by a phylogenetic tree [14, 15]. Dress and Huson introduced SplitsTree to display more complex evolutionary patterns [16]. For a set of incompatible splits, SplitsTree outputs the split network using bands of parallel edges.
Circular collection of splits is a mathematical generalization of compatible collections of splits. Formally, a collection of splits of X is circular if there exists an ordering x_{1},â‹¯,x_{ n } of X such that every split is of the form {x_{ i }, x_{i+1},â‹¯,x_{ j } }X  {x_{ i },â‹¯,x_{ j } } for some i and j, 1 â‰¤ i â‰¤ j â‰¤ n. A Compatible collection of splits are always circular [10]. On the other hand, the class of circular collection of splits contains the class of the collection of splits corresponding to a tree. Andreas Dress and Daniel Huson proved that circular collections of splits always have a planar splits graph representation [16]. A distance matrix is circular (also called Kalmanson) if it is the phyletic distances for a circular collection of splits with positive weights. Because compatible splits are circular, treelike distances are circular too [6].
As mentioned above, the ME principle consists of selecting a tree whose length is minimal. In fact, the ME principle is equivalent to finding a circular ordering Ïƒ = {x_{Ïƒ(1)},...,x_{Ïƒ(n)}} in order to find the minimum of the function Î·
Where Î£ is the set of all circular orderings of taxa x_{1},...,x_{ n } . We call function Î· the energy function, and any circular ordering that minimizes Î· is called the optimal circular ordering.
Methods
There are a number of different methods for constructing various kinds of phylogenetic networks. A phylogenetic network can be constructed from a collection of weighted splits. NNet uses circular ordering to construct a collection of weighted splits. Since finding an optimal circular ordering is an NPhard problem, so we introduce a heuristic algorithm based on the MonteCarlo method to find optimal circular ordering. The MCNet seeks to find an optimal circular ordering from the distance matrix and then extracts a collection of weighted splits based on that ordering.
Algorithms
In this section, a new algorithm called the MCNet, is presented to construct a set of weighted splits for taxa set X = {x_{1},...,x_{ n } }with a given distance matrix. The MCNet consists of two steps. In the first step, we find a circular ordering. In the second step, the splits which are obtained from the circular ordering are weighted. The core of the first step contains two procedures, namely, INITIAL and the MonteCarlo. The INITIAL is a greedy algorithm to obtain a circular ordering, namely, the initial circular ordering. The INITIAL works in the following way:
Suppose x_{Ïƒ(1)},...,x_{Ïƒ(k) }are ordered and let \stackrel{\xc2\xaf}{x} be an element of S = X  {x_{Ïƒ(1)},...,x_{Ïƒ(k)}} such that
If r = x_{Ïƒ(1)}, we consider the new ordering \stackrel{\xc2\xaf}{x},{x}_{\mathrm{\xcf\u0192}(1),\xe2\u20ac\xa6,}{x}_{\mathrm{\xcf\u0192}(k)}. Otherwise the ordering {x}_{\mathrm{\xcf\u0192}(1),\xe2\u20ac\xa6,}{x}_{\mathrm{\xcf\u0192}(k)},\stackrel{\xc2\xaf}{x} is considered. This process stops when all taxa are ordered.
The second procedure, or the MonteCarlo procedure, relies on random iteration to find the optimal circular ordering. The MonteCarlo algorithm starts its movement from the initial circular ordering, Ïƒ_{ 0 } For each circular ordering Ïƒ, we define the neighborhood of Ïƒ, N (Ïƒ), by:
where Î£ is the set of all circular orderings.
We choose Ïƒ_{1} âˆˆ N (Ïƒ_{ 0 } ) randomly. if Î· (Ïƒ_{1}) â‰¤ Î· (Ïƒ_{ 0 } ), then the system moves into ordering Ïƒ_{1}. However we allow nongreedy movements for the system in order to avoid having the system trapped in local minima. In other words, if Î· (Ïƒ_{1}) > Î· (Ïƒ_{ 0 } ), then the system moves into ordering Ïƒ_{1} with a small probability e\frac{\xe2\u02c6\u2019\mathrm{\xce\xb7}({\mathrm{\xcf\u0192}}_{1})+\mathrm{\xce\xb7}({\mathrm{\xcf\u0192}}_{0})}{T}, where T is a constant temperature. For each temperature, these movements are carried out t times. To compute the minimum energy we allow this process to continue until the temperature drops to zero (see the appendix for more details). Pseudo code of the MonteCarlo algorithm is shown in Table 1. It is notticeable that the second procedure can start from any circular ordering other than the one obtained by the INITIAL procedure.
In the final step, we use the least squares algorithm to weight the splits of obtained circular ordering. Let A be the matrix with rows indexed by pairs of taxa and columns indexed by splits. Then for each pair of texa i and j and for each split k, A_{ ij,k } is defined by:
The matrix A = [A_{ ij,k } ] is full rank [17].
Let d = (d_{12}, d_{13},...,d_{(n1)n}) be an n(n  1)/2 dimensional vector corresponding to rows of A where d_{ ij } is obtained by distance matrix. Let b be the weight vector of splits, then the phyletic distance vector is p = Ab.
Now, the ordinary least squares(OLS) is used to estimate b by the following standard formula
If we discard splits with negative weights and leave the remaining splits unchanged, the weight of the remaining splits are often grossly overestimated. Similar to the NNet algorithm, we compute the optimal least square estimates with a nonnegative constraint. In this paper, we use the FNNLS algorithm [18].
Results and Discussion
In this section, we compare the results of the MCNet and the NNet on some data sets. We use SplitsTree4 program [19] for drawing phylogenetic networks. Due to the limitation of space, we insert only six figures in this article.
Data sets
One of the data sets, a collection of 110 Salmonella MLST Data, was obtained from authors of the NNet. The other data sets presented as the examples in SplitsTree4 program (version 4.10): Its(46 taxa), Jsa (46 taxa), Mammals (30 taxa), Primates (12 taxa), Rubber (23 taxa), Dolphins (36 taxa) and Myosin (143 taxa).
Optimal threshold for cooling coefficient and T_{ low }
There are two parameters, T_{ low } and cooling coefficient, in the MonteCarlo procedure. We first adjust T_{ low } between 10^{5} and 0.2 to obtain the best cooling coefficient. The value of energy function and running time of algorithm for each T_{ low } for JSA data are given in Figure 2 (for the other data sets, the figures are the same as JSA). According to Figure 2, when cooling coefficient is 0.95, running time of the algorithm compared to other coefficients increases considerably. On the other hand, the value of energy function for 0.95 or 0.9 as a cooling coefficient is significantly better than the other cooling coefficients. Hence, we conclude that the best value of energy function with respect to running time of the algorithm is achieved when cooling coefficient is 0.9 and T_{ low }< 10^{3}.
Results
The initial test for performance of our method is done by calculating the value of energy function for circular orderings obtained by the MCNet and the NNet (Table 2). The first two rows of Table 2 show that in all data sets except Salmonella, the value of energy function for the MCNet is less than those obtained from the NNet. The interesting feature of the MCNet algorithm is in finding different circular orderings by changing initial ordering. So, the MCNet algorithm could take the circular ordering obtained by the NNet as initial ordering. The third row of Table 2 shows the values of energy function for circular orderings achieved by the MCNet with the circular ordering obtained by the NNet as an initial ordering. For four data sets, Its, Rubber, Salmonella, Myosin, the third row indicates better results than the first row. But for the other data sets, the conclusions mentioned above are the vice versa.
Another test for the performance of our method is comparing the number of splits obtained by both the algorithms. In Table 3, the number of splits of circular orderings obtained by the MCNet and the NNet on different data sets are shown. In all data sets the number of splits obtained by the MCNet is less than the NNet except Primates. In this case, these two numbers are equal.
Let d be the input distance vector and P and P' are the phyletic distance vector of weighted splits obtained by the MCNet and the NNet, respectively. In Table 4, the value of norm of P  d and P'  d for each data set are shown. The norm of P  d is less than P'  d in all data sets even in Primates. It means that the results of the MCNet algorithm give better approximation for input distance vector.
To illustrate difference between two algorithms, we present some examples of networks obtained by both the MCNet and the NNet using SplitsTree4 (Figures 3,4,5,6, 7 and 8). It is obvious that both algorithms give the same classification of taxa and exhibit the same major splits. For example, in Figures 5 and 6, we highlight some edges such that by removing the samecolored edges, the same clustering of taxa is obtained. But according to what we see in Tables 3 and 4, split networks obtained by the MCNet are less complicated than split networks obtained by the NNet. It means that the networks obtained by the MCNet have less noise than the networks obtained by the NNet. According to Corollary 1 (see Appendix), when t approaches to 1, the MCNet finds optimal circular ordering with the probability 1. We examined our algorithm on several treelike distance matrices and it returned corresponding trees quickly. The MCNet has been implemented in Matlab and is available for download at http://bioinf.cs.ipm.ac.ir/softwares/mc.net.
Conclusions
In this work, we propose an algorithm, MCNet, which is a distance based method for constructing phylogenetic networks. The MCNet scales well and can quickly produce detailed and informative networks for large number of taxa. We compare the performance of the MCNet with the NNet on eight different data sets. We have shown (Tables 2, 3 and 4) that the MCNet performs better than the NNet for almost test cases and the networks obtained by the MCNet are simpler than the NNet with the same major splits. The NNet is a part of SplitsTree program. So, the results of the MCNet could be used in SplitsTree program too.
Appendix
Let S = {E_{1},...,E_{ s } } be a finite set of states, and consider a physical process having these discrete states at time t. A Markov chain is a stochastic model of this system, such that the state of system at time t + 1 depends only on the state of system at time t.
Consider X_{0}, X_{1},..., be a collection of Markov random variables, such that X_{ n } is the state of the system at time n. Let p_{ ij } be the probability that the system enters into the state E_{ j } from the state E_{ i } , where i, j âˆˆ {1,...,s} The matrix P = (p_{ ij })_{1â‰¤i, jâ‰¤s}is called transition matrix. A probability distribution q = (q_{1},...,q_{ s } ) such that q_{ i } is the probability that system starts its movement from the state E_{ i } , is called initial probability distribution. A Markov chain is a stochastic model X_{0}, X_{1},..., such that X_{ t } is the state of the system at time t. For each i and j in {1,2,...,s};
The Markov chain is irreducible, if for all i, j âˆˆ {1,...,s} there exists n > 0 such that {p}_{ij}^{(n)}>0, where
In other words, the Markov chain is irreducible, if there exist n such that the probability that the system enters into the state E_{ j } from the state E_{ i } after n times is positive. The irreducible Markov chain is called aperiodic, if for some n â‰¥ 0 and some state E_{ j } ,
Theorem 1(Convergence to stationary Markov chain, [20])
If the Markov chain is irreducible and aperiodic then
such that Ï€ = (Ï€_{1},...,Ï€_{ s } ) is a unique probability distribution and {\mathrm{\xcf\u20ac}}_{j}={\displaystyle \underset{i=1}{\overset{s}{\xe2\u02c6\u2018}}{\mathrm{\xcf\u20ac}}_{i}{p}_{ij}}.
The probability distribution is Ï€ is called stationary probability of the Markov chain.
It means that if P is the transition matrix and P^{(t) }is the t^{th} power of P, when t â†’ âˆž the j^{th} column of transition matrix is approximately equal to Ï€_{ j } . In the MonteCarlo algorithm, a special kind of Markov chain is used. Let Î£ be the finite set of states and q=\left(\frac{1}{\xce\pounds },\xe2\u20ac\xa6,\frac{1}{\xce\pounds }\right) is the initial probability distribution. For each state i the neighborhood of i, N(i), is defined as the set of all the states that are reachable from i by one movement. In this system the set of neighborhoods have to satisfy the following properties:

1.
i, âˆ‰ N(i).

2.
i âˆˆ N(j) â‡” j âˆˆ N(i)

3.
if i â‰ j, then there exit i _{1},i _{2},...,i _{1} âˆˆ Î£ such that
i\xe2\u02c6\u02c6N\left({i}_{1}\right),{i}_{1}\xe2\u02c6\u02c6N\left({i}_{2}\right),\xe2\u20ac\xa6,{i}_{l}\xe2\u02c6\u02c6N\left(j\right).
The matrix {P}^{T}={\left({p}_{ij}^{T}\right)}_{i,j\xe2\u02c6\u02c6\xce\pounds} is defined as the transition matrix by
where T is a positive constant number (constant temperature). The third property of the neighborhood shows that this Markov chain is irreducible. Also, if {P}_{ii}^{T}>0 and P^{T} contains nonnegative entries then {({P}^{T})}_{ii}^{(t)}>0 for all t â‰¥ 0. So, it is a finite, aperiodic and irreducible Markov chain. The theorem 1 shows that for each constant temperature T and i âˆˆ Î£, there exists a stationary probability distribution {\mathrm{\xcf\u20ac}}_{i}^{T} such that:
Where {\mathrm{\xcf\u20ac}}_{i}^{T}=\frac{{e}^{\xe2\u02c6\u2019\frac{\mathrm{\xce\xb7}(i)}{T}}}{{\displaystyle \underset{j\xe2\u02c6\u02c6\xe2\u02c6\u2018}{\xe2\u02c6\u2018}{e}^{\xe2\u02c6\u2019\frac{\mathrm{\xce\xb7}(j)}{T}}}} (see page 45 in [20]).
Proposition 1. Let {({\mathrm{\xcf\u20ac}}_{i}^{T})}_{i\xe2\u02c6\u02c6\xce\pounds} be a probability distribution such that:
and suppose that m_{0} = min{Î·(i)  i âˆˆ Î£} and, Î·_{ 0 } = {i âˆˆ Î£  Î·(i) = m_{0}} then for each i\xe2\u02c6\u02c6\xce\pounds ,\underset{T\xe2\u2020\u2019{0}^{+}}{\mathrm{lim}}{\mathrm{\xcf\u20ac}}_{i}^{T}={\mathrm{\xcf\u20ac}}_{i}^{0}, where
Proof: The proof is presented in [20] (claim 2.8 and claim 2.9).
Corollary 1. Let Î£ be the finite set of states, then for each i âˆˆ Î£ we have
The corollary 1 illustrates that by cooling temperature (T â†’ 0^{+}), system enters into one of the states of Î·_{0} with the probability 1 after t (t â†’ âˆž) time. In this article, we define the set of all circular orderings of taxa as the finite set of states. Our definition of neighborhood in the MCNet satisfies in three properties of neighborhood and every elements of Î·_{0} is an optimal circular ordering. Therefore, the MCNet yields a circular ordering with approximately minimal energy function.
References
Kidd KK, SgamarellaZonta LA: Phylogenetic analysis: concepts and methods. Am J Human Genetics. 1971, 23: 235252.
CavalliSforza LL, Edwards AWF: Phylogenetic analysis: models and estimating procedures. Am J Hum Genet. 1967, 19: 233257. (1967)
Fitch WM, Margoliash E: Construction of phylogenetic trees. Science. 1967, 155: 279284. 10.1126/science.155.3760.279.
Saitou N, Nei N: The neighbor joining method: a new method for reconstructing phylogenetic trees. Molecular Biology and Evolution. 1987, 4: 406425.
Sattath S, Tversky A: Phylogenetic similarity trees. Psychometrika. 1977, 42: 319345. 10.1007/BF02293654.
Bryant D, Moulton V: NeighborNet: An agglomerative method for the construction of planar phylogenetic networks. Molecular Biology And Evolution. 2004, 21: 255265. 10.1093/molbev/msh018.
Grunewald S, Forslund K, Dress A, Moulton V: QNet: An agglomerative method for the construction of phylogenetic networks from weighted quartets. Molecular Biology and Evolution. 2007, 24: 532538. 10.1093/molbev/msl180.
Rzhetsky A, Nei M: Theoretical foundation of the minimumevolution method of phylogenetic inference. Mol Biol Evol. 1993, 10: 10731095.
Gascuel O, Steel M: Neighborjoining revealed. Molecular Biology and Evolution. 2006, 23: 19972000. 10.1093/molbev/msl072.
Bandelt HJ, Dress AWM: Split decomposition: A new and useful approach to phylogenetic analysis of distance data. Mol Phyl Evol. 1992, 1: 242252. 10.1016/10557903(92)900218.
Huson DH: SplitsTree: A program for analyzing and visualizing evolutionary data. Bioinformatics. 1998, 14 (10): 6873. 10.1093/bioinformatics/14.1.68.
Levy D, Patcher L: The NeighborNet Algorithm. Advances in Applied Mathematics.
Desper R, Gascuel O: The MinimumEvolution Distance Based Approach to Phylogenetic Inference. Math Evolution and Phylogeny. Edited by: Gascuel O. 2005, Oxford Univ. Press
Semple C, Steel M: Cyclic permutations and evolutionary trees. Adv Appl Math. 2004, 32 (4): 669680. 10.1016/S01968858(03)000988.
Semple C, Steel M: Phylogenetics. 2003, Oxford, UK: Oxford University Press
Dress A, Huson DH: Constructing splits graphs. IEEE/ACM Transactions in Computational Biology and Bioinformatics. 2004, 1: 109115. 10.1109/TCBB.2004.27.
Bandelt HJ, Dress A: A canonical decomposition theory for metrics on a finite set. Adv Math. 1992, 92: 47105. 10.1016/00018708(92)90061O.
Bro R, Jong SD: A Fast Nonnegativityconstrained Least Squares Algorithm. Journal of Chemometrics. 1997, 11 (5): 393401. 10.1002/(SICI)1099128X(199709/10)11:5<393::AIDCEM483>3.0.CO;2L.
Huson D, Bryant D: Application of phylogenetic networks in evolutionary studies. Molecular Biology and Evolution. 2005, 23: 254267. 10.1093/molbev/msj030.
Clote P, Backofen R: Computational molecular biology. 2000, New York, WILEY
Acknowledgements
We are grateful to the faculty of mathematics of Shahid Beheshti University. This work is supported in part by IPM(cs138502). The authors would like to thank Prof. Hamid Pezeshk for many useful comments.
Author information
Authors and Affiliations
Corresponding author
Additional information
Authors' contributions
CE, RH and EM performed initial studies. MH designed the algorithm. RH and EM analysis the data sets. All authors participated in the writing of the manuscript. All authors read and approved the final manuscript.
Authorsâ€™ original submitted files for images
Below are the links to the authorsâ€™ original submitted files for images.
Rights and permissions
This article is published under license to BioMed Central Ltd. This is an Open Access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/2.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
About this article
Cite this article
Eslahchi, C., Habibi, M., Hassanzadeh, R. et al. MCNet: a method for the construction of phylogenetic networks based on the MonteCarlo method. BMC Evol Biol 10, 254 (2010). https://doi.org/10.1186/1471214810254
Received:
Accepted:
Published:
DOI: https://doi.org/10.1186/1471214810254
Keywords
 Markov Chain
 Ordinary Little Square
 Energy Function
 Distance Matrix
 Phylogenetic Network