Skip to main content

PhytClust takes a phylogenetic tree as input and outputs monophyletic leaf clusters that best fit the tree structure.

Project description

PhytClust

PhytClust logo

Monophyletic, dynamic-programming clustering of phylogenetic trees.

PhytClust finds clusterings of the leaves of a rooted tree such that every cluster is a monophyletic clade. It supports:

  • Exact k-way clustering (run(k=...))
  • Global peak search in k using a Calinski–Harabasz + Elbow 1 Index for validating cluster quality
  • Multi-resolution clustering: one representative k per log-spaced resolution bin
  • Polytomies, minimum cluster size constraints, support-aware branch lengths, outlier penalties and more!

Installation

1. Recommended: clean conda env + PyPI

conda create -n phyt_env python=3.10
conda activate phyt_env
pip install phytclust

2. Install from source

git clone https://bitbucket.org/schwarzlab/phytclust.git
cd phytclust
pip install -e .[dev]

Command-line usage

Exact k clusters

Compute an exact k-way clustering, plot it, and save PNG + CSV under ./results:

phytclust tree.nwk --k 5 --save-fig --out-dir results

Global clustering solution

Search for the top 3 Calinski–Harabasz + Elbow index peaks up to k = 200, save everything in ./out:

phytclust tree.nwk --top-n 3 \
  --max-k 200 \
  --save-fig \
  --out-dir out

Multi-resolution clustering

Pick one representative peak per 4 log-spaced bins of k, don’t show plots interactively, save all k-specific CSVs and plots:

phytclust tree.nwk --bins 4 \
  --no-plot \
  --save-all-k \
  --save-fig \
  --out-dir out

(See phytclust --help for the complete CLI.)

Please cite

Please cite this repository if you use the algorithm in your work:

K. Ganesan, E. Billard, T.L. Kaufmann, ____________________________ R.F. Schwarz, PhytClust, (2024), Bitbucket repository, https://bitbucket.org/schwarzlab/phytclust/


Project details


Download files

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

Source Distribution

phytclust-0.1.0.tar.gz (238.7 kB view details)

Uploaded Source

Built Distribution

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

phytclust-0.1.0-py3-none-any.whl (227.7 kB view details)

Uploaded Python 3

File details

Details for the file phytclust-0.1.0.tar.gz.

File metadata

  • Download URL: phytclust-0.1.0.tar.gz
  • Upload date:
  • Size: 238.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.12

File hashes

Hashes for phytclust-0.1.0.tar.gz
Algorithm Hash digest
SHA256 949c9039e653074e222589217bbf471a829d41763fb92686393ea792ae69878e
MD5 14ee12a725523562efa11c8602fba927
BLAKE2b-256 5a6d0dbbc238d7e7f9d04d73a8c82cebe54b663b7e9255b0d1ec547afc3d3456

See more details on using hashes here.

File details

Details for the file phytclust-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: phytclust-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 227.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.12

File hashes

Hashes for phytclust-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f0f332df80c25e97184971f3b6cf806774e33769e089e0a6fc1b0d0362e705a0
MD5 45bc42326c2b9a2df838bfe086749628
BLAKE2b-256 dbc0f5b3896782dd6f6e6172d2c79f5caf3d540ec8beeeafb676351b838a53dc

See more details on using hashes here.

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