generate_offsets.RdComputes cumulative genomic positions for coverage data and variant calls by calculating chromosome offsets.
generate_offsets(coverage_data, variant_calls)A list with two elements:
coverage_dataThe input coverage data augmented with a column
cumulative_genomic_position.
variant_callsThe input variant calls augmented with columns
cumulative_start and cumulative_end.
The function filters for valid chromosomes (chr1 - chr22, X, Y), calculates the maximum
end of each chromosome as a proxy for its length, and uses the cumulative sum of chromosome
lengths to determine an offset for each chromosome. It then adds this offset to the start of
each interval to obtain a cumulative genomic position.