# Description

Infers a species network(s) with a specified number of reticulation nodes using maximum pseudo-likelihood. The returned species network(s) will have inferred branch lengths and inheritance probabilities. During the search, branch lengths and inheritance probabilities of a proposed species network can be either sampled or optimized. For the first case, after the search, branch lengths and inheritance probabilities of all top species networks are optimized before being returned. In order to address the identifiability issue caused by the fact that networks are not necessarily encoded by their triplet system, users can ask the program to further optimize those parameters of the inferred network under full likelihood. We use Richard Brent's algorithm (from his book "Algorithms for Minimization without Derivatives", p. 79) to optimize the branch lengths and inheritance probabilities to obtain the maximum (pseudo-) likelihood for that species network. The species network and gene trees must be specified in the Rich Newick Format.

The inference uses only topologies of gene trees. The input gene trees can be non-binary and can contain missing taxa. The input gene trees can be gene tree distributions inferred from Bayesian methods like MrBayes. See the second example below.

# Usage

| Comma delimited list of gene tree identifiers or comma delimited list of sets of gene tree identifiers. See details. | mandatory |

| Maximum number of reticulations to added. | mandatory |

-b | Gene trees bootstrap threshold. Edges in the gene trees that have support lower than | optional |

-a | Gene tree / species tree taxa association. | optional |

-s | Specify the network to start search. Default value is the optimal MDC tree. | optional |

-fs | Fix the start tree for search. If specified and give a start tree (-s), the search will fix the topology of the start tree. | optional |

-n | Number of optimal networks to return. Default value is 5. | optional |

-h {s1 [, s2...]} | A set of specified hybrid species. | optional |

-w (w1, ..., w7) | The weights of operations for network arrangement during the network search. Default value is (0.1,0.1,0.15,0.55,0.15,0.15,2.8). | optional |

-x | The number of runs of the search. Default value is 10. | optional |

-m | Maximum number of network topologies to examined. Default value is infinity. | optional |

-md moveDiameter | Maximum diameter to make an arrangement during network search. Default value is infinity. | optional |

-rd | Maximum diameter for a reticulation event (the distance between two parents of a reticulation node). Default value is infinity. | optional |

-f maxFailure | Maximum consecutive number of failures for hill climbing. Default value is 100. | optional |

-o | If specified, during the search, for every proposed species network, its branch lengths and inheritance probabilities will be optimized to compute its likelihood. Default value is false. | optional |

-po | If specified, after the search the returned species networks will be optimized for their branch lengths and inheritance probabilities under full likelihood. Default value is false. | optional |

-p | The original stopping criterion of Brent’s algorithm. Default value is (0.01, 0.001). | optional |

-r | Maximum number of rounds to optimize branch lengths for a network topology. Default value is 100. | optional |

-t | Maximum number of trial per branch in one round to optimize branch lengths for a network topology. Default value is 100. | optional |

-i | Minimum threshold of improvement to continue the next round of optimization of branch lengths. Default value is 0.001. | optional |

-l | Maximum branch lengths considered. Default value is 6. | optional |

-pl | Number of processors if you want the computation to be done in parallel. Default value is 1. | optional |

-di | Output the Rich Newick string of the inferred network that can be read by Dendroscope . | optional |

| Optional file destination for command output. | optional |

It is mandatory to specify the number of reticulation nodes to added to the starting network. By default, it is assumed that only one individual is sampled per species in gene trees. However, the option `[-a`

*taxa map*`]`

allows multiple alleles to be sampled. If users have a prior knowledge of the hybrid species, they can specify them using option *-h*.

The search: Option *-m *allows users to specify the maximum number of networks examined during the search. Users can specify the weights of seven operations for network arrangement through option *-w*. The seven weights correspond to adding a reticulation node, deleting a reticulation node, relocating the head of a reticulation edge, relocating the tail of an edge, reversing the direction of a reticulation edge, replacing a reticulation edge and changing branch lengths and inheritance probabilities, respectively. Furthermore, users can use option *-md *to specify the maximum move diameter of an operation for network rearrangement, like what local-SPR does. Also, users can use option *-rd *to specify the maximum reticulation diameter which is the distance (the number of branches) between the two parents of a reticulation node. In order to avoid getting stuck at some local optimum, it is recommended to performed the search multiple times, which users can specify by option *-x*. The -*s *option allows the users to specify a starting network (can be a tree) for network search. If the starting network is not specified, the optimal tree under MDC (command infer_ST_MDC) will be used. If it is not binary, a random resolution will be used. By default, only the first optimal species network will be returned. However, users can use *-n *option to ask for multiple optimal networks.

During the search, by default, simulated annealing is used (See *Salter* and *Pearl* 2001 for details of settings), where the branch lengths and inheritance probabilities are sampled. In this case, through option *-po,* as a post-processing, users can optimize the branch lengths and inheritance probabilities of the species networks returned by the search*.* If the dataset is not large and a large a mount of memory is available, users can use option *-o *to optimize the branch lengths and inheritance probabilities of every proposed network during the search. In this case, simple hill climbing will be used, and only the first 5 operations for network arrangement will be used.

By default, the method returns the species networks inferred under maximum pseudo-likelihood. However, networks are not necessarily encoded by their triplet system. To address this issue, users can ask PhyloNet to further analyze those returned species networks by optimizing their branch lengths and inheritance probabilities under full likelihood using option *-o. *Keep in mind that this feature might not be feasible for large datasets.

We use Richard Brent's algorithm (from his book "Algorithms for Minimization without Derivatives", p. 79) to optimize the branch lengths and inheritance probabilities. Users can use different options to control this process. Option *-p* allows users to specify the original stopping criterion of Brent's algorithm. More precisely, *abs* and *rel *define a tolerance *tol = rel |x| + abs. *We optimize the branch lengths one by one. For every branch, it terminates when either *maxTryPerBr *(option *-t*)* *trials have been made or the Brent's algorithm suggests so. Users can put an upper bound of the branch lengths through option *-l*.Optimization of all branch lengths consists of a round. After every round, if the improvement in terms of likelihood score is greater than that from last round by at least *improveThreshold *(option *-i*), we starts next round. A maximum of *maxRound *(option *-r*) rounds will be tried.

If users want to run the computation in parallel (in terms of the gene trees). Please specify the number of processors through option *-pl*.

Examples

Command References

- Y. Yu and L. Nakhleh. A maximum pseudo-likelihood approach for phylogenetic networks. Under review.
- Z. Cao, J. Zhu and L. Nakhleh. Empirical performance of tree-based inference of phylogenetic networks.