dispatch method
3
0
Entering edit mode
Stefanie ▴ 360
@stefanie-5192
Last seen 9.6 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
• 981 views
ADD COMMENT
0
Entering edit mode
@vincent-j-carey-jr-4
Last seen 6 weeks ago
United States
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]]
ADD COMMENT
0
Entering edit mode
@steve-lianoglou-2771
Last seen 14 months ago
United States
Hi Stefanie, On Wed, Mar 28, 2012 at 5:48 AM, Stefanie <stefanie.tauber at="" 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) [snip] If you really want to dig into the code to figure out what's going on, I'd recommend that you download the *source* GenomicRanges package (and IRanges, for that matter) and start hunting ... it's a bit of work, but will likely be a good learning experience. -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology ?| Memorial Sloan-Kettering Cancer Center ?| Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact
ADD COMMENT
0
Entering edit mode
Stefanie ▴ 360
@stefanie-5192
Last seen 9.6 years ago
Hi, thanks. I know downloading the source would state the most complete choice. I just wanted to know how to have a quick look in R... Thanks for your answers!! Best, Stefanie
ADD COMMENT

Login before adding your answer.

Traffic: 1051 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6