[BioC] dispatch method

Stefanie stefanie.tauber at univie.ac.at
Wed Mar 28 11:48:01 CEST 2012


Dear list,

I would like to have a look at the code of summarizeOverlaps,
so I compute:

library(GenomicFeatures)
showMethods("summarizeOverlaps",includeDefs = T)

Function: summarizeOverlaps (package GenomicRanges)
features="GRanges", reads="GappedAlignments"
function (features, reads, mode = Union, ignore.strand = FALSE, 
    ..., param = ScanBamParam()) 
{
    mode <- match.fun(mode)
    counts <- .dispatch(reads, features, mode, ignore.strand)
    if (length(metadata(reads)) > 0) 
        colData <- DataFrame(metaData = metadata(reads))
    else colData <- DataFrame(metaData = character(1))
    SummarizedExperiment(assays = SimpleList(counts = as.matrix(counts)), 
        rowData = features, colData = colData)
}


features="GRangesList", reads="GappedAlignments"
function (features, reads, mode = Union, ignore.strand = FALSE, 
    ..., param = ScanBamParam()) 
{
    mode <- match.fun(mode)
    counts <- .dispatch(reads, features, mode, ignore.strand)
    if (length(metadata(reads)) > 0) 
        colData <- DataFrame(metaData = metadata(reads))
    else colData <- DataFrame(metaData = character(1))
    SummarizedExperiment(assays = SimpleList(counts = as.matrix(counts)), 
        rowData = features, colData = colData)
}

What is .dispatch exactly doing here? How is it working? How can I have a look
at the underlying code?
Best,
Stefanie



More information about the Bioconductor mailing list