countOverlapsW: CountOverlaps with weights

Description Usage Arguments Value See Also Examples

View source: R/feature_helpers.R

Description

Similar to countOverlaps, but takes an optional weight column. This is usually the score column

Usage

1
countOverlapsW(query, subject, weight = NULL, ...)

Arguments

query

IRanges, IRangesList, GRanges, GRangesList object. Usually transcript a transcript region.

subject

GRanges, GRangesList, GAlignment, usually reads.

weight

(default: NULL), if defined either numeric or character name of valid meta column in subject. If weight is single numeric, it is used for all. A normall weight is the score column given as weight = "score". GRanges("chr1", 1, "+", score = 5), would mean score column tells that this alignment region was found 5 times.

...

additional arguments passed to countOverlaps/findOverlaps

Value

a named vector of number of overlaps to subject weigthed by 'weight' column.

See Also

Other features: computeFeaturesCage(), computeFeatures(), disengagementScore(), distToCds(), distToTSS(), entropy(), floss(), fpkm_calc(), fpkm(), fractionLength(), initiationScore(), insideOutsideORF(), isInFrame(), isOverlapping(), kozakSequenceScore(), orfScore(), rankOrder(), ribosomeReleaseScore(), ribosomeStallingScore(), startRegionCoverage(), startRegion(), stopRegion(), subsetCoverage(), translationalEff()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
gr1 <- GRanges(seqnames="chr1",
               ranges=IRanges(start = c(4, 9, 10, 30),
                              end = c(4, 15, 20, 31)),
               strand="+")
gr2 <- GRanges(seqnames="chr1",
               ranges=IRanges(start = c(1, 4, 15, 25),
                              end = c(2, 4, 20, 26)),
               strand=c("+"),
               score=c(10, 20, 15, 5))
countOverlaps(gr1, gr2)
countOverlapsW(gr1, gr2, weight = "score")

ORFik documentation built on March 27, 2021, 6 p.m.