Create a temporary synthetic BigWig file for use in examples
Source:R/synthetic-data.R
make_example_bigwig.RdWrites a BigWig file from synthetic GRanges and numeric scores.
The file is created in base::tempdir() by default.
Arguments
- regions_gr
A
GRangesobject. WhenNULL(default), a small five-region GRanges on chr1 is used.- scores
A numeric vector the same length as
regions_gr. WhenNULL(default), scores 1–5 are used.- path
Character file path for output. When
NULL(default), a path is generated viabase::tempfile(fileext = ".bw").
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
make_example_database,
rtracklayer::export
Other synthetic example data helpers:
make_example_database(),
make_example_enhanceosome(),
make_example_putative_enhancers()
Examples
bw_path <- make_example_bigwig()
file.exists(bw_path)
#> [1] TRUE
file.remove(bw_path)
#> [1] TRUE