Search
Question: error in sort.int , 'x' must be atomic in affy::boxplot
0
gravatar for Javier Pérez Florido
18 months ago by
Javier Pérez Florido830 wrote:

Dear list,

I'm using affy package for analyzing a dataset (Affymetrix, hgu133plus2). boxplot and hist work fine with raw data. However, after preprocessing with rma, the following error is obtained when using boxplot and hist on normalized data:

celfiles.rma <- rma(celfiles)

boxplot(celfiles.rma,las=2)

Error in sort.int(x, na.last = na.last, decreasing = decreasing, ...) :
  'x' must be atomic
In addition: Warning messages:
1: In is.na(x) : is.na() applied to non-(list or vector) of type 'S4'
2: In is.na(x) : is.na() applied to non-(list or vector) of type 'S4'

if using oligo::boxplot(celfiles.rma) and oligo::hist(celfiles.rma), everything is fine. However, I have to use affy package for teaching purposes.

Any suggestion on how to fix it so that affy::boxplot and affy::hist can work?

Thanks,

Javier

R version 3.3.2 (2016-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.3 LTS

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=es_ES.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=es_ES.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=es_ES.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=es_ES.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats4    parallel  stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] hgu133plus2cdf_2.18.0 hgu133plus2.db_3.2.3  org.Hs.eg.db_3.3.0    AnnotationDbi_1.34.4  IRanges_2.6.1         S4Vectors_0.10.3      limma_3.28.21        
 [8] genefilter_1.54.2     affy_1.50.0           Biobase_2.32.0        BiocGenerics_0.18.0  

loaded via a namespace (and not attached):
 [1] splines_3.3.2         zlibbioc_1.18.0       xtable_1.8-2          lattice_0.20-34       tools_3.3.2           grid_3.3.2            DBI_0.5-1            
 [8] survival_2.39-4       preprocessCore_1.34.0 affyio_1.42.0         Matrix_1.2-8          bitops_1.0-6          RCurl_1.95-4.8        RSQLite_1.0.0        
[15] BiocInstaller_1.22.3  XML_3.98-1.4          annotate_1.50.1     

ADD COMMENTlink modified 18 months ago by James W. MacDonald47k • written 18 months ago by Javier Pérez Florido830
0
gravatar for James W. MacDonald
18 months ago by
United States
James W. MacDonald47k wrote:

The affy package doesn't define a boxplot nor a hist function for an ExpressionSet object, which is probably as it should be. The affy package uses ExpressionSet objects, but doesn't define them. All things equal, a boxplot method for ExpressionSets could be defined in Biobase, but it would just look something like

setMethod("boxplot", "ExpressionSet", function(object, ...){
boxplot(exprs(object))
}

Which is sort of trivial, given that anybody can just do

boxplot(exprs(eset))

and be done with it. The density plot is slightly different, but it's still essentially a two-liner

z <- apply(exprs(eset), 2, density)
matplot(sapply(z, "[[", "x"), sapply(z, "[[", y"), type = "l")

 

ADD COMMENTlink written 18 months ago by James W. MacDonald47k

Dear James,

Thanks for your quick and useful reply. Yes, you are right: affy does not define a boxplot nor a hist function for an expression set object. However, I've used boxplot and hist with normalized objects before (same type of microarray). In fact, before asking this question, I've tried with another dataset for which I knew it worked.

That's why I was wondering why it worked for one dataset and not for another ;-)

ADD REPLYlink written 18 months ago by Javier Pérez Florido830

I'm not sure I understand. Are you saying that these functions were defined in the affy package in the past? Or that you can generate boxplots and/or density plots using ExpressionSets generated from one type of array, but not another?

Note that the affy package has been more or less a static package since the late 2000's. There have been some bugfixes and whatnot, but no active development. So if there ever was a boxplot method for ExpressionSets that was subsequently removed, it had to have happened years ago. I checked through the SVN logs, and I can only find evidence for boxplot and hist being defined for AffyBatch objects. I did find that Martin Morgan removed the generic boxplot method and put it in BiocGenerics, but that was the generic, not a method. And the whole bit that he took out looks like this:

### ======================================================================
### The boxplot() generic
### ---------------------------------------------------------------------
###
### graphics::boxplot is an S3 generic.

setGeneric("boxplot")

There are other packages that defines a boxplot method on ExpressionSets, and you might have had that package loaded when it worked for you. For example, the oligo, affyPLM, and lumi packages all have boxplot methods defined for ExpressionSets.

ADD REPLYlink written 18 months ago by James W. MacDonald47k

Thanks James,

What a mistake. affyPLM was loaded in the script in which boxplot worked well for the normalized data. But it was not loaded in the other script where boxplot fails...that was the point: boxplot method from affyPLM was the one working.

Thanks again and apologize for this mess. I'm ashamed of myself. Sorry for wasting your time.

Javier

 

ADD REPLYlink written 18 months ago by Javier Pérez Florido830
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 333 users visited in the last hour