Skip to main content

torchtree

Python package License: GPL v3 docs PyPI PyPI - Python Version

torchtree is a program designed for inferring phylogenetic trees from molecular sequences. Implemented in Python, it leverages PyTorch for automatic differentiation. The suite of inference algorithms encompasses variational inference, Hamiltonian Monte Carlo, maximum a posteriori, and Markov chain Monte Carlo.

Getting Started

Dependencies

Installation

Use an Anaconda environment (Optional)

conda env create -f environment.yml
conda activate torchtree

To install the latest stable version you can run

pip install torchtree

To build torchtree from source you can run

git clone https://github.com/4ment/torchtree
pip install torchtree/

Check install

torchtree --help

Quick start

torchtree requires a JSON file containing models and algorithms. A configuration file can be generated using torchtree-cli, a command line-based tool. This two-step process allows the user to adjust values in the configuration file, such as hyperparameters.

1 - Generating a configuration file

Some examples of models using variational inference:

Unrooted tree with GTR+W4 model

W4 refers to a site model with 4 rates categories coming from a discretized Weibull distribution. This is similar to the more commonly used discretized Gamma distribution site model.

torchtree-cli advi -i data/fluA.fa -t data/fluA.tree -m GTR -C 4 > fluA.json

Time tree with strict clock and constant coalescent model

torchtree-cli advi -i data/fluA.fa -t data/fluA.tree -m JC69 --clock strict --coalescent constant > fluA.json

2 - Running torchtree

This will generate sample.csv and sample.trees files containing parameter and tree samples drawn from the variational distribution

torchtree fluA.json

torchtree plug-in

torchtree can be easily extended without modifying the code base thanks its modular implementation. Some examples of external packages

License

Distributed under the GPLv3 License. See LICENSE for more information.

Acknowledgements

torchtree makes use of the following libraries and tools, which are under their own respective licenses:

Metadata

Release files for torchtree 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for torchtree 1.0.2
File Size Uploaded Provenance Actions
torchtree-1.0.2.tar.gz 145.4 kB Without provenance Details for torchtree-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for torchtree 1.0.2
File Interpreter ABI Platform Actions
torchtree-1.0.2-py3-none-any.whl Python 3 none any Details for torchtree-1.0.2-py3-none-any.whl

Total release size: 321.9 kB

Release files / torchtree-1.0.2.tar.gz

Download URL torchtree-1.0.2.tar.gz
Size 145.4 kB
Tags Source
SHA-256 checksum
How to use checksums
79d37e31d6617c40343165abdb1494ad8467c920fc33f80019659ef6c3616988
BLAKE2b-256 checksum
How to use checksums
7007aaf7efe7d895c7c1f48b11220f73348c30227fa873565bc8384da47ea331
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.2

Release files / torchtree-1.0.2-py3-none-any.whl

Download URL torchtree-1.0.2-py3-none-any.whl
Size 176.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c0f62e8d533ec29e90cd1579fd68e5b1e5a19e889d0ac5fc858afc51f912d9c
BLAKE2b-256 checksum
How to use checksums
70ffb0bbc1082a8a6a905f4491df6aec990ba802c2ca8ba005fb5eb5364d3364
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.2

Security for torchtree 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page