October 2026
bpy-subsample - Retain regularly spaced lines from a text stream.
bpy-subsample [OPTIONS] [FACTOR] < INPUT > OUTPUT
Read text from standard input and write selected lines to standard output. Use this to thin a table or a tree sample containing one tree per line. Blank lines count as lines; the tool does not recognize multiline records. Use cut-range for sampled alignments or other records marked by iteration values.
Selection proceeds in this order: preserve an optional header, skip initial data lines, subsample the remaining lines, and stop at the output limit. The first data line after skipping is always selected unless the output limit is zero.
Keep the first tree and every tenth tree thereafter from a one-tree-per-line file:
bpy-subsample 10 < C1.trees > C1.thinned.trees
Preserve a table header, skip 100 data rows, then keep at most 500 rows spaced five rows apart:
bpy-subsample 5 --header --skip=100 --max=500 < C1.tsv > selected.tsv
Returns 0 on success (including help) and 1 on an error.
cut-range(1), stats-cat(1), statreport(1)
BAli-Phy online help: https://www.bali-phy.org/docs.php.
Please send bug reports to bali-phy-users@googlegroups.com.