[BioC] Rkeys function from AnnotationDbi returns all Rkeys for a subset

Laurent Gautier laurent at cbs.dtu.dk
Wed Dec 10 07:51:42 CET 2008


Leon Yee wrote:
> Hi James and Laurent,
> 
> 
> James W. MacDonald wrote:
>> Hi Leon,
>>
>> Leon Yee wrote:
>>> Dear all,
>>>
>>>      I encountered a problem when I using Rkeys from AnnotationDbi
>>> package. Using [] I get a subset of a AnnDbBimap object, but when I
>>> using Rkeys for this subset, it returns all of the Rkeys from the
>>> original set.
>>
>> I don't believe Rkeys() is intended to return a subset - it is 
>> intended to give you all the right keys of the object. But I am not 
>> sure why you want to use Rkeys() to do what you have already done 
>> using as.list(hgu95av2PATH[ids]). Perhaps I misunderstand?
>>
> 
>   Yes, as Laurent pointed out, mappedRkeys() is what I'm looking for. I 
> just feel that Rkeys() is semantically somewhat misleading according to 
> its name , you know, Lkeys() just returns the Lkeys of the subset 
> (including NAs), while Rkeys() returns all of the Rkeys of the whole 
> set.  Or maybe "[]" is not a real subsetting operation?
> 

What is a "real subsetting operation" then ? That just depends on the 
definition one gives to it.

Here the subset operation takes a subset of the "mapping", that is of 
the vertices in the bipartite graph, without eliminating the unconnected 
edges. I suppose that this choice can be defended by the fact that edges 
in an AnnDbBimap object can be without any associated edge, which is 
making sense. For example, in the context of microarray some probes can 
be on the array, no given association be associated with it, but yet it 
is practical to have such probes ID defined in a part (left or right) of 
the BiMap.



L.



>   Thank you very much.
> 
> Best regards,
> Leon
> 
> _______________________________________________
> 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


-- 
-
Laurent Gautier, Ph.D.
DMAC, Head
Building 301, CBS - Technical University of Denmark
DK-2800 Lyngby
tel: +45 45 25 61 45



More information about the Bioconductor mailing list