This repository contains C code for PastML versions till 1.0. However we have still decided to move to python3. You can find the new versions of PastML and more information at evolbioinfo/pastml.
For a detailed description of PastML see Ishikawa SA, Zhukova A, Iwasaki W, Gascuel O (2019) A Fast Likelihood Method to Reconstruct and Visualize Ancestral Scenarios [Mol. Biol. Evol.].
Try it at pastml.pasteur.fr
As an input, one needs to provide a rooted phylogenetical tree in newick format, and a table containing tip states.
To run the core PastML C library (without visualisation), follow the instructions below. For running PastML with visualisation see evolbioinfo/pastml.
Let's assume that we have a rooted tree with n tips (in newick format), and a tip annotation file, and that they are in the Downloads folder, named respectively tree.nwk and states.csv.
The states.csv is a comma-separated file, containing tip ids (the same as in the tree) in the first column, and tip annotations in the second column. It must not contain a header line, and it must contain an annotation for each tip in the tree (possibly empty if the annotation is unknown), e.g.:
tip_1,Africa
tip_2,Asia
tip_3,
...
tip_n,Africa
Note, that here we do not know the annotation for tip_3, so we left it blank.
First install cmake (> ver.3.6) and GNU Scientific Library (> ver.2.3), following the instructions on CMAKE web site and GNU GSL web site. GCC (> ver.4.8.5) is also required.
Then download and extract PastML, change to its folder and run:
cmake .
make
pastml -t <path/to/tree_file.nwk> -a <path/to/annotation_file.csv>
For the data example above, the command becomes:
pastml -t ~/Downloads/tree.nwk -a ~/Downloads/states.csv
To see advanced options (including the choice of evolutionary model and ancestral character reconstruction method), run:
pastml -h
See the examples folder for ideas :)