https://github.com/4ment/torchtree-physher

https://github.com/4ment/torchtree-physher

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.2%) to scientific vocabulary

Keywords

c gradient phylogenetics physher pytorch torchtree
Last synced: 6 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: 4ment
  • License: gpl-3.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 207 KB
Statistics
  • Stars: 1
  • Watchers: 3
  • Forks: 0
  • Open Issues: 1
  • Releases: 1
Topics
c gradient phylogenetics physher pytorch torchtree
Created almost 4 years ago · Last pushed over 1 year ago
Metadata Files
Readme License

README.md

torchtree-physher

Testing License: GPL v3

About torchtree-physher

torchtree-physher is a python package providing fast gradient calculation implemented in physher for torchtree.

Getting Started

A C++ compiler such as g++ or clang++ is required. On Debian-based systems, this can be installed via apt:

bash sudo apt install g++

On MacOS, it is recommended to use the latest version of clang++: bash brew install llvm

The pybind11 library is also used for binding the C++ functionality to Python.

Dependencies

physher is a phylogenetic program written in C that provides C++ wrappers to compute the tree and coalescent likelihoods and their gradients under different models.

To build physher from source you can run bash git clone https://github.com/4ment/physher cmake -S physher/ -B physher/build -DBUILD_CPP_WRAPPER=on -DBUILD_TESTING=on cmake --build physher/build/ --target install

Check it works (optional) bash ctest --test-dir physher/build/

Installation

To build torchtree-physher from source you can run bash git clone https://github.com/4ment/torchtree-physher pip install torchtree-physher/

Check install

If the installation was successful, this command should print the version of the torchtree_physher library bash python -c "import torchtree_physher;print(torchtree_physher.__version__)"

Command line arguments

The torchtree-physher plugin adds these arguments to the torchtree CLI:

bash torchtree-cli advi --help ... --physher use physher --physher_include_jacobian include Jacobian of the node height transform in the node height gradient --physher_disable_sse disable SSE in physher --physher_disable_coalescent disable coalescent calculation by physher --physher_site {weibull,gamma} distribution for rate heterogeneity across sites

Features

Tree likelihood

Some types in the JSON configuration file have to be replaced in order to use the tree likelihood implementation of physher. You simply need to add torchtree_physher. before a model type. Here is a list of models implemented in this plugin:

  • TreeLikelihoodModel
  • Substitution models:
    • JC69
    • HKY
    • GTR
    • GeneralNonSymmetricSubstitutionModel
  • Tree models:
    • UnRootedTreeModel
    • ReparameterizedTimeTreeModel
  • Clock models (optional):
    • StrictClockModel
    • SimpleClockModel
  • Site models:
    • ConstantSiteModel
    • GammaSiteModel
    • InvariantSiteModel
    • WeibullSiteModel

Note that the type of every sub-model of the tree likelihood object (e.g. site, tree models...) has to be replaced.

For example if we want to use ADVI with an unrooted tree and a Weibull site model:

bash torchtree-cli advi -i data.fa -t data.tree -C 4 > data.json sed -i -E 's/TreeLikelihoodModel/torchtree_physher.TreeLikelihoodModel/; s/UnRootedTreeModel/torchtree_physher.UnRootedTreeModel/; s/WeibullSiteModel/torchtree_physher.WeibullSiteModel/' data.json torchtree data.json

The JSON file can be created directly using the --physher option: bash torchtree-cli advi -i data.fa -t data.tree -C 4 --physher > data.json

Coalescent models

Here is a list of coalescent models implemented in this plugin:

  • ConstantCoalescentModel
  • PiecewiseConstantCoalescentGridModel (aka skygrid)
  • PiecewiseConstantCoalescentModel (aka skyride)
  • PiecewiseLinearCoalescentGridModel

License

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

Acknowledgements

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

Owner

  • Name: Mathieu Fourment
  • Login: 4ment
  • Kind: user
  • Location: Australia
  • Company: University of Technology Sydney

GitHub Events

Total
Last Year

Committers

Last synced: 6 months ago

All Time
  • Total Commits: 39
  • Total Committers: 1
  • Avg Commits per committer: 39.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Mathieu Fourment m****t@g****m 39

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 1
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 1
  • Total pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • 4ment (1)
Pull Request Authors
Top Labels
Issue Labels
bug (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 11 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
pypi.org: torchtree-physher

Phylogenetic inference with pytorch and physher

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 11 Last month
Rankings
Dependent packages count: 10.7%
Average: 35.3%
Dependent repos count: 60.0%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/test_linux.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
pyproject.toml pypi
setup.py pypi