Additional question, simplified:

Assuming I have matrices M and Cov and I want to create a
SummarizedExperiment around them. What is the most efficient (least
copying) way of doing this. Currently I use
  assays = SimpleList(M = M, Cov = Cov)
  SummarizedExperiment(assays = assays, rowData, colData)
Also, any quick way of dealing with the case where I have 2-4 assays, with
some of them being NULL.  Currently, I use
  assays = SimpleList(M = M, Cov = Cov)
  assays = assays[!sapply(assays, is.null)]
  SummarizedExperiment(assays = assays, rowData, colData)

Best,
Kasper



On Tue, Jul 9, 2013 at 4:09 PM, Kasper Daniel Hansen <
kasperdanielhansen@gmail.com> wrote:

> Note the final "s" in assays.  It is super slow.  This is a BSseq object
> with 28M rows and 7 columns, which means there are two assays M and Cov
> each being 28M x 7 (which is pretty big, on the Gb scale)
>
> These two commands retrieve the same data as far as I understand.
>
> > system.time({BS@assays$field("data")})
>    user  system elapsed
>       0       0       0
> > system.time({assays(BS)})
>    user  system elapsed
>  19.677  10.436  30.114
>
> Follow up question:
>
> 1) It seems that all assays are stored in a SimpleList inside a reference
> class.  If I only want to replace one of the assays, like
>   assay(Object, "NAME") <- value
> does this mean that all assays are being copied?  Is this different from
> say eSet where each assay is a matrix in an environment?
>
> 2) I think we need a convenience function for the assay names of a
> SummarizedExperiment.  (This is how I saw the issue above, I was using
> names(assays(Object)))
>
> Kasper
>

	[[alternative HTML version deleted]]

