mptp(1)
โจ mptp โ single-locus species delimitation โจ
okay bestie, sit down, hydrate, because we're about to talk about mptp(1) โ single-locus species delimitation โ and honestly? it's giving main character energy in the phylogenetics world. ๐ธ
๐ NAME ๐
mptp โ single-locus species delimitation ๐
That's it, that's the whole name section. Short. Iconic. No notes. โจ
๐ SYNOPSIS ๐
So there are two whole ways to run this thing, and the vibe check depends entirely on whether you want a plain maximum-likelihood answer or a fancy one with support values. ๐ฆ
๐ Maximum-likelihood species delimitation
If you just want the ML answer, no extra drama:
mptp --ml (--single | --multi) --tree_file newickfile
--output_file outputfile [options]
๐ Species delimitation with support values
And if you want the support values too, you're doing the whole <code>--mcmc</code> situation, which means more flags, more commitment, more slay:
mptp --mcmc positive integer (--single | --multi)
(--mcmc_startnull | --mcmc_startrandom | --mcmc_startml)
--mcmc_log positive integer --tree_file newickfile --output_file
outputfile [options]
heads up, bestie: in that second one,positive integeris literally standing in for a number you gotta supply โ twice, once for--mcmcand once for--mcmc_log. it's not a keyword, it's a placeholder. don't type the words. ๐ญ
both of these take [options] at the end, and the ( ... | ... ) bits mean pick exactly one โ like, --single OR --multi, no greedy energy, you cannot have both. same deal with the --mcmc_start* trio. pick your fighter. ๐ฅ
more parts coming, so don't go anywhere โ we're just getting started. ๐
๐ DESCRIPTION ๐
Okay bestie, real talk: species is one of the fundamental units of comparison in literally every subfield of biology โ systematics, anatomy, development, ecology, evolution, genetics, molecular biology, all of it. So the whole point of mptp is to give you an open source tool that infers species boundaries on a phylogenetic tree you hand it, based on the Poisson Tree Process (PTP) and the Multiple Poisson Tree Process (mPTP) models. ๐
mptp gives you two ways to infer species delimitation:
- A maximum-likelihood based method that uses a dynamic programming approach to infer an ML estimate. โจ
- An mcmc approach that samples the space of possible delimitations and hands you support values on the tree clades. ๐ฒ
Both of those come in two flavours: the PTP model and the mPTP model. You pick PTP with the --single switch, and mPTP with --multi. Easy. ๐
๐ฑ Input ๐ฑ
The input for mptp is a newick file containing one phylogenetic tree. Heads up: branches express the expected number of substitutions per alignment site. That's the vibe. ๐ฆ
โ๏ธ Options โ๏ธ
mptp parses a large number of command-line options (she's thorough, we love her for it). To make it not overwhelming, they're grouped by theme below. ๐
โจ General options โจ
--helpโ Display help text and exit. Your girl is helpful. ๐--versionโ Output version information and exit. ๐ท๏ธ--quietโ Suppress all output tostdoutexcept for warnings and fatal error messages. So warnings and fatal errors still show up โ she's quiet, not reckless. ๐--tree_filefilename โ Input newick file that contains a phylogenetic tree. Can be rooted or unrooted. ๐ณ--output_filefilename โ Specifies the prefix used for generating output files.- For maximum-likelihood species delimitation, two files get created: first, filename
.txt, which contains the actual delimitation, and filename.svg, which contains an SVG figure of the computed delimitation. ๐ผ๏ธ - For mcmc analyses, a file filename
.txtis created containing the newick tree with supports values. ๐ซถ
- For maximum-likelihood species delimitation, two files get created: first, filename
--outgroupcomma-separated list of taxa โ All computations for species delimitation are carried out on rooted trees. This option is used only (and is required) in case an unrooted tree was specified with the--tree_fileoption.mptproots the unrooted tree by splitting the branch leading to the most recent common ancestor (MRCA) of the comma-separated list of taxa into two branches of equal size, and introducing a new node (the root of the new rooted tree) that connects these two branches. ๐ฑ--outgroup_cropโ Crops taxa specified with the--outgroupoption from the tree. โ๏ธ--min_brreal โ Any branch lengths in the input tree smaller or equal to real are excluded (ignored) from the computations. On top of that, for mcmc analyses, subtrees that exclusively consist of branch lengths smaller or equal to real are completely ignored from the proposals โ support values for those clades are set to0. (default:0.0001) ๐--precisionpositive integer โ Specifies the precision of the decimal part of floating point numbers on output. (default:7) ๐ข--minbr_autofilename โ Automatically detects the minimum branch length from the p-distances of the FASTA file filename. ๐ค--tree_showโ Show an ASCII version of the processed input tree (i.e. after it is rooted by, potentially cropping, the outgroup). Tree but make it ASCII, iconic. ๐จ
๐ฅ Maximum-likelihood estimations ๐ฅ
Estimating the maximum-likelihood delimitation is triggered by the switch --ml followed by --single (the PTP model) or --ml --multi (the mPTP model). Heads up: these two methods affect how the option --output_file behaves, and they can be controlled using the --min_br switch. Both methods require a rooted phylogenetic tree โ however, an unrooted tree may be specified in conjunction with the option --outgroup. In that case, mptp roots it at that outgroup (see General options, --outgroup for more info). And note that both methods output an SVG depiction of the ML delimitation โ see Visualization for more information on adjusting and fine-tuning the SVG output. ๐ผ๏ธโจ
Both methods ignore/discard branch lengths of size smaller than the size specified using the --min_br option. The PTP model then attempts to find a connected subgraph of the rooted tree that:
- contains the root, and
- the sum of likelihoods of fitting the edges of that subgraph in one exponential distribution and the remaining edges in another (exponential distribution) is maximized.
By likelihood we mean the sums of the probability density function with the mean defined as the reciprocal of the average of edge lengths in the particular distribution. No cap. ๐งฎ
--ml --singleโ Triggers the algorithm for computing an ML estimate of the delimitation using the PTP model. ๐ฅ--ml --multiโ Triggers the algorithm for computing an ML estimate of the delimitation using the mPTP model. ๐ฅ--pvaluereal โ Only used with the PTP model (specified with--single). Sets the p-value for performing a likelihood ratio test. Note that there is no likelihood ratio test for the mPTP model, so this test is not done. (default:0.001) ๐
๐ฒ MCMC method ๐ฒ
The MCMC method is triggered with the --mcmc switch combined with either --single (the PTP model) or --multi (the mPTP model). ๐
Some more stuff to write
Not me reading the actual manpage and it literally says "Some more stuff to write" ๐ญ โ that's a placeholder straight from the source, bestie, and I'm keeping it because the one rule is that nothing gets dropped. The author is gonna circle back, fr fr.
--mcmcpositive integer--singleโ Triggers the algorithm for computing support values by taking the specified number of MCMC samples (delimitations) using the PTP model. ๐ฒ--mcmcpositive integer--multiโ Triggers the algorithm for computing support values by taking the specified number of MCMC samples (delimitations) using the mPTP model. ๐ฒ--mcmc_samplepositive integer โ Sample only every n-th MCMC step. โญ๏ธ--mcmc_logโ Log the scores (log-likelihood) for each MCMC sample in a file and create an SVG plot. ๐--mcmc_burninpositive integer โ Ignore all MCMC samples generated before the specified step. (default:1) ๐ฅ--mcmc_runspositive integer โ Perform multiple MCMC runs. If more than1run is specified,mptpwill generate one seed for each run based on the provided seed using the--seedswitch. Output files will be generated for each run. (default:1) ๐--mcmc_crediblereal โ Specify the probability (0.0to1.0) for which to generate the credible interval, i.e., the probability the true number of species will fall within the credible interval given the observed data. (default:0.95) ๐ซถ--mcmc_startnullโ Start MCMC sampling from the null-model. ๐ณ๏ธ--mcmc_startrandomโ Start MCMC sampling from a random delimitation. ๐ฐ--mcmc_startrandomโ Start MCMC sampling from the ML delimitation. ๐คจ
Yes, bestie, --mcmc_startrandom shows up twice in the original page, and the second one is described as starting from the ML delimitation. I'm not editing the source's truth, I'm just holding up a mirror. ๐
--seedpositive integer โ Specifies the seed for the pseudo-random number generator. (default: randomly generated based on system time) ๐ฑ
๐จ SVG Output ๐จ
The ML method generates one SVG file that visualizes the processed input tree (i.e. after it is rooted by, potentially cropping, the outgroup) and marks the subtrees corresponding to coalescent processes (the detected species groups) with red color, while the speciation process is colored green. ๐
The MCMC method generates one SVG file per run visualizing the processed tree, and indicates the support value for each node, i.e., the percentage of MCMC samples (delimitations) in which the particular node was part of the speciation process. A value of 1 means it was always in the speciation process, while a value of 0 means it was always in a coalescent process. The tree branches are colored according to the support values of descendant nodes; a support value of 0 is colored with red, 1 with black, and values in between are gradients of the two colors. Only support values above 0.5 are shown, to avoid packed numbers in dense branching events. In addition, if --mcmc_log is specified, an additional SVG image of log-likelihoods plots for each sampled delimitation is created. ๐๐
--svg_widthpositive integer โ Sets the total width (including margins) of the SVG in pixels. (default:1920) ๐--svg_fontsizepositive integer โ Size of font in SVG image. (default:12) ๐ค--svg_tipspacingpositive integer โ Vertical space in pixels between taxa in SVG tree. (default:20) ๐--svg_legend_ratioreal โ Ratio (value between0.0and1.0) of total tree length to be displayed as legend line. (default:0.1) ๐--svg_nolengendโ Hide legend. ๐--svg_marginleftpositive integer โ Left margin in pixels. (default:20) โฌ ๏ธ--svg_marginrightpositive integer โ Right margin in pixels. (default:20) โก๏ธ--svg_margintoppositive integer โ Top margin in pixels. (default:20) โฌ๏ธ--svg_marginbottompositive integer โ Top margin in pixels. (default:20) โฌ๏ธ--svg_inner_radiuspositive integer โ Radius of inner nodes in pixels. (default:0) โญ
๐ EXAMPLES ๐
ok bestie let's get you actually running this thing, because reading options is one thing and typing them is another ๐
1. compute the maximum likelihood estimate with the mPTP model, and just throw away every branch whose length is less than or equal to 0.0001
mptp --ml --multi --min_br 0.0001 --tree_file newick.txt
--output_file out
2. run an MCMC analysis of 100 million steps with the mPTP model ๐ฆ it logs every one-millionth step, ignores the first 2 million steps, and discards all branches with lengths smaller or equal to 0.0001. use 777 as the seed. heads up: the chain starts from the ML delimitation (that's the default, no extra flag needed, slay).
mptp --mcmc 100000000 --multi --min_br 0.0001 --tree_file
newick.txt --output_file out --mcmc_log 1000000 --mcmc_burnin
2000000 -seed 777
3. do an MCMC analysis of 5 runs, each one 100 million steps, with the mPTP model. log every one-millionth step, ignore the first 2 million steps, and let it detect the minimum branch length by handing it the FASTA file alignment.fa which holds the alignment ๐ธ use 777 as the seed. and this time every run starts from a random delimitation.
mptp --mcmc 100000000 --multi ---mcmc_runs 5 --mcmc_log 1000000
--minbr_auto alignment.fa --tree_file newick.txt --output_file
out --mcmc_burnin 2000000 -seed 777 --mcmc_startrandom
๐ AUTHORS ๐
Implementation by Tomas Flouri, Sarah Lutteropp and Paschalia Kapli.
Additional PTP and mPTP model authors include Kassian Kobert, Jiajie Zhang, Pavlos Pavlidis, and Alexandros Stamatakis.
absolute legends, every single one of them ๐
๐ REPORTING BUGS ๐
found something cursed? submit suggestions and bug-reports at <https://github.com/Pas-Kapli/mptp/issues>, or e-mail Tomas Flouri <Tomas.Flouri@h-its.org>.
โจ AVAILABILITY โจ
Source code and binaries are available at <https://github.com/Pas-Kapli/mptp>.
๐ COPYRIGHT ๐
Copyright (C) 2015-2017, Tomas Flouri, Sarah Lutteropp, Paschalia Kapli
All rights reserved.
Contact: Tomas Flouri <Tomas.Flouri@h-its.org>, Scientific Computing, Heidelberg Insititute for Theoretical Studies, 69118 Heidelberg, Germany
This software is licensed under the terms of the GNU Affero General Public License version 3.
GNU Affero General Public License version 3
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
๐ VERSION HISTORY ๐
new features and important modifications of mptp (heads up: short lived or minor bug releases may not be mentioned here, so don't come for me):
- v0.1.0 released June 27th, 2016
- First public release. the debut era ๐
- v0.1.1 released July 15th, 2016
- Bug fix (now LRT test is not printed in output file when using
--multi)
- Bug fix (now LRT test is not printed in output file when using
- v.0.2.0 released September 27th, 2016
- Fixed floating point exception error when constructing random trees, caused from dividing by zero. Changed allocation from
malloctocalloc, as it caused unititialized variables when converting unrooted trees to rooted when using the MCMC method. Fixed sample size for the AIC with a correction for finite sample sizes.
- Fixed floating point exception error when constructing random trees, caused from dividing by zero. Changed allocation from
- v.0.2.1 released October 18th, 2016
- Updated ASV to consider only coalescent roots of ML delimitation. Removed assertion stopping mptp when using random starting delimitations for the MCMC method.
- v0.2.2 released January 31st, 2017
- Fixed regular expressions to allow scientific notation for branch lengths when parsing trees. Improved the accuracy of ASV score by also taking into account tips forming coalescent roots. Fixed memory leaks that occur when parsing incorrectly formatted trees.
- v0.2.3 released July 25th, 2017
- Replaced
hsearch()with custom hashtable. Fixed minor output error messages.
- Replaced
- v0.2.4 released May 14th, 2018
- If we do not manage to generate a random starting delimitation with the wanted number of species (randomly chosen), we use the currently generated delimitation instead.
- v0.2.5 released Sep 9th, 2023
- Added likelihood ratio test for the multi method. Added implementation for the incomplete gamma function, and removed dependency for GNU scientific library.
and that's the whole page bestie, you made it to the end ๐ซถ this was mptp version 0.2.5, dated Sep 11, 2023 โ go forth and delimit some species, no cap โญ๐ง๐
๐ฆ where this page comes from
- debian trixie: mptp 0.2.5-1 ยท AFFERO-3
- ubuntu questing: mptp 0.2.5-1
- ubuntu resolute: mptp 0.2.5-2 ยท AFFERO-3
- ubuntu stonking: mptp 0.2.5-2 ยท AFFERO-3
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms