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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 15.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

piqtree-0.8.1-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.1-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.1-cp314-cp314-win_amd64.whl.

File metadata

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

File hashes

Hashes for piqtree-0.8.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 d4aca65b70b675c60f5b5388a3656ca18124fdd53e80d8d5b2f49102ecf6db2d
MD5 1c6b722b085c9f6baf4d8bc252c02767
BLAKE2b-256 e6367322141921bc463a48aac90ec5cfb6ca1926441324d42e56b7f36e95ac4a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for piqtree-0.8.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 94de8f2cb52ce4ffe7d4b0454a55f9d9a7993da0720163ddb2eeaaf06e2e487e
MD5 61ca06b789d5147cf0b6cdb192b1b784
BLAKE2b-256 39fc9d8842fc16e33482f54b59ca9dc56b3a2f60c7ee32b977b16775297b5dad

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for piqtree-0.8.1-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 bc54dcd04a1b19dc4e9825ffd47ff9bd77901cd7e1d599a74d4db50983447bab
MD5 38011b9a98d57742154681244ed52728
BLAKE2b-256 943a0b6a7a3732aaf68431bdced98a387214321a55df133ec3780a0adfd090a7

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: piqtree-0.8.1-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.7

File hashes

Hashes for piqtree-0.8.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 9673e7bb2979e8074c88b2aea2c7caf496a53d862658cfdf5f8c1f520883b235
MD5 70de9f30abaa0aa3649bcf351ac2c23c
BLAKE2b-256 be7151874b731049c6db0c6316c514ac9ee3627f66a374bd1a5af440bc80e169

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for piqtree-0.8.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 02fef23a00dd543ed1695d3fb27708e2a7b323725d3c9656b21682c7ddeef204
MD5 d37c7c4d125d61ad576b8c6f30f9488d
BLAKE2b-256 952399d2817dadd5f2f7fdc47e44f701d46c80167579759cbe24ddf7452a2141

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for piqtree-0.8.1-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d5f35e28dbf924f2a731204bd8324a2221880737c66953f78ef5fdc9d5a73557
MD5 7526a17f7a2d73a4551370adcd5f39c5
BLAKE2b-256 728e3bc51f49b921fdaf8e15afc91b7f7a22ca6848b715e7abf74641841f2b42

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: piqtree-0.8.1-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.7

File hashes

Hashes for piqtree-0.8.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c4881b51f0479ce482e4fd2cc1e8eca00195dcb63710e8882fa8b8dac0c890aa
MD5 d3ff6b2f19d40e593976d4533ef3b5ae
BLAKE2b-256 fed10290dc6b191e183401f32f040befdd3d6f086a214bb2d90bc65cf1e49352

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for piqtree-0.8.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5223bc17badd885d5abcee413f6c8ee0795610150463dd191b31f12d123d8344
MD5 d1f347e082249182b9bfe899457667fa
BLAKE2b-256 14e7e545fc867c48eeec6c7f5c563f9b3d217fa1d78456d73771b0e69970b474

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for piqtree-0.8.1-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 b3e32ad6e44db209e387ce92e196a4cc3c544cdb1bc6fdc41f65fd5bca8313d2
MD5 2e6c6ad933687b72370ce65e3fbefc42
BLAKE2b-256 3d8d6088b6182e978981f9db62f955caad7f0574b2fb31c73a0051122ddbf0bc

See more details on using hashes here.

Provenance

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