Entering edit mode
Stefanie
▴
360
@stefanie-5192
Last seen 10.2 years ago
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