getWinOverlapGRanges: Get the sliding windows that overlap a GRanges object

Description Usage Arguments Details Value Examples

View source: R/getWinOverlapGRanges.R

Description

Get the sliding windows that overlap a GRanges object.

Usage

1
2
getWinOverlapGRanges(x, seqInfo, winWidth = 1000L, winStep = 100L,
  nbOverlapBases = 1)

Arguments

x

a GRanges object, which defines the coordinates of the ranges in the reference genome that all reads mapped to those ranges must be kept by the filtering method filterDNA.

seqInfo

a data frame that contains some key information of the sequences

winWidth

the length of the sliding window, 1000 by default.

winStep

the step length to sliding the window, 100 by default.

nbOverlapBases

a window is considered to overlap with a range of x if it overlaps with at least nbOverlapBases bases.

Details

This finds the windows that overlaps the positive/negative strand of a GRanges object. The GRanges object, which is mustKeepRanges in the filterDNA method, defines the coordinates of the ranges in the reference genome that all reads mapped to those ranges must be kept by the filtering method filterDNA. This method makes use of the method getWinOverlapEachIRange by pretending each given range as the range of a read. Since the widths of x are not necessarily the same (as normal read lengths), we use nbOverlapBases to specify the minimum number of bases that a window should overlap with a range of x, instead of using proprotion as readProp in getWinOverlapEachIRange.

Value

A list of two logical vectors (for positive and negative strand) defining which windows that overlap with the given GRanges object.

Examples

1
2
3
4
5
6
7
library(GenomicRanges)
x <- GRanges(seqnames = "10",ranges = IRanges(start = c(10000,15000),
end=c(20000,30000)),strand = c("+","-"))
seqInfo <- data.frame("Sequence"=10,"FirstBaseInPart"=1)
getWinOverlapGRanges(x,seqInfo)
seqInfo <- data.frame("Sequence"=10,"FirstBaseInPart"=10000000)
getWinOverlapGRanges(x,seqInfo)

UofABioinformaticsHub/rnaCleanR documentation built on Aug. 11, 2021, 11:51 p.m.