On Oct 21, 2010, at 8:05 PM, Fahim Md wrote:

Hi
How to access the values in the output that is an object of S4 type. I tried
to access using subset ( [ ] ) but it is not allowed.
Any clue??

Thanks
-- Fahim



#My code is as follows:
require(IRanges);
query <- IRanges(c(1, 4, 9), c(5, 7, 10))
subject <- IRanges(c(2, 2, 10), c(2, 3, 12))
findOverlaps(query, subject)


Output of find overlap function is:
------------------
1> findOverlaps(query, tree)
An object of class "RangesMatching"
Slot "matchMatrix":
    query subject
[1,]     1       1
[2,]     1       2
[3,]     3       2

Slot "DIM":
[1] 4 3
--------------------

How to access the values in the output?


> ?"RangesMatching-class"  # to determine accessor functions
> ovrl <- findOverlaps(query, subject)
> as.table(ovrl)
[1] 2 0 1
> ? findOverlaps

> as.matrix(ovrl)
     query subject
[1,]     1       1
[2,]     1       2
[3,]     3       3
> dim(ovrl)
[1] 3 3

--

David Winsemius, MD
West Hartford, CT

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to