coverageByWindow {ORFik} | R Documentation |
This is similar to [GenomicFeatures::coverageByTranscript()], but it adds: automatic sorting of the windows, fix for some rare cases when subsetting fails on minus/plus strands and security that subseting of windows will always return values (zeros) istead of out of bounds error.
coverageByWindow(x, windows, ignore.strand = FALSE, is.sorted = FALSE, keep.names = TRUE)
x |
the cigar of the reads |
windows |
(GRangesList) of transcripts or CDS or other ranges that will be subseting coverage of 'x' |
ignore.strand |
(logical) Whether to consider all reads to be "*". |
is.sorted |
(logical), is windows already sorted. |
keep.names |
logical (T), keep names and meta cols |
Minus strand is already flipped so that the most 5' position on the window is the first position in the returned Rle.
(RleList) of positional counts of 'x' ranges overlapping each consecutive position of the elements of 'windows'
cds <- GenomicRanges::GRangesList( GenomicRanges::GRanges(seqnames = "chr1", ranges = IRanges::IRanges(100, 200), strand = "+")) reads <- GenomicRanges::GRanges( seqnames = "chr1", ranges = IRanges::IRanges(c(100, 150), c(110, 160)), strand = "+") ORFik:::coverageByWindow(reads, cds)