crossCorrByRle: Calculate cross correlation by using shiftApply on read...

View source: R/functions_fragLen.R

crossCorrByRleR Documentation

Calculate cross correlation by using shiftApply on read coverage Rle

Description

Calculate cross correlation by using shiftApply on read coverage Rle

Usage

crossCorrByRle(
  bam_file,
  query_gr,
  max_dupes = 1,
  fragment_sizes = 50:300,
  read_length = NULL,
  flip_strand = FALSE,
  ...
)

Arguments

bam_file

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

query_gr

GRanges. Regions to calculate cross correlation for.

max_dupes

integer. Duplicate reads above this value will be removed.

fragment_sizes

integer. fragment size range to search for maximum correlation.

read_length

integer. Any values outside fragment_range that must be searched. If not supplied will be determined from bam_file. Set as NA to disable this behavior.

flip_strand

boolean. if TRUE strands that reads align to are swapped. This is typically only necessary if there was a mismatch between library chemistry and aligner settings. Default is FALSE.

...

arguments passed to ScanBamParam

Value

named list of results

Examples

data(CTCF_in_10a_overlaps_gr)
bam_f = system.file("extdata/test.bam",
    package = "seqsetvis", mustWork = TRUE)
query_gr = CTCF_in_10a_overlaps_gr[1:2]
crossCorrByRle(bam_f, query_gr[1:2], fragment_sizes = seq(50, 300, 50))

jrboyd/seqsetvis documentation built on Oct. 15, 2024, 11:28 p.m.