Skip to main content

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},
}

Metadata

Release files for piqtree 0.8.4

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

Built distributions (wheels)

Table of built distributions (wheels) for piqtree 0.8.4
File Actions
piqtree-0.8.4-cp313-abi3-win_amd64.whl CPython 3.13 abi3 Windows x86-64 Details for piqtree-0.8.4-cp313-abi3-win_amd64.whl
piqtree-0.8.4-cp313-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 abi3 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for piqtree-0.8.4-cp313-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
piqtree-0.8.4-cp313-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.13 abi3 Linux glibc 2.26+ ARM64, Linux glibc 2.28+ ARM64 Details for piqtree-0.8.4-cp313-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
piqtree-0.8.4-cp313-abi3-macosx_15_0_arm64.whl CPython 3.13 abi3 macOS 15.0+ ARM64 Details for piqtree-0.8.4-cp313-abi3-macosx_15_0_arm64.whl

Total release size: 17.8 MB

Release files / piqtree-0.8.4-cp313-abi3-win_amd64.whl

Download URL piqtree-0.8.4-cp313-abi3-win_amd64.whl
Size 7.1 MB
Tags CPython 3.13 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
19c14e9420568e954462f6ab7d1fbe2fc03530f40d47fb0f48a67af12cfb9848
BLAKE2b-256 checksum
How to use checksums
b7c0b10f6e3ba71c7b86157170dfcbbadb78b5acf92339bf7ee7ba42f055565d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / piqtree-0.8.4-cp313-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL piqtree-0.8.4-cp313-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 3.9 MB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
4aa8b203fb15130224f4439e31576929bf508a6ba3eedd6991f7a77950d031e3
BLAKE2b-256 checksum
How to use checksums
fa20c34810dcd2dd014baeb2fc3ee82bb4ec864871f3ad26f2108e811569f7ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / piqtree-0.8.4-cp313-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL piqtree-0.8.4-cp313-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 3.3 MB
Tags CPython 3.13 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
e2960cd3784bd43709e755d7dc6f952e279d7ecde364414db9a1fcde2c278ed8
BLAKE2b-256 checksum
How to use checksums
01f4707b2783c743e4fa460b111187cc779e542096007ef155feee087cc052fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / piqtree-0.8.4-cp313-abi3-macosx_15_0_arm64.whl

Download URL piqtree-0.8.4-cp313-abi3-macosx_15_0_arm64.whl
Size 3.5 MB
Tags CPython 3.13 abi3 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
97ba2ec01bb16519160539d8f43d081df1b4b0e8c939dbfa793ad9d0853ef1a2
BLAKE2b-256 checksum
How to use checksums
8167d3c5b4233c1318ceb0771d804e652f3677911523a7b11bf7983161775e4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Security for piqtree 0.8.4

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.

Full provenance

All 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for piqtree-0.8.4-cp313-abi3-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

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