[BioC] summarizeOverlaps using GRanges or bed file as reads?

Hervé Pagès hpages at fhcrc.org
Tue Apr 15 04:09:45 CEST 2014

Hi Ryan,

It looks like the "summarizeOverlaps" methods for GAlignments objects
can also be used on reads stored in a GRanges object:

   features <- gr
   reads <- reads


   > class(features)
   [1] "GRanges"
   [1] "GenomicRanges"

   > class(reads)
   [1] "GAlignments"
   [1] "GenomicAlignments"

   > reads <- as(reads, "GRanges")

   > selectMethod("summarizeOverlaps", c("GRanges", 
"GAlignments"))(features, reads)
   class: SummarizedExperiment
   dim: 11 1
   assays(1): counts
   rownames(11): A B ... H1 H2
   rowData metadata column names(0):
   colnames(1): reads
   colData names(2): object records

Of course, that doesn't mean summarizeOverlaps() shouldn't work
out-of-the-box on reads passed in a GRanges object.

Note that in its current implementation, the above method works
on any object 'reads' for which 'findOverlaps(features, reads)' works.


On 04/14/2014 06:08 PM, Ryan C. Thompson wrote:
> Hello,
> I would like to manipulate the start and end positions of my reads
> before calling summarizeOverlaps. One way to do this is to convert my
> reads to a GRanges and then use flank, narrow, etc. to properly position
> the read ends where I want them. However, I don't see a method for
> summarizeOverlaps that accepts a GRanges object or bed file or similar
> for the reads. Is there such a method, and if not, would it be possible
> to add it?
> The specific application I have in mind is single-end ChIP-Seq reads,
> where we have a good idea of what the fragment length is and would like
> to extend the reads to this length. Alternately, it may be preferable to
> count only the 5-prime ends of the read, and this could be done by
> narrowing to 1 bp length.
> -Ryan Thompson
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor

Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages at fhcrc.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319

More information about the Bioconductor mailing list