[BioC] Bug in set operations over IRanges objects with non-NULL elementMetadata()

Steve Lianoglou mailinglist.honeypot at gmail.com
Fri Oct 15 04:43:35 CEST 2010


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



More information about the Bioconductor mailing list