Question: how to update feature data with different dimensions in expressionSet?
gravatar for Guido Hooiveld
12 months ago by
Guido Hooiveld2.2k
Wageningen University, Wageningen, the Netherlands
Guido Hooiveld2.2k wrote:

I am analyzing an Affymetrix array dataset. After RMA normalization the data is returned as an expressionSet object. However, I am not able to replace the expression value 'slot' with some new data anymore, although this did work before (BioC 3.3). See example below. Any suggestions on how to do this in BioC 3.4? Thanks.

--> The normalized data I get is REFSEQ-based, but I am averaging (collapsing) the data on the level of ENTREZG IDs, which I then would like to 'put back' in the expressionSet. The number of genes/features is reduced from ~60k to ~20k. All other (meta)data is not affected.

> library(Biobase)
> <- ExpressionSet(assayData=matrix(runif(1000), nrow=100, ncol=10))
ExpressionSet (storageMode: lockedEnvironment)
assayData: 100 features, 10 samples
  element names: exprs
protocolData: none
phenoData: none
featureData: none
experimentData: use 'experimentData(object)'
> replacement <- matrix(runif(750), nrow=75, ncol=10)
> exprs( <- replacement
Error in .validate_assayDataElementReplace(obj, value) :
  object and replacement value have different dimensions


> sessionInfo()
R version 3.3.1 Patched (2016-10-18 r71535)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

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

other attached packages:
[1] Biobase_2.34.0      BiocGenerics_0.20.0


ADD COMMENTlink modified 12 months ago by Martin Morgan ♦♦ 20k • written 12 months ago by Guido Hooiveld2.2k
gravatar for Martin Morgan
12 months ago by
Martin Morgan ♦♦ 20k
United States
Martin Morgan ♦♦ 20k wrote:

The ExpressionSet has 100 rows and 10 columns. The replacement data has only 75 rows and 10 columns. Which 75 rows and 10 columns are you interested in replacing, e.g.,

exprs([1:75,] <- replacement

Or perhaps as in your example there is no pData or fData, and you really just want to create



ADD COMMENTlink written 12 months ago by Martin Morgan ♦♦ 20k

I would like to fully replace the content; although the expression values for the 75 new IDs are based on those of the 100 old IDs, the identifiers as such are (also) different (refseq vs entrez).

After giving your 2nd suggestion some more thoughts, I think this would be the best approach of achieving what I want. Since I do have the fData and pData info anyway, it would be straight forward to just create a new expressionSet rather than to modify one.

ADD REPLYlink written 12 months ago by Guido Hooiveld2.2k
Please log in to add an answer.


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