Skip to contents

Writes bins_gr directly to a temporary BED file (no re-tiling) and runs the megadepth binary through system2(). Results are aligned back to bins_gr by start position, so the returned vector always has length length(bins_gr). Bins with no BigWig coverage receive a score of 0.

Usage

.query_megadepth_bins(
  file,
  bins_gr,
  op = "mean",
  nans_to_zeros = TRUE,
  verbose = FALSE
)

Arguments

file

Path to BigWig file (local or remote URL).

bins_gr

GRanges of pre-computed bins to query.

op

Summarization operation: "mean" (default), "sum", "min", "max".

nans_to_zeros

Replace NA/NaN results with 0 (default TRUE).

verbose

Logical. If TRUE, print megadepth progress output. If FALSE (default), suppress routine megadepth messages.

Value

Numeric vector of length length(bins_gr).