Partitions the position variable (first column of input data frame) in windows of the size specified in window_size and computes the average signal (second column) in each partition. Most common use case is to compress the data for plotting.

compress_signal_track(df, window_size)

Arguments

df

Input signal track data as a data.frame with at least two columns:

  1. Numeric column with positions to partition

  2. Numeric column with values to average in each partition

No default.

window_size

Integer indicating the length (in bp) of the window (or partition) to average signal in. No default.

Examples

# NOT RUN {
compress_signal_track(df=signal_data, window_size=10)

compress_signal_track(chrI_signal, 100)
# }