[BioC] Performing set ops with an IRanges object loaded with elementMetadata is like a shotgun, pointing at my foot.

Hervé Pagès hpages at fhcrc.org
Tue Jul 13 00:26:23 CEST 2010


Hi Steve, Michael,

On 07/12/2010 12:01 PM, Steve Lianoglou wrote:
> On Mon, Jul 12, 2010 at 2:49 PM, Michael Lawrence
> <lawrence.michael at gene.com>  wrote:
>> On Mon, Jul 12, 2010 at 11:05 AM, Steve Lianoglou
>> <mailinglist.honeypot at gmail.com>  wrote:
> <snip>
>>> I don't know what the answer *really* should be as to what the correct
>>> behavior in this situation would be, which I guess could be an
>>> interesting discussion ... perhaps the elementMetadata can be
>>> split/merged with its associated range, or just dropped all together
>>> (perhaps via some explicit parameter in the setdiff, etc. function
>>> call?).
>>>
>>> Anyway, in an effort to skirt that rabbit hole for now, could I ask
>>> for a feature request and have IRanges provide a more informative
>>> error message when an end user is gunning at their feet w/ this
>>> scenario? :-)
>>>
>>
>> I think it would be reasonable to simply drop the metadata, since one is
>> creating an entirely new set of ranges. Might want a warning/message, but
>> I'm not sure if even that is necessary. Just need to document the behavior.
>
> I agree that dropping the metadata is sufficient, but (if we were
> taking a vote) I think I'd have a slight (+0) preference for it to
> fire off a warning if any of the IRanges objects had metadata that was
> dropped.
>

Sounds reasonable behaviour to me. All the set ops (i.e. gaps(),
union(), intersect(), setdiff(), punion(), pintersect(), psetdiff()
and pgap()) are currently dropping the names of their args so it
makes sense to also drop the metadata and elementMetadata slots.
No warning is issued when dropping the names (which is consistent
with all the names-dropping function I know) but I think it's OK
to issue one when the metadata and elementMetadata slots are dropped.
It would not be nice to silently start dropping something that
wasn't dropped before. The warning can still be removed later if
people find it annoying.

H.

-- 
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M2-B876
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages at fhcrc.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319



More information about the Bioconductor mailing list