Expand description
Shift BED coordinates by a fixed offset.
Each record’s start and end are shifted by shift (positive = right,
negative = left). When a genome-sizes file is provided, coordinates are
clamped to [0, chrom_size). Records that shift entirely off a chromosome
end are dropped (matching bedtools shift behaviour).
Strand-aware mode (-p/-m): shift by plus_shift when strand column is
+, by minus_shift when -, else by the general shift.
BED header/track/browser lines pass through unchanged.
Functions§
- load_
genome - Load genome sizes file into a
chrom → sizemap. Each non-comment line ischrom<TAB>size. - shift
- Shift BED file at
path. - shift_
reader - Shift BED records from
readerbyshiftbases, write tooutput. - shift_
stdin - Same as
shiftbut reads from stdin.