`exprs<-` Allows setting assay data matrix size that doesn't match se.exprs
2
0
Entering edit mode
@psmirnov2000-9431
Last seen 7.1 years ago

When subsetting by column the eSet class, I came across this difficult to diagnose error: 

Error in `sampleNames<-`(`*tmp*`, value = c("910910", "1287381", "906862",  : 
  'value' length (965) must equal sample number in AssayData (965)

I discovered that it was due to the fact that I had previously set the assayData of an existing ExpressionSet object using `exprs<-`, while the object also had the se.exprs matrix filled. The exprs setting function let me mismatch the dimensions between exprs and se.exprs, leading to errors when later trying to subset the data. It seems like the exprs function should check for a mismatch in dimensions between exprs and se.exprs, and issue a warning when the matrix dimensions mismatch.

 

Biobase • 1.5k views
ADD COMMENT
0
Entering edit mode
@martin-morgan-1513
Last seen 4 months ago
United States

Thanks Biobase 2.33.1 (in devel; will be ported to release after seeing consequences in the builds) insists that the dimensions and dimnames of the incoming object match or can be made to match (e.g., NULL or sampled) those of the current object.

ADD COMMENT
0
Entering edit mode
@kasper-daniel-hansen-2979
Last seen 18 months ago
United States

This has impact on my code (in minfi).  Specifically, in my class constructor, I create an object via "new()" and then subsequently modify the assayData elements.  This is done based on the profiling reported here: http://www.hansenlab.org/rstats/2014/01/30/lineprof

I can fix this relatively easily (at the cost of a performance overhead).  But to me, this is a case of whether we should allow creation of invalid objects, which can often be useful.  I think the proposed fix is too stringent, or I would like some way of disabling it for internal purpose (say force=FALSE default parameter to the replacement function).  But perhaps I am the only one affected and perhaps I am just too focused on my current issue.

Best,
Kasper

ADD COMMENT
0
Entering edit mode

I added an argument validate=TRUE to assayDataElement<- in 2.33.2.

ADD REPLY
0
Entering edit mode

Thanks with some additional characters that are required for posting.

ADD REPLY

Login before adding your answer.

Traffic: 1026 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