Alignment subsampling

Randomly subsample genes, partitions, or sites

Command identity

Canonical command:

alignment_subsample

Handler:

alignment_subsample

Aliases:

aln_subsample, subsample

Standalone executables:

pk_alignment_subsample, pk_aln_subsample, pk_subsample

Categories:

Alignment & dataset utilities

Runtime interface

Synopsis

phykit alignment_subsample --mode <mode> [--alignment <alignment>] [--list <list>] [--partition <partition>] [--number <number>] [--fraction <fraction>] [--seed <seed>] [--bootstrap] [--output <output>] [--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

--mode

true

str

required

genes, partitions, sites

-a, --alignment

false

str

none

any

-l, --list

false

str

none

any

-p, --partition

false

str

none

any

--number

false

int

none

any

--fraction

false

float

none

any

--seed

false

int

none

any

--bootstrap

false

boolean

false

any

-o, --output

false

str

subsampled

any

--json

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

Randomly subsample genes, partitions, or sites from phylogenomic datasets. Supports three modes:

  • genes: Given a file listing alignment paths, randomly select N of them.

  • partitions: Given a supermatrix + RAxML-style partition file, randomly select N partitions and extract their columns into a new alignment.

  • sites: Given a single alignment, randomly select N columns.

Sampling can be without replacement (default, for jackknife-style tests) or with replacement using --bootstrap (for gene/site bootstrapping). Use --seed for reproducibility.

# Subsample 50 genes from a list of 200
phykit alignment_subsample --mode genes -l gene_list.txt --number 50 -o sub50

# Subsample 50% of partitions from a supermatrix
phykit alignment_subsample --mode partitions -a concat.fa -p concat.partition \
    --fraction 0.5 --seed 42 -o sub50pct

# Bootstrap-resample sites from an alignment
phykit alignment_subsample --mode sites -a alignment.fa \
    --number 500 --bootstrap --seed 1 -o boot1

Options:
--mode: subsampling mode: genes, partitions, or sites (required)
-a/--alignment: input alignment file in FASTA format (required for partitions and sites modes)
-l/--list: file listing alignment paths, one per line (required for genes mode)
-p/--partition: RAxML-style partition file (required for partitions mode)
--number: exact number of items to select (mutually exclusive with --fraction)
--fraction: fraction of items to select, 0.0 to 1.0 (mutually exclusive with --number)
--bootstrap: sample with replacement (default: without replacement)
--seed: random seed for reproducibility
-o/--output: output file prefix (default: subsampled)
--json: optional argument to print results as JSON