Skip to main content

Crate rsomics_bed_shift

Crate rsomics_bed_shift 

Source
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 → size map. Each non-comment line is chrom<TAB>size.
shift
Shift BED file at path.
shift_reader
Shift BED records from reader by shift bases, write to output.
shift_stdin
Same as shift but reads from stdin.