summarizeOverlapsByBins: Perform overlap queries between reads and genomic features by...

View source: R/summarizeOverlapsByBins.R

summarizeOverlapsByBinsR Documentation

Perform overlap queries between reads and genomic features by bins

Description

summarizeOverlapsByBins extends summarizeOverlaps by providing fixed window size and step to split each feature into bins and then do queries. It will return counts by signalSummaryFUN, which applied to bins in one feature, for each feature.

Usage

summarizeOverlapsByBins(
  targetRegions,
  reads,
  windowSize = 50,
  step = 10,
  signalSummaryFUN = max,
  mode = countByOverlaps,
  ...
)

Arguments

targetRegions

A GRanges object of genomic regions of interest.

reads

A GRanges, GRangesList GAlignments, GAlignmentsList, GAlignmentPairs or BamFileList object that represents the data to be counted by summarizeOverlaps.

windowSize

Size of windows

step

Step of windows

signalSummaryFUN

function, which will be applied to the bins in each feature.

mode

mode can be one of the pre-defined count methods. see summarizeOverlaps. default is countByOverlaps, alia of countOverlaps(features, reads, ignore.strand=ignore.strand)

...

Additional arguments passed to summarizeOverlaps.

Value

A RangedSummarizedExperiment object. The assays slot holds the counts, rowRanges holds the annotation from features.

Author(s)

Jianhong Ou

Examples


    fls <- list.files(system.file("extdata", package="GenomicAlignments"),
                  recursive=TRUE, pattern="*bam$", full=TRUE)
    names(fls) <- basename(fls)
    genes <- GRanges(
        seqnames = c(rep("chr2L", 4), rep("chr2R", 5), rep("chr3L", 2)),
        ranges = IRanges(c(1000, 3000, 4000, 7000, 2000, 3000, 3600, 
                           4000, 7500, 5000, 5400), 
                         width=c(rep(500, 3), 600, 900, 500, 300, 900, 
                                 300, 500, 500),
                         names=letters[1:11])) 
    se <- summarizeOverlapsByBins(genes, fls, windowSize=50, step=10)


jianhong/ChIPpeakAnno documentation built on Nov. 1, 2024, 8:55 a.m.