Bug in set operations over IRanges objects with non-NULL elementMetadata()
1
0
Entering edit mode
@steve-lianoglou-2771
Last seen 13 months ago
United States
Hi, Subject says it all. Here's an example: R> library(IRanges) R> i1 <- IRanges(1, 10) R> i2 <- IRanges(c(1, 15), width=5) R> i3 <- i2 R> values(i3) <- DataFrame(score=1:2) R> union(i1, i2) IRanges of length 2 start end width [1] 1 10 10 [2] 15 19 5 R> union(i1, i3) Error in reduce(c(x0, y), drop.empty.ranges = TRUE) : error in evaluating the argument 'x' in selecting a method for function 'reduce' R> setdiff(i1, i2) IRanges of length 1 start end width [1] 6 10 5 R> setdiff(i1, i3) Error in gaps(union(gaps(x, start = start, end = end), y), start = start, : error in evaluating the argument 'x' in selecting a method for function 'gaps' R> sessionInfo() R version 2.12.0 beta (2010-09-30 r53084) Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit) 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] GenomicRanges_1.1.36 IRanges_1.7.39 -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
Cancer Cancer • 811 views
ADD COMMENT
0
Entering edit mode
@steve-lianoglou-2771
Last seen 13 months ago
United States
Actually, I have a vague feeling of this maybe coming up before (maybe even from me(?)). I understand that it's not clear what to do with the DataFrame values() when merging/intersecting/union/etc. two IRanges, so I would imagine either: (i) dropping the values() from both might be fine (w/ a warning()?); or if you really think this should be an error no matter what (ii) at least give a better error message in this situation so the user can smoke out what's wrong and fix. Thanks, -steve On Thu, Oct 14, 2010 at 9:55 PM, Steve Lianoglou <mailinglist.honeypot at="" gmail.com=""> wrote: > Hi, > > Subject says it all. Here's an example: > > R> library(IRanges) > R> i1 <- IRanges(1, 10) > R> i2 <- IRanges(c(1, 15), width=5) > R> i3 <- i2 > R> values(i3) <- DataFrame(score=1:2) > > R> union(i1, i2) > IRanges of length 2 > ? ?start end width > [1] ? ? 1 ?10 ? ?10 > [2] ? ?15 ?19 ? ? 5 > > R> union(i1, i3) > Error in reduce(c(x0, y), drop.empty.ranges = TRUE) : > ?error in evaluating the argument 'x' in selecting a method for > function 'reduce' > > R> setdiff(i1, i2) > IRanges of length 1 > ? ?start end width > [1] ? ? 6 ?10 ? ? 5 > > R> setdiff(i1, i3) > Error in gaps(union(gaps(x, start = start, end = end), y), start = start, ?: > ?error in evaluating the argument 'x' in selecting a method for function 'gaps' > > R> sessionInfo() > R version 2.12.0 beta (2010-09-30 r53084) > Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit) > > 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] GenomicRanges_1.1.36 IRanges_1.7.39 > > -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 > -- 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
ADD COMMENT
0
Entering edit mode
I believe the convention up till now has been to quietly drop the metadata, and that makes sense to me. I can work on fixing some of these methods. I'm sure there are such issues all over IRanges, as element metadata was incorporated fairly late in the game. Michael On Thu, Oct 14, 2010 at 7:43 PM, Steve Lianoglou < mailinglist.honeypot@gmail.com> wrote: > Actually, I have a vague feeling of this maybe coming up before (maybe > even from me(?)). > > I understand that it's not clear what to do with the DataFrame > values() when merging/intersecting/union/etc. two IRanges, so I would > imagine either: > > (i) dropping the values() from both might be fine (w/ a warning()?); > or if you really think this should be an error no matter what > > (ii) at least give a better error message in this situation so the > user can smoke out what's wrong and fix. > > Thanks, > -steve > > > On Thu, Oct 14, 2010 at 9:55 PM, Steve Lianoglou > <mailinglist.honeypot@gmail.com> wrote: > > Hi, > > > > Subject says it all. Here's an example: > > > > R> library(IRanges) > > R> i1 <- IRanges(1, 10) > > R> i2 <- IRanges(c(1, 15), width=5) > > R> i3 <- i2 > > R> values(i3) <- DataFrame(score=1:2) > > > > R> union(i1, i2) > > IRanges of length 2 > > start end width > > [1] 1 10 10 > > [2] 15 19 5 > > > > R> union(i1, i3) > > Error in reduce(c(x0, y), drop.empty.ranges = TRUE) : > > error in evaluating the argument 'x' in selecting a method for > > function 'reduce' > > > > R> setdiff(i1, i2) > > IRanges of length 1 > > start end width > > [1] 6 10 5 > > > > R> setdiff(i1, i3) > > Error in gaps(union(gaps(x, start = start, end = end), y), start = start, > : > > error in evaluating the argument 'x' in selecting a method for function > 'gaps' > > > > R> sessionInfo() > > R version 2.12.0 beta (2010-09-30 r53084) > > Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit) > > > > 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] GenomicRanges_1.1.36 IRanges_1.7.39 > > > > -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<http: cbio.ms="" kcc.org="" %7elianos="" contact=""> > > > > > > -- > 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<http: cbio.mskc="" c.org="" %7elianos="" contact=""> > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
These issues should now be resolved as of 1.9.1. Sure there's a lot more out there. Michael On Fri, Oct 15, 2010 at 6:57 AM, Michael Lawrence <michafla@gene.com> wrote: > I believe the convention up till now has been to quietly drop the metadata, > and that makes sense to me. > > I can work on fixing some of these methods. I'm sure there are such issues > all over IRanges, as element metadata was incorporated fairly late in the > game. > > Michael > > > On Thu, Oct 14, 2010 at 7:43 PM, Steve Lianoglou < > mailinglist.honeypot@gmail.com> wrote: > >> Actually, I have a vague feeling of this maybe coming up before (maybe >> even from me(?)). >> >> I understand that it's not clear what to do with the DataFrame >> values() when merging/intersecting/union/etc. two IRanges, so I would >> imagine either: >> >> (i) dropping the values() from both might be fine (w/ a warning()?); >> or if you really think this should be an error no matter what >> >> (ii) at least give a better error message in this situation so the >> user can smoke out what's wrong and fix. >> >> Thanks, >> -steve >> >> >> On Thu, Oct 14, 2010 at 9:55 PM, Steve Lianoglou >> <mailinglist.honeypot@gmail.com> wrote: >> > Hi, >> > >> > Subject says it all. Here's an example: >> > >> > R> library(IRanges) >> > R> i1 <- IRanges(1, 10) >> > R> i2 <- IRanges(c(1, 15), width=5) >> > R> i3 <- i2 >> > R> values(i3) <- DataFrame(score=1:2) >> > >> > R> union(i1, i2) >> > IRanges of length 2 >> > start end width >> > [1] 1 10 10 >> > [2] 15 19 5 >> > >> > R> union(i1, i3) >> > Error in reduce(c(x0, y), drop.empty.ranges = TRUE) : >> > error in evaluating the argument 'x' in selecting a method for >> > function 'reduce' >> > >> > R> setdiff(i1, i2) >> > IRanges of length 1 >> > start end width >> > [1] 6 10 5 >> > >> > R> setdiff(i1, i3) >> > Error in gaps(union(gaps(x, start = start, end = end), y), start = >> start, : >> > error in evaluating the argument 'x' in selecting a method for function >> 'gaps' >> > >> > R> sessionInfo() >> > R version 2.12.0 beta (2010-09-30 r53084) >> > Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit) >> > >> > 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] GenomicRanges_1.1.36 IRanges_1.7.39 >> > >> > -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<http: cbio.m="" skcc.org="" %7elianos="" contact=""> >> > >> >> >> >> -- >> 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<http: cbio.msk="" cc.org="" %7elianos="" contact=""> >> >> _______________________________________________ >> Bioconductor mailing list >> Bioconductor@stat.math.ethz.ch >> https://stat.ethz.ch/mailman/listinfo/bioconductor >> Search the archives: >> http://news.gmane.org/gmane.science.biology.informatics.conductor >> > > [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
Thanks for taking care of that, Michael. -steve On Sat, Oct 23, 2010 at 11:01 PM, Michael Lawrence <lawrence.michael at="" gene.com=""> wrote: > These issues should now be resolved as of 1.9.1. Sure there's a lot more out > there. > > Michael > > On Fri, Oct 15, 2010 at 6:57 AM, Michael Lawrence <michafla at="" gene.com=""> wrote: >> >> I believe the convention up till now has been to quietly drop the >> metadata, and that makes sense to me. >> >> I can work on fixing some of these methods. I'm sure there are such issues >> all over IRanges, as element metadata was incorporated fairly late in the >> game. >> >> Michael >> >> On Thu, Oct 14, 2010 at 7:43 PM, Steve Lianoglou >> <mailinglist.honeypot at="" gmail.com=""> wrote: >>> >>> Actually, I have a vague feeling of this maybe coming up before (maybe >>> even from me(?)). >>> >>> I understand that it's not clear what to do with the DataFrame >>> values() when merging/intersecting/union/etc. two IRanges, so I would >>> imagine either: >>> >>> (i) dropping the values() from both might be fine (w/ a warning()?); >>> or if you really think this should be an error no matter what >>> >>> (ii) at least give a better error message in this situation so the >>> user can smoke out what's wrong and fix. >>> >>> Thanks, >>> -steve >>> >>> >>> On Thu, Oct 14, 2010 at 9:55 PM, Steve Lianoglou >>> <mailinglist.honeypot at="" gmail.com=""> wrote: >>> > Hi, >>> > >>> > Subject says it all. Here's an example: >>> > >>> > R> library(IRanges) >>> > R> i1 <- IRanges(1, 10) >>> > R> i2 <- IRanges(c(1, 15), width=5) >>> > R> i3 <- i2 >>> > R> values(i3) <- DataFrame(score=1:2) >>> > >>> > R> union(i1, i2) >>> > IRanges of length 2 >>> > ? ?start end width >>> > [1] ? ? 1 ?10 ? ?10 >>> > [2] ? ?15 ?19 ? ? 5 >>> > >>> > R> union(i1, i3) >>> > Error in reduce(c(x0, y), drop.empty.ranges = TRUE) : >>> > ?error in evaluating the argument 'x' in selecting a method for >>> > function 'reduce' >>> > >>> > R> setdiff(i1, i2) >>> > IRanges of length 1 >>> > ? ?start end width >>> > [1] ? ? 6 ?10 ? ? 5 >>> > >>> > R> setdiff(i1, i3) >>> > Error in gaps(union(gaps(x, start = start, end = end), y), start = >>> > start, ?: >>> > ?error in evaluating the argument 'x' in selecting a method for >>> > function 'gaps' >>> > >>> > R> sessionInfo() >>> > R version 2.12.0 beta (2010-09-30 r53084) >>> > Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit) >>> > >>> > 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] GenomicRanges_1.1.36 IRanges_1.7.39 >>> > >>> > -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 >>> > >>> >>> >>> >>> -- >>> 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 >>> >>> _______________________________________________ >>> 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 >> > > -- 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
ADD REPLY

Login before adding your answer.

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