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.mskcc.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.mskcc.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]]

