IRanges RangedData - possible bug?
1
0
Entering edit mode
Janet Young ▴ 740
@janet-young-2360
Last seen 5.1 years ago
Fred Hutchinson Cancer Research Center,…
Hi, I think I've found a bug in the RangedData function, although as always it's possible I've misunderstood how the function is supposed to work. There's a pretty simple workaround for this issue, but wanted to tell you in case it's actually a bug. The example below explains it pretty succintly, I think, and sessionInfo output is at the bottom (on a mac, but I also have the same issue running it on linux (with same version of IRanges). thanks, Janet Young ##### create simple RangedData object with a score for each object > rd1 <- RangedData(IRanges(start=c(11,31,51),end=c(20,40,60)), space=c("chrA","chrB","chrB"),score=c(5,10,15)) > rd1 RangedData with 3 rows and 1 value column across 2 spaces space ranges | score <character> <iranges> | <numeric> 1 chrA [11, 20] | 5 2 chrB [31, 40] | 10 3 chrB [51, 60] | 15 ###### filter based on score > rd1filt <- rd1[rd1[["score"]]>= 10,] > rd1filt RangedData with 2 rows and 1 value column across 2 spaces space ranges | score <character> <iranges> | <numeric> 1 chrB [31, 40] | 10 2 chrB [51, 60] | 15 #### drop the score column - this works fine when more than one object passes #### the filter #### (I want to drop score column so I can use "reduce" without requiring things #### to have matched scores) > rd1filt_simple <- RangedData(ranges(rd1filt)) RangedData with 2 rows and 0 value columns across 2 spaces space ranges | <character> <iranges> | 1 chrB [31, 40] | 2 chrB [51, 60] | ##### filter more stringently - now I only have one item left > rd1filt2 <- rd1[rd1[["score"]]>= 15,] > rd1filt2 RangedData with 1 row and 1 value column across 2 spaces space ranges | score <character> <iranges> | <numeric> 1 chrB [51, 60] | 15 #### now there's only one range left, the code I was using to drop the score #### fails > RangedData(ranges(rd1filt2)) RangedData with 1 row and 0 value columns across 2 spaces Error in seqselect(values, isplit) : 'length(start)' must equal 'length(x)' when 'end' and 'width' are NULL Error in args(sessionIno) : no function to return from, jumping to top level #### the workaround > rd1filt2_simple <- RangedData(IRanges(start=start(rd1filt2),end=end(rd1filt2)), space=space(rd1filt2)) > rd1filt2_simple RangedData with 1 row and 0 value columns across 1 space space ranges | <character> <iranges> | 1 chrB [51, 60] | ####### versions: > sessionInfo() R version 2.10.1 (2009-12-14) i386-apple-darwin8.11.1 locale: [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] IRanges_1.4.11 loaded via a namespace (and not attached): [1] tools_2.10.1 ################################## ------------------------------------------------------------------- Dr. Janet Young (Trask lab) Fred Hutchinson Cancer Research Center 1100 Fairview Avenue N., C3-168, P.O. Box 19024, Seattle, WA 98109-1024, USA. tel: (206) 667 1471 fax: (206) 667 6524 email: jayoung ...at... fhcrc.org http://www.fhcrc.org/labs/trask/
Cancer Cancer • 1.1k views
ADD COMMENT
0
Entering edit mode
Patrick Aboyoun ★ 1.6k
@patrick-aboyoun-6734
Last seen 10.2 years ago
United States
Janet, Thanks for reporting this bug. The issue was with the RangedData constructor when there was more than one space but less than two spaces had information associated with it. I just checked in a fix to the BioC 2.5 (R 2.10) and BioC 2.6 (R-devel) code lines to address this issue. The fixed package version number for BioC 2.5 is 1.4.12 and for BioC 2.6 is 1.5.55. These packages will become available (and accessible via biocLite) at bioconductor.org with the next 48 hours. Cheers, Patrick On 3/5/10 12:24 PM, Janet Young wrote: > Hi, > > I think I've found a bug in the RangedData function, although as > always it's > possible I've misunderstood how the function is supposed to work. > There's a > pretty simple workaround for this issue, but wanted to tell you in > case it's > actually a bug. > > The example below explains it pretty succintly, I think, and > sessionInfo output > is at the bottom (on a mac, but I also have the same issue running it > on linux > (with same version of IRanges). > > thanks, > > Janet Young > > > ##### create simple RangedData object with a score for each object > > > rd1 <- > RangedData(IRanges(start=c(11,31,51),end=c(20,40,60)), > space=c("chrA","chrB","chrB"),score=c(5,10,15)) > > rd1 > RangedData with 3 rows and 1 value column across 2 spaces > space ranges | score > <character> <iranges> | <numeric> > 1 chrA [11, 20] | 5 > 2 chrB [31, 40] | 10 > 3 chrB [51, 60] | 15 > > ###### filter based on score > > > rd1filt <- rd1[rd1[["score"]]>= 10,] > > rd1filt > RangedData with 2 rows and 1 value column across 2 spaces > space ranges | score > <character> <iranges> | <numeric> > 1 chrB [31, 40] | 10 > 2 chrB [51, 60] | 15 > > #### drop the score column - this works fine when more than one object > passes > #### the filter > #### (I want to drop score column so I can use "reduce" without > requiring things > #### to have matched scores) > > > rd1filt_simple <- RangedData(ranges(rd1filt)) > RangedData with 2 rows and 0 value columns across 2 spaces > space ranges | > <character> <iranges> | > 1 chrB [31, 40] | > 2 chrB [51, 60] | > > ##### filter more stringently - now I only have one item left > > > rd1filt2 <- rd1[rd1[["score"]]>= 15,] > > rd1filt2 > RangedData with 1 row and 1 value column across 2 spaces > space ranges | score > <character> <iranges> | <numeric> > 1 chrB [51, 60] | 15 > > #### now there's only one range left, the code I was using to drop the > score > #### fails > > > RangedData(ranges(rd1filt2)) > RangedData with 1 row and 0 value columns across 2 spaces > Error in seqselect(values, isplit) : > 'length(start)' must equal 'length(x)' when 'end' and 'width' are NULL > Error in args(sessionIno) : > no function to return from, jumping to top level > > #### the workaround > > > rd1filt2_simple <- > RangedData(IRanges(start=start(rd1filt2),end=end(rd1filt2)), > space=space(rd1filt2)) > > rd1filt2_simple > RangedData with 1 row and 0 value columns across 1 space > space ranges | > <character> <iranges> | > 1 chrB [51, 60] | > > > ####### versions: > > > sessionInfo() > R version 2.10.1 (2009-12-14) > i386-apple-darwin8.11.1 > > locale: > [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > other attached packages: > [1] IRanges_1.4.11 > > loaded via a namespace (and not attached): > [1] tools_2.10.1 > > ################################## > > > > > ------------------------------------------------------------------- > > Dr. Janet Young (Trask lab) > > Fred Hutchinson Cancer Research Center > 1100 Fairview Avenue N., C3-168, > P.O. Box 19024, Seattle, WA 98109-1024, USA. > > tel: (206) 667 1471 fax: (206) 667 6524 > email: jayoung ...at... fhcrc.org > > http://www.fhcrc.org/labs/trask/ > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor
ADD COMMENT

Login before adding your answer.

Traffic: 643 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