dot-calc_cross_corr: Calculate correlation between signal on DNA strands

Description Usage Arguments Value Examples

Description

Calculate correlation between signal on DNA strands

Usage

1
.calc_cross_corr(reads_dt, query_gr, frag_len = NA, window_size = 1)

Arguments

reads_dt

data.table containing read spans. mandatory columns are which_label, strand, start, end

query_gr

GRanges of regions of interest

frag_len

fragment size to extend reads to. frag_len of NA causes read extension to be skipped, ie. raw read pileup.

window_size

integer, resolution used to represent coverage. window_size of 10 retrieves coverage every 10 bp.

Value

data.table of correlation per region in query_gr

Examples

1
2
3
4
5
6
bam_file = system.file("extdata", "MCF10A_CTCF.random5.bam", package = "peakrefine")
np = system.file("extdata", "MCF10A_CTCF.random5.narrowPeak", package = "peakrefine")
qgr = rtracklayer::import(np, format = "narrowPeak")
bam_dt = peakrefine:::.fetch_bam_stranded(bam_file, qgr)
peakrefine:::.calc_cross_corr(bam_dt, qgr,  frag_len = NA) #read correlation
peakrefine:::.calc_cross_corr(bam_dt, qgr, frag_len = 150) #fragment 150 bp correlation

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