Skip to content
Prev 1801 / 21312 Next

[Bioc-devel] Problem with subset("AnnDbBimap", ...) ?

Hi Herv?,

Thanks for for detailled answer.

I understand that the choice was made to forbid the addition of 
[L|R]keys to a Bimap (which you call "junk keys"). I suspect that
implementation concerns weighted in the decision, but that's for a
separate thread.

Unless the message is that the environment-like API is not around only 
for back-compatibility reasons, the main (consistency) problem I am 
having with subset("AnnDbBimap", ...) is  still present after reading 
your explanations, although it might be coming from the use of the 
function subset in R's base working on data.frame.

I'll illustrate it with an example:
[1] Plant     Type      Treatment conc      uptake
<0 rows> (or 0-length row.names)

The function subset("data.frame", ...) is then no less endomorphic than
subset("AnnDbBimap", ...), yet it returns an empty data.frame rather 
than raise an error such as 'no "unfair" Treatment'.

In its current instance, the function subset("AnnDbBimap", ...) might be 
pushing complexity toward the user for use-cases such as:
"I have a list of arbitrary gene symbols, and I'd like to get the
probes/probesets associated with those".

The current (as of today) implementation for subset("Bimap", ...) is:

setMethod("subset", "Bimap",
     function(x, Lkeys=NULL, Rkeys=NULL)
     {
         Lkeys(x) <- Lkeys
         Rkeys(x) <- Rkeys
         x
     }
)

while it could be like:

setMethod("subset", "Bimap",
     function(x, Lkeys=NULL, Rkeys=NULL, quiet=FALSE)
     {
         if (quiet) {
             Lkeys(x) <- Lkeys[Lkeys %in% Lkeys(x)]
             Rkeys(x) <- Rkeys[Rkeys %in% Rkeys(x)]
         } else {
             Lkeys(x) <- Lkeys
             Rkeys(x) <- Rkeys
         }
         x
     }
)


Just a thought,



L.
Herv? Pag?s wrote: