Skip to content
Prev 7692 / 21312 Next

[Bioc-devel] Multiple colData in SummarizedExperiment

On 06/17/2015 11:41 AM, davide risso wrote:
Actually, colData() is a DataFrame, and a DataFrame column can contain a 
DataFrame. So after

   example(SummarizedExperiment)

we could make some faux sample quality data

   quality = DataFrame(x=1:6, y=6:1, row.names=colnames(se1))

add this as a column in the colData()

   colData(se1)$quality = quality

(or create the SummarizedExperiment from a similar DataFrame up-front) and 
manage our grouped data

 > colData(se1)
DataFrame with 6 rows and 2 columns
     Treatment     quality
   <character> <DataFrame>
A        ChIP    ########
B       Input    ########
C        ChIP    ########
D       Input    ########
E        ChIP    ########
F       Input    ########
 > colData(se1[,1:2])$quality
DataFrame with 2 rows and 2 columns
           x         y
   <integer> <integer>
A         1         6
B         2         5

I'm not sure that this is any less confusing to the end user than having to 
manage a DataFrameList(), but it does not require any new features.

Martin