Trait correlation
Phylogenetic correlations between all pairs of traits with heatmap visualization
Command identity
- Canonical command:
trait_correlation- Handler:
trait_correlation- Aliases:
phylo_corr, trait_corr
- Standalone executables:
pk_trait_correlation, pk_phylo_corr, pk_trait_corr
- Categories:
Phylogenetic signal
Runtime interface
Synopsis
phykit trait_correlation --tree <tree> --trait-data <trait_data> --output <output> [--alpha <alpha>] [--cluster] [--gene-trees <gene_trees>] [--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 |
|
true |
str |
required |
any |
|
false |
float |
0.05 |
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
Compute phylogenetic correlations between all pairs of traits and display them as a heatmap with significance indicators.
Uses GLS-centering via the tree's variance-covariance matrix to account for phylogenetic non-independence among species. P-values are computed from the t-distribution and displayed as significance stars on the heatmap cells:
***p < 0.001**p < 0.01*p < alpha (default 0.05)
The multi-trait input file should be tab-delimited with a header row:
taxon<tab>trait1<tab>trait2<tab>...
At least 2 traits are required. Lines starting with '#' are treated as
comments. If the tree and trait file have different taxa, the intersection
is used and warnings are printed to stderr.
The --cluster option clusters traits by correlation similarity
(using 1 - |r| as distance) and draws dendrograms alongside the
heatmap.
phykit trait_correlation -t <tree> -d <trait_data> -o <output>
[--alpha 0.05] [--cluster] [-g <gene_trees>] [--json]
[--fig-width <float>] [--fig-height <float>] [--dpi <int>]
[--no-title] [--title <str>]
Options:
-t/--tree: a tree file in Newick format
-d/--trait-data: tab-delimited multi-trait file with header row (at least 2 traits)
-o/--output: output figure path (supports .png, .pdf, .svg)
--alpha: significance threshold for marking p-values (default: 0.05)
--cluster: cluster traits by correlation similarity and display dendrograms
-g/--gene-trees: optional multi-Newick file of gene trees for discordance-aware VCV
--json: optional argument to print results as JSON