how to update feature data with different dimensions in expressionSet?
1
0
Entering edit mode
Guido Hooiveld ★ 3.9k
@guido-hooiveld-2020
Last seen 1 day ago
Wageningen University, Wageningen, the …

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)
> sample.data <- ExpressionSet(assayData=matrix(runif(1000), nrow=100, ncol=10))
> sample.data
ExpressionSet (storageMode: lockedEnvironment)
assayData: 100 features, 10 samples
  element names: exprs
protocolData: none
phenoData: none
featureData: none
experimentData: use 'experimentData(object)'
Annotation:  
> replacement <- matrix(runif(750), nrow=75, ncol=10)
> exprs(sample.data) <- 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

locale:
[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
>

 

biobase eSet expressionSet • 3.0k views
ADD COMMENT
1
Entering edit mode
@martin-morgan-1513
Last seen 6 weeks ago
United States

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(sample.data)[1:75,] <- replacement

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

ExpressionSet(replacement)

?

ADD COMMENT
0
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 929 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6