Topology robustness

Compare support for three fixed quartet resolutions across assemblies or alignments of matched orthologous loci.

Command identity

Canonical command:

topology_robustness

Handler:

topology_robustness

Aliases:

none

Standalone executables:

pk_topology_robustness

Categories:

Tree comparison & consensus

Runtime interface

Synopsis

phykit topology_robustness --scores <scores> [--score-type <score_type>] --baseline <baseline> [--coordinates <coordinates>] [--min-margin <min_margin>] --output-prefix <output_prefix> [--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

--scores

true

string

required

any

--score-type

false

string

log-likelihood

log-likelihood, quartet-support

--baseline

true

string

required

any

--coordinates

false

string

none

any

--min-margin

false

float

0.0

any

--output-prefix, -o

true

string

required

any

--json

false

boolean

false

any

Output and errors

--json provides the command's structured JSON representation. Output-file options: --output-prefix. Invalid command syntax exits with status 2. Input validation and scientific limitations are described in the guidance below.

Guidance, interpretation, and examples

Inputs

Supply a tab-separated score table with these columns. Scores are total natural-log likelihoods, with larger values indicating a better fit. For each row, evaluate all three topologies on the same taxa and sites using the same model family and fitting protocol. Keep the topology order fixed across rows, for example AB|CD, AC|BD, and AD|BC.

gene_id      representation  sites   topology_1      topology_2      topology_3
locus1       assembly_a      100     -270    -280    -290
locus1       assembly_b      100     -282    -271    -291

Each gene and representation pair must be unique. Use zero sites and three blank score fields for a locus explicitly observed to have no usable data. An omitted row is recorded as missing when its counterpart exists. Use matching gene IDs for the same orthologous locus, ideally from the same specimen or haplotype. Generate scores with an upstream likelihood tool. For attribution, change one assembly or alignment choice at a time and check results on a shared orthologous site set.

phykit topology_robustness --scores quartet_scores.tsv --baseline assembly_a \
    --coordinates assembly_a bed genes.bed --output-prefix robustness --json

Optional coordinates use the same BED or TSV format as Topology landscape. They place loci on one reference coordinate system. Unmapped loci remain in the results with blank coordinates.

Outputs and interpretation

  • .scores.tsv contains the three input scores, the per-site contrasts of topologies 2 and 3 against topology 1, and the winning margin over the runner-up. A tie or a margin at or below --min-margin is unresolved. The default margin is zero.

  • .comparisons.tsv compares each representation with the named baseline. It records both site counts, topology changes, and changes in per-site contrasts (comparison minus baseline).

  • --json returns both tables and comparison status counts.

Margins are descriptive and the threshold is user-defined. Per-site normalization accounts for the number of scored sites. Differences in which sites were retained can still affect the comparison. A switch indicates sensitivity to the representations tested. Distinguishing introgression, incomplete lineage sorting, and other causes requires additional evidence.

Example with quartet support

Use --score-type quartet-support to compare support proportions for the same three resolutions. For example, supply normalized quartet concordance frequencies in a TSV.

gene_id      representation  sites   topology_1      topology_2      topology_3
locus1       assembly_a      100     0.60    0.25    0.15
locus1       assembly_b      80      0.30    0.55    0.15
phykit topology_robustness --score-type quartet-support \
    --scores quartet_support.tsv --baseline assembly_a --output-prefix robustness

Here the preferred topology switches from 1 to 2. The support difference between topology 2 and topology 1 changes from −0.35 to +0.25, a shift of 0.60. The site count records sequence availability and is not used to rescale proportions. The scores table reports margin in proportion units, so --min-margin 0.05 requires a lead greater than five percentage points. Use the same support estimator and denominator convention across representations. The command checks individual values are in [0, 1] and does not require them to sum to one, since the support estimator may leave some evidence unresolved.