Package: pastml
PastMLPastMLprovides fast methods for Ancestral Character Reconstruction (ACR) and visualisation
on rooted phylogenetic trees. Given a rooted tree and its node annotations, it can either visualise them as-is,
or infer ancestral node states based on the tip states, with a selection of maximum likelihood and parsimonious methods.
The result is then visualised as a zoomable html map.ArticleIshikawa SA, Zhukova A, Iwasaki W, Gascuel O (2019)A Fast Likelihood Method to Reconstruct and Visualize Ancestral Scenarios.Molecular Biology and Evolution, msz131.How it worksFor detailed description of the ACR methods, and visualization procedure used inPastMLplease visit ourhelp page.Try it onlineTryPastMLatpastml.pasteur.frInput dataAs an input, one needs to provide arootedphylogenetical tree innewickformat,
and a table containing tip states,
in tab-delimited (by default) or csv format (to be specified with--data_sep ,option).ExampleYou can downloadHIV1-A in Albania dataas an example.
Let's assume that the tree and annotation files are in the Downloads folder,
and are named respectively Albanian.tree.152tax.tre	and data.txt.The data.txt is a comma-separated file, containing tip ids in the first column,
and Country in the second column, i.e.:idCountry98CMAJ6932Africa98CMAJ6933Africa96CMAJ6134Africa00SEAY5240WestEurope......02GRAY0303Greece97YUAF9960EastEuropeInstallationThere are 3 alternative ways to runpastmlon your computer: withdocker,singularityor in python3.Run with dockerBasic usageOncedockeris installed, run the following command:dockerrun-v<path_to_the_folder_containing_the_tree_and_the_annotations>:/data:rw-tevolbioinfo/pastml--tree/data/<tree_file.nwk>--data/data/<annotation_file.csv>--data_sep<separator_eg_,>--columns<column1column2...>--html_compressed/data/<output_map.html>For example, to reconstruct and visualise the ancestral Country states for Albanian data,
one needs to run the following command:dockerrun-v~/Downloads:/data:rw-tevolbioinfo/pastml--tree/data/Albanian.tree.152tax.tre--data/data/data.txt--columnsCountry--html_compressed/data/Albanian_map.html--data_sep,This will produce a file Albanian_map.html in the Downloads folder,
that can be viewed with a browser.HelpTo see advanced options, rundockerrun-tevolbioinfo/pastml-hRun with singularityBasic usageOncesingularityis installed, run the following command:singularityrundocker://evolbioinfo/pastml--tree<path/to/tree_file.nwk>--data<path/to/annotation_file.csv>--columns<column1column2...>--html_compressed<path/to/output/map.html>--data_sep<separator_eg_,>For example, to reconstruct and visualise the ancestral Country states for Albanian data,
one needs to run the following command:singularityrundocker://evolbioinfo/pastml--tree~/Downloads/Albanian.tree.152tax.tre--data~/Downloads/data.txt--columnsCountry--html_compressed~/Downloads/Albanian_map.html--data_sep,This will produce a file Albanian_map.html in the Downloads folder,
that can be viewed with a browser.HelpTo see advanced options, runsingularityrundocker://evolbioinfo/pastml-hRun in python3WindowsForWindowsusers, we recommend installingpastmlviaCygwin environment.
First instal python3 and pip3 from the Cygwin packages. Then installpastml:pip3installpastmlAll other platformsYou can installpastmlfor python with or withoutconda, following the procedures described below:Installing with condaOnce you have conda installed create an environment forpastmlwith python3, here we name it pastmlenv:condacreate--namepastmlenvpython=3Then activate it:sourceactivatepastmlenvThen installpastmlin it:pipinstallpastmlInstalling without condaMake sure that pyhon3 and pip3 are installed, then installpastml:pip3installpastmlBasic usage in a command lineIf you installedpastmlvia conda, do not forget to first activate the dedicated environment (here named pastmlenv), e.g.sourceactivatepastmlenvTo runpastml:pastml--tree<path/to/tree_file.nwk>--data<path/to/annotation_file.csv>--columns<column1column2...>--html_compressed<path/to/output/map.html>--data_sep<separator_eg_,>For example, to reconstruct and visualise the ancestral Country states for Albanian data,
one needs to run the following command:pastml--tree~/Downloads/Albanian.tree.152tax.tre--data~/Downloads/data.txt--columnsCountry--html_compressed~/Downloads/Albanian_map.html--data_sep,This will produce a file Albanian_map.html in the Downloads folder,
that can be viewed with a browser.HelpTo see advanced options, run:pastml-hBasic usage in python3frompastml.acrimportpastml_pipeline# Path to the table containing tip/node annotations, in csv or tab formatdata="~/Downloads/data.txt"# Path to the tree in newick formattree="~/Downloads/Albanian.tree.152tax.tre"# Columns present in the annotation table,# for which we want to reconstruct ancestral states# (for Albanian data we only have one column, but multiple columns are also allowed)columns=['Country']# Path to the output compressed map visualisationhtml_compressed="~/Downloads/Albanian_map.html"# (Optional) path to the output tree visualisationhtml="~/Downloads/Albanian_tree.html"pastml_pipeline(data=data,data_sep=',',columns=columns,name_column='Country',tree=tree,html_compressed=html_compressed,html=html,verbose=True)ExamplesSee theexamples folderfor ideas :)