Independent contrasts (PIC)

Felsenstein's phylogenetically independent contrasts

Command identity

Canonical command:

independent_contrasts

Handler:

independent_contrasts

Aliases:

phylo_contrasts, pic

Standalone executables:

pk_independent_contrasts, pk_phylo_contrasts, pk_pic

Categories:

Trait evolution

Runtime interface

Synopsis

phykit independent_contrasts --tree <tree> --trait_data <trait_data> [--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

-t, --tree

true

str

required

any

-d, --trait_data

true

str

required

any

--json

false

boolean

false

any

Output and errors

--json provides the command's structured JSON representation. Unless the guidance below states otherwise, results are emitted as command output. Invalid command syntax exits with status 2. Input validation and scientific limitations are described in the guidance below.

Guidance, interpretation, and examples

Compute Felsenstein's (1985) phylogenetically independent contrasts for a continuous trait on a phylogeny. Each internal node yields one standardized contrast, producing n-1 contrasts for n tips. Multifurcations are automatically resolved.

Cross-validated against R's ape::pic(). The sum of squared contrasts matches R exactly.

phykit independent_contrasts -t <tree> -d <trait_data> [--json]

Options:
-t/--tree: tree file (required)
-d/--trait_data: trait data file, two columns: taxon<tab>value (required)
--json: optional argument to print results as JSON

R validation: Validated against ape in R (see tests/r_validation/validate_pic.R).