Skip to main content

Python bindings for IQTree

Project description

piqtree

PyPI Version Python Version License

CI Coverage Status Documentation Status Ruff

piqtree (pronounced 'pie-cue-tree') is a library which allows you to use IQ-TREE directly from Python! The interface with Python is through cogent3 objects. For usage, please refer to the documentation or the examples below.

If you encounter any problems or have any feature requests feel free to raise an issue!

Contributing

If you would like to help out by contributing to the piqtree project, please check out our contributor guide!

Examples

Phylogenetic Reconstruction

from piqtree import build_tree
from cogent3 import load_aligned_seqs # Included with piqtree!

# Load Sequences
aln = load_aligned_seqs("tests/data/example.fasta", moltype="dna")
aln = aln.take_seqs(["Human", "Chimpanzee", "Rhesus", "Mouse"])

# Reconstruct a phylogenetic tree with IQ-TREE!
tree = build_tree(aln, "JC", rand_seed=1) # Optionally specify a random seed.

print("Tree topology:", tree) # A cogent3 tree object
print("Log-likelihood:", tree.params["lnL"])
# In a Jupyter notebook, try tree.get_figure() to see a dendrogram

Note See the cogent3 docs for examples on what you can do with cogent3 trees.

Fit Branch Lengths to Tree Topology

from piqtree import fit_tree
from cogent3 import load_aligned_seqs, make_tree

# Load Sequences
aln = load_aligned_seqs("tests/data/example.fasta", moltype="dna")
aln = aln.take_seqs(["Human", "Chimpanzee", "Rhesus", "Mouse"])

# Construct tree topology
tree = make_tree("(Human, Chimpanzee, (Rhesus, Mouse));")

# Fit branch lengths with IQ-TREE!
tree = fit_tree(aln, tree, "JC")

print("Tree with branch lengths:", tree)
print("Log-likelihood:", tree.params["lnL"])

More

For more examples ranging from using ModelFinder and AliSim, to making rapid neighbour-joining trees, or randomly generated trees be sure to check out the documentation!

Citation

Please cite

@article{10.1093/molbev/msag061,
  author    = {McArthur, Robert Neil and Wong, Thomas King-Fung and Lang, Yapeng and Morris, Richard Andrew and Caley, Katherine and Mallawaarachchi, Vijini and Minh, Bui Quang and Huttley, Gavin},
  title     = {piqtree: A Python Package for Seamless Phylogenetic Inference with IQ-TREE},
  journal   = {Molecular Biology and Evolution},
  year      = {2026},
  pages     = {msag061},
  doi       = {10.1093/molbev/msag061},
  url       = {https://doi.org/10.1093/molbev/msag061},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

piqtree-0.8.2-cp314-cp314-win_amd64.whl (6.9 MB view details)

Uploaded CPython 3.14Windows x86-64

piqtree-0.8.2-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

piqtree-0.8.2-cp314-cp314-macosx_15_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.14macOS 15.0+ ARM64

piqtree-0.8.2-cp313-cp313-win_amd64.whl (6.8 MB view details)

Uploaded CPython 3.13Windows x86-64

piqtree-0.8.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

piqtree-0.8.2-cp313-cp313-macosx_15_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

piqtree-0.8.2-cp312-cp312-win_amd64.whl (6.8 MB view details)

Uploaded CPython 3.12Windows x86-64

piqtree-0.8.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

piqtree-0.8.2-cp312-cp312-macosx_15_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

File details

Details for the file piqtree-0.8.2-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: piqtree-0.8.2-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 6.9 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for piqtree-0.8.2-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 a96454e5aa639e8495997f332e2233c2ec037a74397e7e778a59fa00585b2331
MD5 6a2c4581a589405387c4a1d4a5d63198
BLAKE2b-256 905d8ffd637c2adc55902069209e7fcec2ea8fe82b9091a34ca708a52e9bec4b

See more details on using hashes here.

Provenance

The following attestation bundles were made for piqtree-0.8.2-cp314-cp314-win_amd64.whl:

Publisher: release.yml on iqtree/piqtree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file piqtree-0.8.2-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for piqtree-0.8.2-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a3de59fd6cf615e1e716b1c5b5228de0f3026783ba543c28c8afeb04bad2b628
MD5 342027fa3fa3114efb5d5ef780280224
BLAKE2b-256 89c67aca12ebf707601b1a22c9796b2ae0b8cb0705637e347934d66d085bbcf7

See more details on using hashes here.

Provenance

The following attestation bundles were made for piqtree-0.8.2-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on iqtree/piqtree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file piqtree-0.8.2-cp314-cp314-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for piqtree-0.8.2-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d88d0ee706a4df7441f5af7db9d7d8adc095245a4aeee7acea67b37c0dcdb401
MD5 52f32a9d2570f319d109ca57d906bfc2
BLAKE2b-256 2b68ab109c24a45fc0c157e037503ff4d3d37d1f813d9f36d9ffae40ea58cd6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for piqtree-0.8.2-cp314-cp314-macosx_15_0_arm64.whl:

Publisher: release.yml on iqtree/piqtree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file piqtree-0.8.2-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: piqtree-0.8.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 6.8 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for piqtree-0.8.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 8bb251e37768778c5b6cce21a1b74d012abce1035d383cd2ddbfabcec65d0274
MD5 f80069ef0d8a34061ba9f1ad5244d6bf
BLAKE2b-256 64ba7c0ae6cf9d8e06dea0aa22fa9d11cb123109df29035ecb116d5bddf27372

See more details on using hashes here.

Provenance

The following attestation bundles were made for piqtree-0.8.2-cp313-cp313-win_amd64.whl:

Publisher: release.yml on iqtree/piqtree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file piqtree-0.8.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for piqtree-0.8.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7e56623c69dae4731ee506b7204c2d486aa7a9296703387dc45ce49b0749ace1
MD5 15ed78d899c04a39dc075b8c06300131
BLAKE2b-256 b8aab07d05f5a41fceb2e7afa3469a3c25555b49852986901960e76dd1e8d2fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for piqtree-0.8.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on iqtree/piqtree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file piqtree-0.8.2-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for piqtree-0.8.2-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 ded187d893f22f46d539f180ff2442081ef61ab77f07155723478a4e11db0653
MD5 1afaa18fe2de9e9f3295992fcbb81aae
BLAKE2b-256 7881ab661010c424de8f4b96584d5d11304a59eac314cdea5379af24fdc76007

See more details on using hashes here.

Provenance

The following attestation bundles were made for piqtree-0.8.2-cp313-cp313-macosx_15_0_arm64.whl:

Publisher: release.yml on iqtree/piqtree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file piqtree-0.8.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: piqtree-0.8.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 6.8 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for piqtree-0.8.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5eff4fafa51ea8c4fdc70ced1f2b6b2028b461a46ada8feb4021e71be022ee2c
MD5 a12b6f3506f91baf767adfe2133ed488
BLAKE2b-256 d785314361a8cdc979364d4863b7adca5e0f6dc6f93c74e1fda5876d22f5c020

See more details on using hashes here.

Provenance

The following attestation bundles were made for piqtree-0.8.2-cp312-cp312-win_amd64.whl:

Publisher: release.yml on iqtree/piqtree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file piqtree-0.8.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for piqtree-0.8.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 470701256212dff1b6e9dfcfbe53ce705f2c6843c5a6342dcfd6a91d2c0a5b49
MD5 47596d89d3d330341e35e2003da21329
BLAKE2b-256 f523d3f74751760a22e19ab8e3be24064473e6544497b0a21bf279a82ed0319f

See more details on using hashes here.

Provenance

The following attestation bundles were made for piqtree-0.8.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on iqtree/piqtree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file piqtree-0.8.2-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for piqtree-0.8.2-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 573643bf077af791aa425d84e07a5ab8b177a31d91e72d792f8cce0e4eb82d0f
MD5 1933d1874692c17e7e8c27c30c176be4
BLAKE2b-256 c6558dfd9cd0674475fac1940085e230dd1fa2b77388138c9187666f47e0f2b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for piqtree-0.8.2-cp312-cp312-macosx_15_0_arm64.whl:

Publisher: release.yml on iqtree/piqtree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page