This skill edits the structure of an existing phylogenetic tree: rooting, pruning/subsetting, extracting clades or induced subtrees, collapsing branches into polytomies, resolving polytomies, and ladderizing. The idea that matters most is that rooting is not editing; it is a separate statistical inference and the highest-error decision in the whole tree. Most inference returns an unrooted tree, so placing the root is what creates every ancestor/descendant claim, every "basal" lineage, and every character polarity, and the deep nodes near an outgroup-defined root are the least trustworthy part of the figure. The other operations are comparatively mechanical but each carries a silent trap: pruning can corrupt every patristic distance, collapsing by support produces uncertainty (soft) polytomies that are not radiations, and ladderizing can manufacture an apparent evolutionary trend that the data do not contain.
pip install biopython # Bio.Phylo (primary)
pip install dendropy ete3 # annotation-aware / NHX alternatives
# R: install.packages(c('ape','phangorn','phytools'))
# CLI (optional): Newick Utilities (nw_reroot, nw_prune); MAD, MinVar-Rooting (FastRoot.py), RootDigger for outgroup-free / likelihood rooting
Conceptual prerequisites: a tree object (from tree-io), an understanding that branch support is not root confidence, and a priori knowledge of which taxa are outgroups when outgroup rooting is intended.
Tell your AI agent what you want to do: - "Root this tree using OutA and OutB as the outgroup and check ingroup monophyly" - "Root at the midpoint, but warn me if this tree is not clock-like" - "Prune everything except the primates and keep the branch lengths correct" - "Collapse branches with bootstrap below 70 into polytomies"
"Root this tree with OutA and OutB as outgroups, but tell me if they are not monophyletic"
"I have no outgroup and the tree is deep with rate variation: root it with MAD and MinVar and tell me if they agree"
"Is this tree rooted, and how reliable is the root placement?"
"Remove all the bacterial taxa and confirm the patristic distances are unchanged"
"Give me the tree restricted to just these eight taxa, even though they are not a clade"
"Extract the mammal clade as a self-contained subtree"
"Collapse all branches with UFBoot2 below 95 into polytomies"
"Collapse the zero-length branches but leave the real short branches alone"
"I need a fully binary tree for a downstream method: resolve the polytomies and warn me about the bias"
"Ladderize the tree for the figure, and confirm this changes no biology"
drop.tip and Bio.Phylo prune are correct by default; ete3 prune needs preserve_branch_length=True).