Expand description
Split a BED file into N approximately equal parts.
Two algorithms (matching bedtools split v2.31.1):
size (default) — greedy bin-packing: sort records by interval length descending, assign each to the bin currently holding the fewest bases. Within each output file, records appear in descending length order (the processing order). Produces output files whose total base-pair content is balanced.
simple — round-robin: records are routed to files 1, 2, …, N, 1, 2, … in input order. Records within each file preserve input order. Produces files with approximately equal record counts.
Output files are written to <prefix>.NNNNN.bed (zero-padded to 5 digits).
A summary line <filename>\t<bases>\t<records> is written to stderr for
each output file, matching bedtools’ exact format.
Complexity: O(N) for simple; O(R log F) for size where R is record
count and F is the number of output files (min-heap over F bins).
Enums§
Functions§
- split
- Split
inputBED intonfiles with the givenprefix.