| ssvFetchBigwig.single {seqsetvis} | R Documentation |
ssvFetchBigwig.single Gets values for each region of the query
GRanges (qgr). Values correspond to the center of each window of
size win_size. A tidy formatted data.table
object is returned suitable for plotting using ggplots.
ssvFetchBigwig.single(bw_file, qgr, win_size = 50, win_method = c("sample",
"summary")[1], summary_FUN = stats::weighted.mean, anchor = c("left",
"left_unstranded", "center", "center_unstranded")[3],
return_data.table = FALSE)
bw_file |
The character vector path to bigwig files to read from. |
qgr |
Set of GRanges to query. For valid results the width of each
interval should be identical and evenly divisible by |
win_size |
The window size that evenly divides widths in |
win_method |
character. one of c("sample", "summary"). Determines
if |
summary_FUN |
function. only relevant if win_method is "summary".
passed to |
anchor |
character, one of c("center", "center_unstranded", "left", "left_unstranded") |
return_data.table |
logical. If TRUE the internal data.table is returned instead of GRanges. Default is FALSE. |
if qgr contains the range chr1:1-100 and win_size is
10, values from positions chr1 5,15,25...85, and 95 will be retrieved
from bw_file
A GRanges (or data.table if specified) containing fetched values.
if(Sys.info()['sysname'] != "Windows"){
library(GenomicRanges)
bw_f = system.file("extdata/test_loading.bw",
package = "seqsetvis", mustWork = TRUE)
qgr = GRanges("chrTest", IRanges(1, 30))
bw_gr = ssvFetchBigwig.single(bw_f, qgr, win_size = 10)
bw_dt = ssvFetchBigwig.single(bw_f, qgr, win_size = 10,
return_data.table = TRUE)
}