Search
Question: How to manipulate assayData in MSnSetList
0
8 months ago by
Cancer Research UK Cambridge Institute
kamal.fartiyal8410 wrote:

I want to perform some operation to the assay data of MSnSet within a MSnSetList but I think its now allowed. Could you please let me know how to do such a thing?

A simple example is shown below.

library(MSnbase)
library(pRolocdata)
data(dunkley2006)
dun <- split(dunkley2006, "replicate")
exprs(dun[[1]])[1,1] <- 1

Error in [[<-(*tmp*, 1, value = <S4 object of class "MSnSet">) :

[[<- defined for objects of type "S4" only for subclasses of environment

Thanks.

Kamal

modified 8 months ago • written 8 months ago by kamal.fartiyal8410
0
8 months ago by
Laurent Gatto1.0k
United Kingdom
Laurent Gatto1.0k wrote:

Yes, indeed, this doesn't work because there is no replacement method for the assayData of an item in an MSnSetList. This however seems to work

exprs(dun@x[[1]])[1,1] <- 1

It is a bit ugly, but might sort you out for now. I'll see to add proper replacement methods.

0
8 months ago by
Cancer Research UK Cambridge Institute
kamal.fartiyal8410 wrote:

Thanks Laurent. It works.