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.3-cp314-cp314-win_amd64.whl (14.0 MB view details)

Uploaded CPython 3.14Windows x86-64

piqtree-0.8.3-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.3-cp314-cp314-macosx_15_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.14macOS 15.0+ ARM64

piqtree-0.8.3-cp313-cp313-win_amd64.whl (13.6 MB view details)

Uploaded CPython 3.13Windows x86-64

piqtree-0.8.3-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.3-cp313-cp313-macosx_15_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

piqtree-0.8.3-cp312-cp312-win_amd64.whl (13.6 MB view details)

Uploaded CPython 3.12Windows x86-64

piqtree-0.8.3-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.3-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.3-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: piqtree-0.8.3-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 14.0 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.3-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 326b07cf80d50827e3c8d8738dc70d595be96210b49198e5582e75c1e99ae3b9
MD5 12caa434f7e3b709919638d692bef8ba
BLAKE2b-256 292e2c6acab1f0febe6008398dd0cba549f85c3c00f4c900b633dd6233930b66

See more details on using hashes here.

Provenance

The following attestation bundles were made for piqtree-0.8.3-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.3-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for piqtree-0.8.3-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 11710b1d63fc8698e341ce09b8e5ffb4f3eaece11a5dddef75891ff07b67e5c0
MD5 2a871366ce6beb2029e80d15c828965c
BLAKE2b-256 10169331c609767dcaf536d0f2618aecec5e50df543e5a66f2c72b69535a39bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for piqtree-0.8.3-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.3-cp314-cp314-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for piqtree-0.8.3-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 6bfa46a0f1cb5cd6e43152587be41d8afe610fcf7ec194f93b5a92e2fba688d4
MD5 bcb7102b85bc48ea40c6417f94d8b6f6
BLAKE2b-256 25dbcd4862c2e373057031fe61ad1b203c018456000d003834013253a420194a

See more details on using hashes here.

Provenance

The following attestation bundles were made for piqtree-0.8.3-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.3-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: piqtree-0.8.3-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 13.6 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.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 fe67aff50bbef79475b29b6dcf58aab0890edbebf0be4367beb8a917df99cd85
MD5 b827aaef525459c5a1cf3d717d68a031
BLAKE2b-256 9a45762f8b598cba45b736454834c8c744cb0536ee4f8d6c8d8a2276bb043d27

See more details on using hashes here.

Provenance

The following attestation bundles were made for piqtree-0.8.3-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.3-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for piqtree-0.8.3-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cd4338f3529e8e122cd8576e3e5be0333ed0e2fd8f8fe979371feb6234ed9bb3
MD5 c79449ba34de47ad353c65676d309e40
BLAKE2b-256 5cfda3f03cf8597946fd860874ee9c8565bfd9f51261e4363595b99a4198a042

See more details on using hashes here.

Provenance

The following attestation bundles were made for piqtree-0.8.3-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.3-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for piqtree-0.8.3-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 f74900c18a444c3ff82599399469fba65200f1b235a29b904066b168698608c1
MD5 6560d689b7c69c7b51e787166db6681b
BLAKE2b-256 4bdcfc8c8c4ba0314935ce3e178516a210647a5c1bb7c035730245740ec50ab7

See more details on using hashes here.

Provenance

The following attestation bundles were made for piqtree-0.8.3-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.3-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: piqtree-0.8.3-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 13.6 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.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0b6629d41b030759646ad6634dfb1a8ead5b6c566ac58f77ca9c6fca4b1122a2
MD5 dcc29f1c76f35d817cc2f72bbee49990
BLAKE2b-256 71641e85db2cdfd0985928f2a60da92617ede54fe906090e155d68d079696156

See more details on using hashes here.

Provenance

The following attestation bundles were made for piqtree-0.8.3-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.3-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for piqtree-0.8.3-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 85602a100e56215a9acdfb54b90f8a32313b3775300f57365e72655acb5a6503
MD5 ddb6d4c72645ee0fa6c15046319c6363
BLAKE2b-256 4a80ceb94ebd900d9f755cd260dba07c6728b5f5eac8c8fb15f4778cff378b24

See more details on using hashes here.

Provenance

The following attestation bundles were made for piqtree-0.8.3-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.3-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for piqtree-0.8.3-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 95321deaf4d49019c86c0e4ddd128fccda4a12b056ed5798c0bc498d90258a71
MD5 c60fe567cd5ebbd1ef9ce8db494740df
BLAKE2b-256 524296a5e9301277b41ac18b0ae00c5b7e0e53978312e32e6a61738c702f638f

See more details on using hashes here.

Provenance

The following attestation bundles were made for piqtree-0.8.3-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