Usage

PhyKIT provides 100+ functions for processing and analyzing multiple sequence alignments and phylogenies. Functions span alignment quality assessment, tree manipulation, phylogenetic comparative methods, trait evolution modeling, introgression detection, and more.

Some help messages indicate that summary statistics are reported (e.g., bipartition_support_stats). Summary statistics include mean, median, 25th percentile, 75th percentile, minimum, maximum, standard deviation, and variance. These functions typically have a verbose option that allows users to get the underlying data used to calculate summary statistics.


Quick start

Here is a typical workflow showing a few common PhyKIT operations:

# Check alignment quality
phykit pis alignment.fa                  # count parsimony informative sites
phykit aot alignment.fa --json           # flag outlier taxa

# Summarize tree properties
phykit treeness species.tre              # treeness (internal/total branch length)
phykit dvmc species.tre                  # degree of violation of a molecular clock

# Phylogenetic comparative methods
phykit pgls -t species.tre -d traits.tsv \
    --response brain_size --predictor body_mass   # PGLS regression
phykit panova -t species.tre \
    --traits traits.tsv --pairwise                # phylogenetic ANOVA

# Visualize gene tree concordance
phykit qpie -t species.tre -g gene_trees.nwk \
    -o concordance.png --branch-labels            # quartet pie chart

General usage

Calling functions

phykit <command> [optional command arguments]

Command specific help messages can be viewed by adding a -h/--help argument after the command. For example, to see the help message for the command 'treeness', execute:

phykit treeness -h
# or
phykit treeness --help

Function aliases

Each function comes with aliases to save the user some key strokes. For example, to get the help message for the 'treeness' function, you can type:

phykit tness -h

Command line interfaces

As of version 1.2.0, all functions (including aliases) can be executed using a command line interface that starts with pk_. For example, instead of typing the previous command to get the help message of the treeness function, you can type:

pk_treeness -h
# or
pk_tness -h

All possible function names are specified at the top of each function section.


Limiting threads

Every command accepts a global --threads option. It caps the number of worker processes PhyKIT starts and the number of threads used by numeric libraries (NumPy/SciPy BLAS, OpenMP, numba). This is useful when many PhyKIT commands run in parallel, for example in a workflow manager or with xargs -P, so that each command stays within its share of the CPUs:

phykit saturation -a alignment.fa -t tree.tre --threads 1
# or, for every command run from this shell
export PHYKIT_THREADS=1

--threads can appear anywhere on the command line, including before the command name, and works the same with the pk_ interfaces. When neither --threads nor PHYKIT_THREADS is set, PhyKIT keeps its default behavior. An explicit --threads value overrides OMP_NUM_THREADS and similar variables; PHYKIT_THREADS alone only sets those that are not already set.


Command reference

The complete reference is organized by task on the command reference page.

Legacy command anchors

These links preserve the command fragments used by earlier versions of the documentation.