Skip to contents

Peaks are splitted into smaller peaks if they are longer than target_size. The splitting is done by first checking if the peak has a length above very_long. If it does, the peak is splitted arbitrarily into chunks of size that is approximately very_long.
Then, the chunks are splitted into smaller chunks of approximately size target_size. This splitting is done by first finding the best offset to start from and then splitting the peaks into chunks of size target_size starting from that offset.
Detection of the best offset is done by substracting the mean of each interval from each coverage, removing values which became zero, and then correlating thr marginal coverage with simulated 'triangle' peaks starting at different offsets.

Usage

split_long_peaks(
  marginal_track,
  peaks,
  target_size = 500,
  max_peak_size = 1000,
  very_long = 5000,
  min_peak_size = NULL,
  window_size = target_size
)

Arguments

marginal_track

Name of the 'misha' track with the marginal coverage. You can create it using import_atac_marginal.

peaks

An intervals set with the peaks to split.

target_size

The target size of peaks.

max_peak_size

Peaks above this size would be splitted into smaller peaks.

very_long

Peaks above this size would be splitted arbitrarily into smaller peaks before fitting the best offset.

min_peak_size

Peaks below this size would be discarded.

window_size

Smoothing window size (from each side of the iterator) to use of the marginal track. Default: traget_size.

Examples

if (FALSE) {
split_peaks <- split_long_peaks("pbmc_atac.marginal", peaks = peaks, target_size = 500, max_peak_size = 1e3, very_long = 5e3, min_peak_size = 20)
}