Skip to content

Getting started

Requirements

  • Python 3.10 or later
  • A rooted tree in Newick format

Install

pip install phytclust

From source:

git clone https://github.com/schwarzlab-ccb/PhytClust.git
cd PhytClust
pip install -e ".[dev]"

Confirm the install with phytclust --version.

First run

Cluster the bundled sample tree into five groups:

phytclust examples/sample_tree.nwk --k 5 --save-fig --out-dir results/quickstart

results/quickstart/ then contains:

  • phytclust_results.tsv — which leaf is in which cluster
  • tree_k5.png — the tree coloured by cluster, one colour per clade
  • scores.png — the score-versus-k curve

When k is unknown

--top-n 3 returns the best few k values; --resolution returns one k per scale. The CLI tutorial covers both.

Rooting

PhytClust requires a rooted tree. An unrooted tree can be rooted at run time:

phytclust tree.nwk --k 5 --root-taxon "species_A"   # on a named taxon
phytclust tree.nwk --k 5 --root-taxon midpoint      # midpoint rooting

To drop a taxon before clustering rather than root on it, use --outgroup.

Web GUI (experimental)

pip install "phytclust[gui]"
phytclust gui

This opens http://127.0.0.1:8000, where a Newick string can be pasted and explored interactively. Use the CLI or the Python API for reproducible analysis.

Next