[BioC] mget() error with NA values

James W. MacDonald jmacdon at med.umich.edu
Thu Apr 30 17:08:52 CEST 2009


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
> 
> 
> 

-- 
James W. MacDonald, M.S.
Biostatistician
Douglas Lab
University of Michigan
Department of Human Genetics
5912 Buhl
1241 E. Catherine St.
Ann Arbor MI 48109-5618
734-615-7826



More information about the Bioconductor mailing list