On 8/22/2010 5:30 PM, Dario Strbenac wrote:
Hi again,

I'm just trying my alternate way to get maximum overlaps, and I've now made a 
small and simple example to show that minoverlap seems to be unimplemented, 
since I get a warning message about it being ignored.

Hi Dario -- as a partial response, I'll just note that this is documented. The help pages for S4 methods can be tricky to find. I did

> showMethods(findOverlaps)
Function: findOverlaps (package IRanges)
[snip]
query="GRanges", subject="GRanges"

> ?"findOverlaps,GRanges,GRanges-method"

and saw

Arguments:
[snip]
minoverlap: Ignored.

I don't know why minoverlap is ignored for this combination of data objects; it could be that the semantics are subtly inconsistent (likely reason) or that the authors have just not had a pressing need to implement this. It does suggest a bit of a tortuous work-around, though, which is to extract the ranges() from your GRanges objects and perform findOverlaps on those. You'll of course have to manage the sequence and strand data yourself.

Martin

gr<- GRanges(seqnames = Rle(c("chr1", "chr2", "chr1",
+ "chr3"), c(1, 3, 2, 4)), ranges = IRanges(1:10, end = 7:16,
+ names = head(letters, 10)), strand = Rle(strand(c("-",
+ "+", "*", "+", "-")), c(1, 2, 2, 3, 2)), score = 1:10,
+ GC = seq(1, 0, length = 10))
gr2<- GRanges(seqnames = c("chr1", "chr1"), ranges = IRanges(c(7,
+ 13), width = 3), strand = c("+", "-"), score = 3:4,
+ GC = c(0.3, 0.5))
findOverlaps(gr, gr2, minoverlap = 9)
An object of class "RangesMatching"
Slot "matchMatrix":
      query subject
[1,]     5       1
[2,]     6       1

Slot "DIM":
[1] 10  2

Warning message:
In .local(query, subject, maxgap, minoverlap, type, select, ...) :
   'minoverlap' argument is ignored
sessionInfo()
R version 2.11.0 (2010-04-22)
x86_64-pc-mingw32

locale:
[1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252    
LC_MONETARY=English_Australia.1252 LC_NUMERIC=C
[5] LC_TIME=English_Australia.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] GenomicRanges_1.0.7 IRanges_1.6.15

--------------------------------------
Dario Strbenac
Research Assistant
Cancer Epigenetics
Garvan Institute of Medical Research
Darlinghurst NSW 2010
Australia

_______________________________________________
Bioc-sig-sequencing mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing

_______________________________________________
Bioc-sig-sequencing mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing

Reply via email to