getReadLength: get the read length from a bam file

Description Usage Arguments Value Examples

View source: R/functions_crossCorrRle.R

Description

get the read length from a bam file

Usage

1
getReadLength(bam_file, query_gr)

Arguments

bam_file

character. Path to .bam file, must have index at .bam.bai.

query_gr

GRanges. Regions to calculate cross correlation for. Only first 10 actually used.

Value

numeric. the most common read length observed in bam.

Examples

1
2
3
4
bam_file = system.file("extdata", "MCF10A_CTCF.random5.bam", package = "peakrefine")
np = system.file("extdata", "MCF10A_CTCF.random5.narrowPeak", package = "peakrefine")
query_gr = rtracklayer::import(np, format = "narrowPeak")
getReadLength(bam_file, query_gr)

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