[R] How to access values in s4 method
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? [[alternative HTML version deleted]] __ 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.
Re: [R] How to access values in s4 method
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.
Re: [R] How to access values in s4 method
Hi Fahim, On Thu, Oct 21, 2010 at 2:05 PM, Fahim Md fahim...@gmail.com 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?? A few things: (1) You generally shouldn't cross post between two lists (2) This is more of a bioconductor question, so if you want further help, switch over to the bioc mailing list. (3) Read through the help in ?findOverlaps and pay attention to the links in the See Also section, which will take you to the RangesMatching class -- which is the result of a findOverlaps call (in case you were wondering how David was able to figure out how to point you to the ?RangesMatching-class help). -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 __ 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.