Skip to contents

Writes a BigWig file from synthetic GRanges and numeric scores. The file is created in base::tempdir() by default.

Usage

make_example_bigwig(regions_gr = NULL, scores = NULL, path = NULL)

Arguments

regions_gr

A GRanges object. When NULL (default), a small five-region GRanges on chr1 is used.

scores

A numeric vector the same length as regions_gr. When NULL (default), scores 1–5 are used.

path

Character file path for output. When NULL (default), a path is generated via base::tempfile(fileext = ".bw").

Value

Character string giving the path to the created BigWig file.

Details

Caller responsibility: The returned path points to a temporary file that persists for the R session. Call file.remove(path) when the file is no longer needed to avoid accumulating temporary files.

See also

Examples

bw_path <- make_example_bigwig()
file.exists(bw_path)
#> [1] TRUE
file.remove(bw_path)
#> [1] TRUE