mptp_exercise - Pas-Kapli/tutorials GitHub Wiki

Introduction (m)ptp

PTP takes as input a phylogenetic tree and tries to determine the transition point from a between- to a within-species process. The single rate PTP assumes that the branch lengths of the phylogenetic tree can be split in two clusters, fitting two distinct exponential distributions; one corresponding to the speciation and one to the coalescent process. The newly introduced multi rate PTP (mPTP) assumes that the branch lengths of each putative species may form different clusters and therefore it assumes each may fit a distinct exponential distribution.

Software:

(m)PTP is available as standalone software implemented in C and as a website new version and older version

Input: Aligned fasta file or distance matrix

Commands for installing mptp

$ git clone https://github.com/Pas-Kapli/mptp.git
$ cd mptp
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install

Exercise: Species delimitation with mptp

Working directory: ~/workshop_exercises/distance_methods/branchiomma/gmyc

Note: If you didn't create this directory during the linux tutorial create it now using mkdir

Infer alignment:

$ mafft BR_cob_57ind.fasta > BR_cob_57ind_mafft.fasta

mafft BR_cob_57ind.fasta

BR_cob_57ind_mafft.fasta

Note: Need to be much more careful with the alignment when using datasets with many indels (e.g. 16S rRNA)

phylip_to_fasta.py

Infer phylogenetic tree with RAxML:

 $ raxmlHPC-PTHREADS-SSE3 -s BR_cob_57ind_mafft.fasta -m GTRGAMMA -n Branchiomma -p $RANDOM -T 2 -o BR_076,BR_018,BR_019,BR_020

RAxML_bestTree.Branchiomma

By using the -o argument we retrieve a rooted phylogeny, we can also root it with mptp later

 $ mkdir raxml multi single
 $ mv RAxML* raxml

Run (m)ptp:

Check the mptp options:

$ cd mptp 
$ mptp --help

Detect minimum branch length:

 $ mptp --tree_file ../raxml/RAxML_bestTree.Branchiomma --minbr_auto ../BR_cob_57ind_mafft.fasta -output_file minbr 

Delimitation with the multi-rate algorithm

If the phylogeny is unrooted use the --outgroup taxon_name1,taxon_name2 for rooting the phylogeny prior to the delimitation

 $ mptp --ml --multi --tree_file ../raxml/RAxML_bestTree.Branchiomma --output_file Branchiomma_mptp_multi --outgroup BR_076,BR_018,BR_019,BR_020 --outgroup_crop --minbr 0.0022448990

Check the output files:

$ firefox Branchiomma_mptp_multi.svg

$ nano Branchiomma_mptp_multi.txt 

Branchiomma_mptp_multi.svg Branchiomma_mptp_multi.txt

Repeat the exercise with the single-rate algorithm using the --single instead of the --multi option

Support values:

Perform MCMC sampling for the multi and the single rate PTP:

$ mptp --tree_file ../raxml/RAxML_bestTree.Branchiomma --minbr 0.0022448990 --mcmc 10000000 --mcmc_log --mcmc_sample 50000 --multi --mcmc_runs 2 --output_file mcmc_multi --outgroup BR_076,BR_018,BR_019,BR_020 --outgroup_crop 

Output files

tree file with support values in svg format (mcmc_multi.1536946547.combined.svg) and in newick format (mcmc_multi.1536946547.combined.tree)

Plot of the likelihood per mcmc step for the multi rate algorithm

Q: Did the two runs converge to the same score/solution?