Skip to content
Prev 1375 / 21307 Next

[Bioc-devel] assayDat and ExpressionSet

On Oct 15, 2007, at 7:39 PM, Martin Morgan wrote:

            
Well, the slot can be full of NA's. Example:

   R> example("AnnotatedDataFrame-class")
   R> obj2 = new("AnnotatedDataFrame", data = obj at data)
   R> obj2 at varMetadata
   labelDescription
x             <NA>
y             <NA>
z             <NA>

The help page says "varMetadata and dimLabels can be missing."

I agree that in principle the varMetadata slot exists, but it is  
essentially empty.
I am a bit unsure about what the difference is between variable  
labels vs. label descriptions. The historic intention (I dare say)  
and use of varLabels was to provide additional information about the  
covariates in the pData slot. You might for example have a covariate  
named Spres and the varLabel might say "Systolic bloodpressure".  
People of course thought about including things such as units of  
measurements etc., which can now be incorporated as a separate column  
in the varMetadata slot.

varLabels was probably primarily used in show/summary methods and for  
many users (I dare say) probably not used very much since they would  
say "age is self-describing". I guess one of the intentions was to  
make the objects more self-documenting in case you exchange objects  
with other people.

Anyway, from the name labelsDescription I got the distinct impression  
that the idea was similar. I agree that the AnnotatedDataFrame  
example shows otherwise:
 > obj at varMetadata
   labelDescription
x          Numbers
y    Factor levels
z       Characters

Here it seems as if the labelDescription simply contains a rather non- 
useful description of the type of quantity vs. what the variable  
represents. On the other hand the "as" conversion from phenoData to  
AnnotatedDataFrame simply copies the varLabels from the phenoData  
object into the labelDescription in the AnnotatedDataFrame,  
suggesting my interpretation: the labelDescription corresponds to the  
old-style varLabels.

Looking more closely at the code the new varLabels, varLabels<-  
methods makes sure that rownames(object at varMetadata) is equal to  
colnames(object at data), a kind of synchronization we never needed with  
the old class. Clearly it would be useful to have something doing  
this. I would personally have preferred to use "names" for this -  
more similarity with data.frame, and then varLabels for accessing the  
labelDescription.
I am not too sure how widespread the current use is outside of Biobase.

Well this ended being a far too long post about something relatively  
obscure, which is only confusing to me because of how it used to be.

Kasper