[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bioc-devel
Subject:    Re: [Bioc-devel] do SummarizedExperiments really need colnames?
From:       "Morgan, Martin" <Martin.Morgan () roswellpark ! org>
Date:       2015-12-13 19:21:19
Message-ID: DF23DAC5A53912408040FF04D8B780AAE3D95A () EXMB3RSC ! roswellpark ! org
[Download RAW message or body]

Thanks Peter and Aaron.

For SummarizedExperiment 1.1.9 in svn now:

For Aaron's original issue, SummarizedExperiment now allows construction from NULL \
colnames; it does not construct colnames.

The behavior of SummarizedExperiment with respect to colnames is to use and keep them \
if provided, but not to add colnames to assays if they are absent -- they are \
provided in the constructor to se2, so present in the assay in se2.

The inconsistency between assay colnames and colData rownames in the constrution of \
se3 is now (and should have been before) an error.

> assay = matrix(0, 2, 3, dimnames=list(NULL, LETTERS[1:3]))
> colData = DataFrame(row.names=letters[1:3])
> SummarizedExperiment(assay, colData=colData)
Error in FUN(X[[i]], ...) : 
  assay colnames() must be NULL or equal colData rownames()

Thanks for the feed back / bug reports; please let me know if there are additional \
issues. ________________________________________
From: Peter Hickey [peter.hickey@gmail.com]
Sent: Sunday, December 06, 2015 7:56 PM
To: Morgan, Martin
Cc: alun@wehi.edu.au; bioc-devel@r-project.org
Subject: Re: do SummarizedExperiments really need colnames?

While on the topic of SummarizedExperiment colnames, the circumstances in which these \
are stripped from the assays and overridden by colData is confusing to me, \
particularly case 2 below (a warning in case 3 might be useful too).

> m1 <- matrix(1:10, ncol = 2)
> m2 <- m1
> colnames(m2) <- c("A", "B")
> 
> se1 <- SummarizedExperiment(m1, colData = DataFrame(row.names = c("A", "B")))
> se2 <- SummarizedExperiment(m2)
> se3 <- SummarizedExperiment(m2, colData = DataFrame(row.names = c("C", "D")))
> 
> # colnames correctly set to c("A", "B") and stripped from assays
> colnames(se1)
[1] "A" "B"
> se1@assays[[1]]
[,1] [,2]
[1,] 1 6
[2,] 2 7
[3,] 3 8
[4,] 4 9
[5,] 5 10
> # colnames correctly set to c("A", "B") set and but not stripped from assays
> colnames(se2)
[1] "A" "B"
> se2@assays[[1]]
A B
[1,] 1 6
[2,] 2 7
[3,] 3 8
[4,] 4 9
[5,] 5 10
> # colnames set to c("C", "D") (without warning about mismatch) and stripped
> # from assays
> se3@assays[[1]]
[,1] [,2]
[1,] 1 6
[2,] 2 7
[3,] 3 8
[4,] 4 9
[5,] 5 10

> sessionInfo()
R Under development (unstable) (2015-11-28 r69714)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.5 (Yosemite)

locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8

attached base packages:
[1] stats4 parallel stats graphics grDevices utils datasets
[8] methods base

other attached packages:
[1] SummarizedExperiment_1.1.5 Biobase_2.31.1
[3] GenomicRanges_1.23.4 GenomeInfoDb_1.7.3
[5] IRanges_2.5.9 S4Vectors_0.9.11
[7] BiocGenerics_0.17.2

loaded via a namespace (and not attached):
[1] zlibbioc_1.17.0 XVector_0.11.1



This email message may contain legally privileged and/or confidential information.  \
If you are not the intended recipient(s), or the employee or agent responsible for \
the delivery of this message to the intended recipient(s), you are hereby notified \
that any disclosure, copying, distribution, or use of this email message is \
prohibited.  If you have received this message in error, please notify the sender \
immediately by e-mail and delete this email message from your computer. Thank you. \
_______________________________________________ Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic