[BioC] mget() error with NA values

Christian Kohler Christian.Kohler at klinik.uni-regensburg.de
Thu Apr 30 17:42:17 CEST 2009


James W. MacDonald wrote:
> Hi Christian,
>
> Christian Kohler wrote:
>> DeaR bioconductors,
>>
>> we run an internal microarray analysis pipeline and switched today from
>> R/BioC (2.8.1/2.3) to 2.9/2.4.
>> After running some test code, I came across the following error:
>>
>> testCode:
>>> x<-rep(NA,10)
>>> unique(unlist(mget(x, env=hgu133plus2ENTREZID,ifnotfound=NA)))
>>
>>
>> when I run this code snippet with 2.8.1/2.3 the corresponding return
>> value is
>>> [1] NA
>
> Really?
>
> > x <- rep(NA, 10)
> > mget(x, hgu95av2ENTREZID)
> Error in .checkKeysAreWellFormed(keys) :
>   keys must be supplied in a character vector with no NAs
> > sessionInfo()
> R version 2.8.1 (2008-12-22)
> i386-pc-mingw32
>
> locale:
> LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
> States.1252;LC_MONETARY=English_United
> States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
>
> attached base packages:
> [1] tools     stats     graphics  grDevices datasets  utils     methods
> [8] base
>
> other attached packages:
> [1] hgu95av2.db_2.2.5   RSQLite_0.7-1       DBI_0.2-4
> [4] AnnotationDbi_1.4.3 Biobase_2.2.2
>
>
>>
>> but with 2.9/2.4 I got the following error:
>>> Error during wrapup: keys must be supplied in a character vector with
>> no NAs
>>
>> This causes our pipeline to break there and stop the analysis while in
>> the previous case the analysis still continued with NA values.
>>
>> Please do not think that I am a picky person, but was there any urgent
>> need to change the behaviour of mget()?
>> Is it possible to somehow bypass this?
>
> The easiest way is to strip the NA values, using the canonical
>
> x <- x[!is.na(x)]
>
> Best,
>
> Jim
>
>
>>
>>
>> Thanks a lot for any help.
>>
>> Christian
>>
>>
>>
>
Hi Jim,

thanks so much for your quick reply, but to be honest I still do not
understand, why my function-call ( unique(unlist(mget(x,
env=hgu133plus2ENTREZID,ifnotfound=NA))) ) produces 'NA' instead of the
error-message above. 

The interesting thing is, that if I analyse exactly the same data with
2.3 as well as with 2.4, the analysis does not break with 2.3 but with
2.4 !?.

Well, I guess the solution is somewhat simple :-)

All the best,
Christian

-- 

Christian Kohler
Institute of Functional Genomics
Computational Diagnostics
University of Regensburg (BioPark I)
D-93147 Regensburg (Germany)

Tel. +49 941 943 5055
Fax  +49 941 943 5020
christian.kohler at klinik.uni-regensburg.de



More information about the Bioconductor mailing list