Skip to content
Prev 7585 / 21307 Next

[Bioc-devel] Changes in AnnotationDbi

Hi Jim,

I do agree that the warning was protective for that (this is why I put 
it there).

But it was also annoying for many and a source of some confusion because 
when people see a warning() they think that something has gone wrong 
with the code that was just run.  And in this case the select method was 
actually doing exactly what it was supposed to be doing.  What it was 
actually warning you about was what you did separately in that 
assignment to fit2...  Which is the step right after the select method 
already did it's work.  And I can understand why that seems a little bit 
confusing since you are basically telling someone to be careful with the 
data you just gave them.

Now I could replace it with a message() I guess, but in cases like this 
where the warning is about something that happens outside of the 
function you are calling, shouldn't that probably be handled by 
documentation?  Or at least, that is the argument that finally persuaded 
me to remove it.  That and that fact that almost every call to select() 
ended up accompanied by the warning you mentioned, because it turns out 
that perfect 1:1 relationships are pretty rare for annotation data.  
Very often, you are going to get back multiple results.

But I didn't just remove the warning, I also supplied an alternative for 
people who have a real need for consistent 1:1 mapping.

The mapIds() method takes most of the same arguments as select, except 
that unlike select(), it only looks up one column and it always returns 
a vector that is the same size as the vector that came in.

So for your example, you could do something like this psuedocode here:

mapIds(<chippackage>, featureNames(eset), column="ENTREZID", 
keytype="PROBEID")

And mapIds will follow a rule specified by the default value for the 
multiVals argument so that you can get back your results in a 1:1 
manner.  And if you don't like any of the options available for the 
multiVals argument, you can make your own function and pass it in.


Anyhow please continue to let us know what you think?


  Marc
On 06/04/2015 10:50 AM, James W. MacDonald wrote: