transform_tree
Edit a tree that is already built — re-root it (at its midpoint, on an outgroup, or remove the root), prune taxa away or down to a set, ladderize it, or collapse branches that are too weakly supported or too short to believe. Pruning the TREE keeps the branch lengths estimated from the full alignment, which is a different answer from rebuilding without those taxa.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| taxa | No | tip labels — the outgroup for a re-root, or the taxa to keep/remove for a prune. Only applies when operation is reroot-outgroup or prune-keep or prune-remove. | |
| _files | No | The project: record references shaped like _subject. Their records become library documents a tool names in sequences/parts/document; a trace or alignment is found by file name. | |
| newick | Yes | the tree to edit — wire `newick` from build_tree, or paste one. | |
| _subject | No | The record to act on: exactly one of sequence, accession (+source), sample (an id from list_samples) or file ({name, text} or {name, base64}); record_index picks one record of several. | |
| position | No | where along the outgroup edge the root lands, 0 = at the outgroup, 1 = at its sister. Only applies when operation is reroot-outgroup. Advanced. | |
| ascending | No | ladderize small clades first, rather than large. Only applies when operation is ladderize. | |
| operation | No | what to do to the tree. Values: reroot-midpoint (Re-root at the midpoint), reroot-outgroup (Re-root on an outgroup), unroot (Remove the root (unroot)), prune-keep (Prune down to these taxa), prune-remove (Prune these taxa away), ladderize (Ladderize (presentation only)), collapse (Collapse weak or short branches). | reroot-midpoint |
| max_length | No | collapse any branch shorter than this (0 = do not). Only applies when operation is collapse. | |
| min_support | No | contract any branch whose support is below this (0 = do not). Only applies when operation is collapse. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| newick | Yes | the edited tree | |
| tipCount | Yes | tips remaining — the number to check after a prune | |
| statistics | Yes | statistics RE-DERIVED for the edited tree, because rerooting or pruning changes them and the previous numbers beside a changed tree would be wrong. Absent for `ladderize`, which only reorders tips and changes no statistic |