{"id":32631358,"url":"https://github.com/uym2/minvar-rooting","last_synced_at":"2025-10-30T22:58:50.017Z","repository":{"id":82821866,"uuid":"74627333","full_name":"uym2/MinVar-Rooting","owner":"uym2","description":"Linear-time rooting of phylogenetic trees","archived":false,"fork":false,"pushed_at":"2023-06-12T19:19:14.000Z","size":12220,"stargazers_count":14,"open_issues_count":2,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-03-18T22:05:25.370Z","etag":null,"topics":["dendropy","mp-reroot","mv-reroot","tree"],"latest_commit_sha":null,"homepage":"https://uym2.github.io/MinVar-Rooting/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uym2.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2016-11-24T01:28:21.000Z","updated_at":"2023-05-15T15:19:46.000Z","dependencies_parsed_at":"2023-08-29T13:16:54.934Z","dependency_job_id":null,"html_url":"https://github.com/uym2/MinVar-Rooting","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/uym2/MinVar-Rooting","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uym2%2FMinVar-Rooting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uym2%2FMinVar-Rooting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uym2%2FMinVar-Rooting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uym2%2FMinVar-Rooting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uym2","download_url":"https://codeload.github.com/uym2/MinVar-Rooting/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uym2%2FMinVar-Rooting/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281896617,"owners_count":26580138,"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","status":"online","status_checked_at":"2025-10-30T02:00:06.501Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["dendropy","mp-reroot","mv-reroot","tree"],"created_at":"2025-10-30T22:57:58.152Z","updated_at":"2025-10-30T22:58:50.006Z","avatar_url":"https://github.com/uym2.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"FastRoot is a python implementation of a class of 'optimization-based' rooting methods for phylogenetic trees: Minimum Variance (MV), Midpoint (MP), Outgroups (OG), and Root-to-tip (RTT). All rooting methods are linear in time and memory. FastRoot was tested on Linux or MacOS.\n\n## Installation\nFastRoot needs the following dependencies\n- Python3\n- treeswift (version 1.1.14)\n- cvxopt (version 1.2.5)\n- numpy (version 1.19.0)\n\nYou can either install from PyPI (i.e. pip) or from source code.\n\n### Install using Pip\nYou need to have Python3 and Pip (in most cases are already installed with Python3, if not, please see https://pip.pypa.io/en/stable/installing/). All the other dependencies of FastRoot will be automatically installed together with the package.\n```bash\npython3 -m pip install FastRoot\n```\n\n### Install from source code\n1. Download the source code.  \n\t* Either clone the repository to your machine\n\t```bash\n\t   git clone https://github.com/uym2/MinVar-Rooting.git\n\t```\n\t* or simply download [this zip file](https://github.com/uym2/MinVar-Rooting/archive/master.zip) to your machine and unzip it in your preferred destination.\n\n2. To install, go to the MinVar-Rooting folder. \n\t* If you have ```pip```, use\n\t```bash\n\t   python3 -m pip install .\n\t```\n\t* Otherwise, if you have root access, type\n\t``` bash\n\t   sudo python3 setup.py install\n\t```\n\t* If you do not have root access, type\n\t``` bash\n\t   python3 setup.py install --user\n\t```\n\t\n## Testing\n\n```bash\nFastRoot_test.py \n```\n- After you installed FastRoot, run `FastRoot_test.py` to test if the program installed correctly.\n- First, `Running tests for FastRoot ...` will be printed.\n- Next, 12 tests will run.\n- If `OK` is printed last, the tests have passed successfully.\n\n## Usage\n\n```bash\nFastRoot.py [-h] [-i INPUT] [-m METHOD] [-g OUTGROUPS] [-t SMPLTIMES] [-o OUTFILE] [-s SCHEMA] [-f INFOFILE] [-v] [-x MAXITER]\n```\n\noptional arguments:\n```\t\t\n  -h, --help            show this help message and exit\n  -i INPUT, --input INPUT\n                        Input File (default is STDIN)\n  -m METHOD, --method METHOD\n                        Method (MP for midpoint, MV for minVAR, OG for outgroup, RTT for root-to-tip) (default is MV)\n  -g OUTGROUPS, --outgroups OUTGROUPS\n                        Specify the outgroups. If specifying a list of outgroups, put them between quotes (i.e. \").\n                        Otherwise, specifying a file which containts all the outgroups. Can only be used with -m OG\n  -t SMPLTIMES, --smplTimes SMPLTIMES\n                        The file containing the sampling times at leaves; to be used with -m RTT\n  -o OUTFILE, --outfile OUTFILE\n                        Output File (default is STDOUT)\n  -s SCHEMA, --schema SCHEMA\n                        Schema of your input treefile (default is newick)\n  -f INFOFILE, --infofile INFOFILE\n                        Save all the logging to this file. Default: print to stderr\n  -v, --version         Show FastRoot version and exit\n  -x MAXITER, --maxIter MAXITER\n                        Maximum number of iterations to run cvxopt\n```\n\nNOTE: `FastRoot.py` works for a list of trees\n\n### Rooting methods\nThere are 4 rooting methods: minVAR (MV), midpoint (MP), outgroups (OG), and root-to-tip (RTT).\n\n#### MinVAR Rooting (MV)\n* Usage: `-m MV`\n* Root the tree at the point that minimizes the variance of the root to tip distances.\n\n#### Midpoint Rooting (MP)\n* Usage: `-m MP`\n* Root the tree at the midpoint of the longest path between any pair of leaves (i.e. midpoint of the diameter).\n\n#### Root-to-tip Rooting (RTT)\n* Usage: `-m RTT -t \u003cSAMPLING_TIMES\u003e`\n* Optimizes the least squares regression of the root-to-tip time and substitutions.\n* The sampling times MUST be defined via ```-t```: a tab-delimited file, with one pair of species-time per line.\n* Example file: `use_cases/RTT/sampling_times.txt`.\nFor example, lines\n\n```\n000009  9.36668\n000010  9.36668\n000011  11.3667\n000012  11.3667\n```\nshow that leaves `000009` and `000010` are sampled at time 9.36668 while nodes `000011` and `000012` are sampled at time 11.3667. \n\n**Note:** \n- The sampling time for every leaf must be specified.\n- These times are assumed to be forward; i.e, smaller values mean closer to the root of the tree.\n\n#### Outgroup Rooting (OG)\n* Usage: `-m OG -g \u003cOUTGROUPS\u003e`\n* Maximizes the number of outgroup to ingroup triplets in the tree (i.e. maximizes the number of triplets of the forms (o,(i,i)) and (i,(o,o)) where i is an ingroup species and o is an outgroup species).\n* The outgroups MUST be defined via ```-g```: can either by a file `-g \u003cOUTGROUP_FILE\u003e` or a list surrounded by quotation marks `-g \"OUTGROUP1 OUTGROUP2 ...\"`.\n\n### Output\n`FastRoot.py` with `-o` will output to the specified destination. Without `-o`, it prints the tree to standard output (stdout). \nThe optimal score of each tree (depends on the rooting method) is printed to stderr by default; you can direct it to a file using `-f`.\n\n### Example usage\nYou can checkout the [tutorial](https://github.com/uym2/MinVar-Rooting/blob/master/tutorial.md) for some examples.\n\n## Publications\nIf you find MinVar-Rooting helpful for your research, please cite the following paper\n- Mai, Uyen, Erfan Sayyari, and Siavash Mirarab. “Minimum Variance Rooting of Phylogenetic Trees and Implications for Species Tree Reconstruction.” Edited by Gabriel Moreno-Hagelsieb. PLOS ONE 12, no. 8 (2017): e0182238. doi:10.1371/journal.pone.0182238.\n\n\n#### Besides, MinVar-Rootig was named MCCV in an independent and simultaneous work by Tria et al. Please also consider citing the following paper\n- Domingues Kümmel Tria, Fernando \u0026 Landan, Giddy \u0026 Dagan, Tal. (2017). Phylogenetic rooting using minimal ancestor deviation. Nature Ecology \u0026 Evolution. 1. 0193. 10.1038/s41559-017-0193.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuym2%2Fminvar-rooting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuym2%2Fminvar-rooting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuym2%2Fminvar-rooting/lists"}