Skip to contents

Peaks are called by screening for genomic regions with a number of UMIs above a quantile of the marginal ATAC counts, and above min_umis. Peaks are then canonized using canonize_peaks.
If split_peaks is TRUE, then peaks that are longer than max_peak_size would be splitted into smaller peaks using split_long_peaks.

Usage

call_peaks(
  marginal_track,
  quantile_thresh = 0.9,
  min_umis = 8,
  canonize = TRUE,
  split_peaks = FALSE,
  target_size = 500,
  max_peak_size = 1000,
  very_long = 5000,
  min_peak_size = 200,
  window_size = target_size,
  genome = NULL,
  keep_marginal = FALSE,
  seed = 60427
)

Arguments

marginal_track

Name of the 'misha' track to call peaks from. You can create it using import_atac_marginal.

quantile_thresh

Quantile of the marginal track above which peaks are called.

min_umis

Minimal number of UMIs to call a peak.

canonize

Whether to canonize the peaks using canonize_peaks. Default is TRUE.

split_peaks

Split peaks that are longer than max_peak_size into smaller peaks using split_long_peaks. Default is FALSE.

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.

genome

Genome name, such as 'hg19' or 'mm10'. If NULL - the current misha database is used.

keep_marginal

Whether to keep the marginal track in the output. If TRUE, a column named marginal will be added to the output.

seed

random seed for reproducibility (misha::gquantiles sometimes samples the data)

Value

an intervals set with the called peaks

Examples

if (FALSE) {
peaks <- call_peaks("pbmc_atac.marginal", quantile_thresh = 0.9, min_umis = 8, max_peak_size = 600, genome = "hg38")
}