On Wed, Mar 28, 2012 at 5:48 AM, Stefanie <stefanie.tauber@univie.ac.at>wrote:

> 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?
>

> GenomicRanges:::.dispatch
function (reads, features, mode, ignore.strand, ...)
{
    if (ignore.strand)
        strand(reads) <- "*"
    mode(reads, features, ignore.strand)
}
<environment: namespace:GenomicRanges>


> Best,
> Stefanie
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
>

	[[alternative HTML version deleted]]

