Skip to contents
Chapters and reference

Complete canonical API text; task articles explain the workflows. Usage guide

Uses optional rtracklayer and its GRanges import. Those coordinates are already one-based inclusive and are not shifted again. Stored sequence lengths come from the file header, not the last nonmissing interval. Scores retain the binary file's floating-point representation. They are signal values, not original observation counts, identity or read support.

Usage

R · Example code
read_bigwig(file = NULL, files = NULL, which = NULL, source_file = FALSE)

Arguments

file

Optional local input path vector or glob patterns, before files.

files

Optional additional paths or wildcards for local BigWig files.

which

NULL for the whole file, or a GRanges / data frame with character accver and numeric start/end in one-based inclusive coordinates. Unknown accessions and out-of-bounds intervals fail explicitly. An empty selection returns no signal rows. The same selection applies to each file.

source_file

Logical. Add .source_file to each row, default FALSE.

Value

A data frame with accver, start, end, value and original imported score. Import provenance includes decoder/version, each file's sequence dictionary, original query and effective selected intervals. No physical source lines or original measurement IDs are manufactured from a binary file.

Details

Optional selection is an unstranded coordinate union, so overlapping query windows do not duplicate a source signal. Returned runs are clipped to that union. The original query and effective union are retained separately; no pre-clipping window boundaries are invented. Missing ranges stay absent, and imported missing scores remain missing. No zero filling, smoothing, summarisation or value-unit inference is performed. The optional decoder does not support BigWig on Windows; use an existing bedGraph file with read_bedgraph() there instead.

Examples

R · Example code
if (.Platform$OS.type != "windows" && requireNamespace("rtracklayer", quietly = TRUE)) {
  path <- system.file("extdata", "pUC19-gc-100.bw", package = "ggchord")
  signal <- read_bigwig(path)
  local <- read_bigwig(path,
    which = data.frame(accver = "pUC19", start = 50, end = 150))
  head(signal)
} else {
  "Optional rtracklayer decoder is unavailable; no BigWig result was computed."
}
#>   accver start end value score
#> 1  pUC19     1 100    60    60
#> 2  pUC19   101 200    57    57
#> 3  pUC19   201 300    59    59
#> 4  pUC19   301 400    54    54
#> 5  pUC19   401 500    53    53
#> 6  pUC19   501 600    49    49

Search documentation

↑ ↓ select · Enter open · Esc close; or browse by task. API and functions