dot-view_gr_by_window_sample: view GRanges with score at specified window size by sampling...

Description Usage Arguments Value Examples

Description

view GRanges with score at specified window size by sampling values

Usage

1
2
3
.view_gr_by_window_sample(score_gr, query_gr, window_size,
  anchor = c("center", "center_unstranded", "left",
  "left_unstranded")[1])

Arguments

score_gr

GRanges with score mcol

query_gr

GRanges that was used to fecth score_gr

window_size

ineger. desired window size.

anchor

character, anchoring method. one of "center", "center_unstranded", "left", "left_unstranded"

Value

data.table of scores stored in y value sample every window_size

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(GenomicRanges)
bam_file = system.file("extdata", "MCF10A_CTCF.random5.bam", package = "peakrefine")
bam_input = system.file("extdata", "MCF10A_input.random5.bam", package = "peakrefine")
np = system.file("extdata", "MCF10A_CTCF.random5.narrowPeak", package = "peakrefine")
qgr = rtracklayer::import(np, format = "narrowPeak")
strand(qgr) = c("+", "-", "-", "+", "-")

reads_dt = peakrefine:::.fetch_bam_stranded(bam_file, qgr)
ext_cov = coverage(split(
    GRanges(reads_dt[strand == "+"]), reads_dt$which_label))
score_gr = GRanges(ext_cov)
peakrefine:::.view_gr_by_window_sample(score_gr, qgr, 1,
                                 anchor = "center_unstranded")

jrboyd/peakrefine documentation built on July 30, 2020, 7:13 p.m.