Tree space visualization
Visualize gene tree topology space via MDS, t-SNE, UMAP, or clustered distance heatmap
Command identity
- Canonical command:
tree_space- Handler:
tree_space- Aliases:
tree_landscape, tspace
- Standalone executables:
pk_tree_space, pk_tree_landscape, pk_tspace
- Categories:
Tree comparison & consensus
Runtime interface
Synopsis
phykit tree_space --trees <trees> --output <output> [--metric <metric>] [--method <method>] [--species-tree <species_tree>] [--k <k>] [--seed <seed>] [--heatmap] [--distance-matrix <distance_matrix>] [--fig-width <fig_width>] [--fig-height <fig_height>] [--dpi <dpi>] [--no-title] [--title <title>] [--legend-position <legend_position>] [--ylabel-fontsize <ylabel_fontsize>] [--xlabel-fontsize <xlabel_fontsize>] [--title-fontsize <title_fontsize>] [--axis-fontsize <axis_fontsize>] [--colors <colors>] [--ladderize] [--cladogram] [--circular] [--color-file <color_file>] [--json]
Arguments
This table is generated from the live command parser. It is the authoritative source for accepted spellings, required arguments, types, defaults, and choices.
Argument |
Required |
Type |
Default |
Choices |
|---|---|---|---|---|
|
true |
str |
required |
any |
|
true |
str |
required |
any |
|
false |
str |
rf |
rf, kf |
|
false |
str |
mds |
mds, tsne, umap |
|
false |
str |
none |
any |
|
false |
int |
none |
any |
|
false |
int |
none |
any |
|
false |
boolean |
false |
any |
|
false |
str |
none |
any |
|
false |
float |
none |
any |
|
false |
float |
none |
any |
|
false |
int |
300 |
any |
|
false |
boolean |
false |
any |
|
false |
str |
none |
any |
|
false |
str |
none |
any |
|
false |
float |
none |
any |
|
false |
float |
none |
any |
|
false |
float |
none |
any |
|
false |
float |
none |
any |
|
false |
str |
none |
any |
|
false |
boolean |
false |
any |
|
false |
boolean |
false |
any |
|
false |
boolean |
false |
any |
|
false |
str |
none |
any |
|
false |
boolean |
false |
any |
Output and errors
--json provides the command's structured JSON representation. Output-file options: --output. Invalid command syntax exits with status 2. Input
validation and scientific limitations are described in the guidance below.
Guidance, interpretation, and examples
Visualize how gene trees cluster in topology space by computing pairwise distances (Robinson-Foulds or Kuhner-Felsenstein) and projecting into 2D via MDS, t-SNE, or UMAP. Points are colored by spectral clustering with automatic cluster detection via the eigengap heuristic.
Alternatively, use --heatmap to draw a clustered distance heatmap
with a dendrogram showing hierarchical relationships among gene trees.
Use --distance-matrix to export the raw pairwise distance matrix
as a CSV file.
Optionally highlight a species tree as a distinct marker to see where it sits relative to the gene tree cloud.
phykit tree_space -t <trees> -o <output>
[--metric rf|kf] [--method mds|tsne|umap]
[--species-tree <file>] [--k <int>] [--seed <int>]
[--heatmap] [--distance-matrix <file>]
[--fig-width <float>] [--fig-height <float>] [--dpi <int>] [--no-title] [--title <str>]
[--legend-position <str>] [--ylabel-fontsize <float>] [--xlabel-fontsize <float>]
[--title-fontsize <float>] [--axis-fontsize <float>] [--colors <str>] [--ladderize] [--cladogram] [--circular] [--color-file <file>] [--json]
Options:
-t/--trees: file with gene trees (one Newick per line, or one file path per line) (required)
-o/--output: output figure path (.png, .pdf, .svg) (required)
--metric: distance metric: rf (normalized Robinson-Foulds, default) or kf (Kuhner-Felsenstein)
--method: dimensionality reduction: mds (default), tsne, or umap
--species-tree: optional species tree to highlight in the plot as a star marker
--k: number of clusters (auto-detected via eigengap if omitted)
--seed: random seed for reproducibility (t-SNE/UMAP)
--heatmap: draw a clustered distance heatmap instead of a scatter plot
--distance-matrix: output the pairwise distance matrix as a CSV file
--json: optional argument to print results as JSON