Plot the marginal coverage of an interval, with the peaks marked (optionally).
Usage
plot_marginal_coverage(
marginal_track,
interval,
window_size,
peaks = NULL,
expand = 1000,
show_thresh = TRUE,
quantile_thresh = 0.9,
min_umis = 8,
genome = NULL,
seed = 60427,
thresh = get_quantile_cov_thresh(marginal_track, quantile_thresh, min_umis, window_size
= window_size, genome = genome, seed = seed),
log_scale = TRUE
)
Arguments
- marginal_track
Name of the 'misha' track to plot. You can create it using
import_atac_marginal
.- interval
An interval to plot.
- window_size
Window size to expand the marginal track values. Use the parameter you used at
call_peaks
.- peaks
An intervals set with the peaks to mark, e.g. output of
call_peaks
.- expand
Expand the plotting area by this number of bp.
- quantile_thresh, min_umis
paramters needed to calculate the threshold. See
call_peaks
.- genome
Genome name, such as 'hg19' or 'mm10'. If NULL - the current misha database is used.
- thresh
Threshold to use. If NULL - the threshold is calculated using
get_quantile_cov_thresh
.- log_scale
Use log scale for the y axis.
- show_threshold
Show the coverage threshold as a dashed line.
Examples
if (FALSE) {
peaks_raw <- call_peaks("pbmc_atac.marginal", split_peaks = FALSE, quantile_thresh = 0.9, min_umis = 8, max_peak_size = 600, genome = "hg38")
peaks_split <- call_peaks("pbmc_atac.marginal", split_peaks = TRUE, target_size = 500, quantile_thresh = 0.9, min_umis = 8, max_peak_size = 600, genome = "hg38")
plot_marginal_coverage("pbmc_atac.marginal", interval = peaks_raw[967, ], peaks = peaks_split, expand = 1000, show_thresh = TRUE, quantile_thresh = 0.9, min_umis = 8, genome = "hg38")
# cache the threshold in order to plot multiple intervals
thresh <- get_quantile_cov_thresh("pbmc_atac.marginal", 0.9, 8, genome = "hg38", seed = 60427)
plot_marginal_coverage("pbmc_atac.marginal", interval = peaks_raw[967, ], peaks = peaks_split, expand = 1000, show_thresh = TRUE, thresh = thresh, genome = "hg38")
plot_marginal_coverage("pbmc_atac.marginal", interval = peaks_raw[900, ], peaks = peaks_split, expand = 1000, show_thresh = TRUE, thresh = thresh, genome = "hg38")
}