{"id":26572742,"url":"https://github.com/evolbioinfo/pastml","last_synced_at":"2025-10-21T05:23:20.706Z","repository":{"id":54725891,"uuid":"157720271","full_name":"evolbioinfo/pastml","owner":"evolbioinfo","description":"Ancestral character reconstruction and visualisation for rooted phylogenetic trees","archived":false,"fork":false,"pushed_at":"2024-02-26T16:57:04.000Z","size":37910,"stargazers_count":25,"open_issues_count":9,"forks_count":5,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-04-29T08:20:13.049Z","etag":null,"topics":["ancestral-character-reconstruction","maximum-likelihood","parsimony","phylogenetics","phylogeography","visualisation"],"latest_commit_sha":null,"homepage":"https://pastml.pasteur.fr","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/evolbioinfo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-15T13:59:04.000Z","updated_at":"2024-07-12T14:45:18.514Z","dependencies_parsed_at":"2024-02-26T18:04:48.925Z","dependency_job_id":"34ff07c4-2238-434b-ba33-c999e37b3997","html_url":"https://github.com/evolbioinfo/pastml","commit_stats":{"total_commits":243,"total_committers":2,"mean_commits":121.5,"dds":0.004115226337448541,"last_synced_commit":"e57266c9eedd7a0c5ca3095f4856e195dcb1d889"},"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evolbioinfo%2Fpastml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evolbioinfo%2Fpastml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evolbioinfo%2Fpastml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evolbioinfo%2Fpastml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evolbioinfo","download_url":"https://codeload.github.com/evolbioinfo/pastml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245040215,"owners_count":20551297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ancestral-character-reconstruction","maximum-likelihood","parsimony","phylogenetics","phylogeography","visualisation"],"created_at":"2025-03-23T00:34:41.184Z","updated_at":"2025-10-21T05:23:20.682Z","avatar_url":"https://github.com/evolbioinfo.png","language":"Python","funding_links":[],"categories":["Other Tools"],"sub_categories":["Ancient Viral Sequence Analysis"],"readme":"# PastML\n\n__PastML__ provides fast methods for Ancestral Character Reconstruction (ACR) and visualisation\non rooted phylogenetic trees. Given a rooted tree and its node annotations, it can either visualise them as-is, \nor infer ancestral node states based on the tip states, with a selection of maximum likelihood and parsimonious methods. \nThe result is then visualised as a zoomable html map.\n\n\n[![DOI:10.1093/molbev/msz131](https://zenodo.org/badge/DOI/10.1093/molbev/msz131.svg)](https://doi.org/10.1093/molbev/msz131)\n[![GitHub release](https://img.shields.io/github/v/release/evolbioinfo/pastml.svg)](https://github.com/evolbioinfo/pastml/releases)\n[![Anaconda-Server Badge](https://anaconda.org/bioconda/pastml/badges/version.svg)](https://anaconda.org/bioconda/pastml)\n[![PyPI version](https://badge.fury.io/py/pastml.svg)](https://pypi.org/project/pastml/)\n[![PyPI downloads](https://shields.io/pypi/dm/pastml)](https://pypi.org/project/pastml/)\n[![Docker pulls](https://img.shields.io/docker/pulls/evolbioinfo/pastml)](https://hub.docker.com/r/evolbioinfo/pastml/tags)\n[![Unit Tests](https://github.com/evolbioinfo/pastml/workflows/PastML%20Unit%20Tests/badge.svg)](tests)\n\n\n\n#### Article\n\nIshikawa\u003csup\u003e.\u003c/sup\u003e SA, Zhukova\u003csup\u003e.\u003c/sup\u003e A, Iwasaki W, Gascuel O (2019) __A Fast Likelihood Method to Reconstruct and Visualize Ancestral Scenarios__. [_Molecular Biology and Evolution_, msz131](https://doi.org/10.1093/molbev/msz131).\n\n## How it works\n\nFor detailed description of the ACR methods, and visualization procedure used in __PastML__ please visit our [help page](https://pastml.pasteur.fr/help).\n\n## Try it online\nTry __PastML__ at [pastml.pasteur.fr](https://pastml.pasteur.fr)\n\n# Input data\nAs an input, one needs to provide a **rooted** phylogenetical tree in [newick](https://en.wikipedia.org/wiki/Newick_format) format,\nand a table containing tip states, \nin tab-delimited (by default) or csv format (to be specified with *--data_sep ,* option).\n\n### Example\nYou can download [HIV1-A in Albania data](examples/Albania/data) as an example.\nLet's assume that the tree and annotation files are in the Downloads folder, \nand are named respectively Albanian.tree.152tax.tre\tand data.txt.\n\nThe data.txt is a comma-separated file, containing tip ids in the first column, \nand Country in the second column, i.e.:\n\nid | Country\n----- |  -----\n98CMAJ6932 | Africa\n98CMAJ6933 | Africa\n96CMAJ6134 | Africa\n00SEAY5240 | WestEurope\n... | ...\n02GRAY0303 | Greece\n97YUAF9960 | EastEurope\n\n# Installation\n\nThere are 3 alternative ways to run __pastml__ on your computer: with [docker](https://www.docker.com/community-edition), [singularity](https://www.sylabs.io/singularity/) or in python3.\n\n## Run with docker\n\n### Basic usage\nOnce [docker](https://www.docker.com/community-edition) is installed, run the following command:\n\n```bash\ndocker run -v \u003cpath_to_the_folder_containing_the_tree_and_the_annotations\u003e:/data:rw -t evolbioinfo/pastml --tree /data/\u003ctree_file.nwk\u003e --data /data/\u003cannotation_file.csv\u003e --data_sep \u003cseparator_eg_,\u003e --columns \u003ccolumn1 column2 ...\u003e --html_compressed /data/\u003coutput_map.html\u003e\n```\n\nFor example, to reconstruct and visualise the ancestral Country states for Albanian data, \none needs to run the following command:\n\n```bash\ndocker run -v ~/Downloads:/data:rw -t evolbioinfo/pastml --tree /data/Albanian.tree.152tax.tre --data /data/data.txt --columns Country --html_compressed /data/Albanian_map.html --data_sep , \n```\n\nThis will produce a file Albanian_map.html in the Downloads folder, \nthat can be viewed with a browser.\n\n\n#### Help\n\nTo see advanced options, run\n```bash\ndocker run -t evolbioinfo/pastml -h\n```\n\n## Run with singularity\n\n### Basic usage\nOnce [singularity](https://www.sylabs.io/guides/2.6/user-guide/quick_start.html#quick-installation-steps) is installed, run the following command:\n\n```bash\nsingularity run docker://evolbioinfo/pastml --tree \u003cpath/to/tree_file.nwk\u003e --data \u003cpath/to/annotation_file.csv\u003e --columns \u003ccolumn1 column2 ...\u003e --html_compressed \u003cpath/to/output/map.html\u003e --data_sep \u003cseparator_eg_,\u003e\n```\n\nFor example, to reconstruct and visualise the ancestral Country states for Albanian data, \none needs to run the following command:\n\n```bash\nsingularity run docker://evolbioinfo/pastml --tree ~/Downloads/Albanian.tree.152tax.tre --data ~/Downloads/data.txt --columns Country --html_compressed ~/Downloads/Albanian_map.html --data_sep , \n```\n\nThis will produce a file Albanian_map.html in the Downloads folder, \nthat can be viewed with a browser.\n\n\n#### Help\n\nTo see advanced options, run\n```bash\nsingularity run docker://evolbioinfo/pastml -h\n```\n\n## Run in python3\n\n### Windows\nFor **Windows** users, we recommend installing __pastml__ via [Cygwin environment](https://www.cygwin.com/).\nFirst instal python3 and pip3 from the Cygwin packages. Then install __pastml__:\n```bash\npip3 install pastml\n```\n\n### All other platforms\n\nYou can install __pastml__ for python with or without [conda](https://conda.io/docs/), following the procedures described below:\n\n#### Installing with conda\n\nOnce you have conda installed create an environment for __pastml__ with python3, here we name it pastmlenv:\n\n```bash\nconda create --name pastmlenv python=3\n```\n\nThen activate it:\n```bash\nsource activate pastmlenv\n```\n\nThen install __pastml__ in it:\n\n```bash\npip install pastml\n```\n\n#### Installing without conda\n\nMake sure that pyhon3 and pip3 are installed, then install __pastml__:\n\n```bash\npip3 install pastml\n```\n\n### Basic usage in a command line\nIf you installed __pastml__ via conda, do not forget to first activate the dedicated environment (here named pastmlenv), e.g.\n\n```bash\nsource activate pastmlenv\n```\n\nTo run __pastml__:\n\n```bash\npastml --tree \u003cpath/to/tree_file.nwk\u003e --data \u003cpath/to/annotation_file.csv\u003e --columns \u003ccolumn1 column2 ...\u003e --html_compressed \u003cpath/to/output/map.html\u003e --data_sep \u003cseparator_eg_,\u003e\n```\n\nFor example, to reconstruct and visualise the ancestral Country states for Albanian data, \none needs to run the following command:\n\n```bash\npastml --tree ~/Downloads/Albanian.tree.152tax.tre --data ~/Downloads/data.txt --columns Country --html_compressed ~/Downloads/Albanian_map.html --data_sep , \n```\n\nThis will produce a file Albanian_map.html in the Downloads folder, \nthat can be viewed with a browser.\n\n#### Help\n\nTo see advanced options, run:\n```bash\npastml -h\n```\n\n### Basic usage in python3\n```python\nfrom pastml.acr import pastml_pipeline\n\n# Path to the table containing tip/node annotations, in csv or tab format\ndata = \"~/Downloads/data.txt\"\n\n# Path to the tree in newick format\ntree = \"~/Downloads/Albanian.tree.152tax.tre\"\n\n# Columns present in the annotation table,\n# for which we want to reconstruct ancestral states\n# (for Albanian data we only have one column, but multiple columns are also allowed)\ncolumns = ['Country']\n\n# Path to the output compressed map visualisation\nhtml_compressed = \"~/Downloads/Albanian_map.html\"\n\n# (Optional) path to the output tree visualisation\nhtml = \"~/Downloads/Albanian_tree.html\"\n\npastml_pipeline(data=data, data_sep=',', columns=columns, name_column='Country', tree=tree,\n                html_compressed=html_compressed, html=html, verbose=True)\n```\n\n### Examples\n\nSee the [examples folder](https://github.com/evolbioinfo/pastml/tree/master/examples) for ideas :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevolbioinfo%2Fpastml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevolbioinfo%2Fpastml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevolbioinfo%2Fpastml/lists"}