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).
▾ Quoted text (5 lines)
m1 <- matrix(1:10, ncol = 2)
m2 <- m1
colnames(m2) <- c("A", "B")
se1 <- SummarizedExperiment(m1, colData = DataFrame(row.names = c("A",
"B")))
▾ Quoted text (2 lines)
se2 <- SummarizedExperiment(m2)
se3 <- SummarizedExperiment(m2, colData = DataFrame(row.names = c("C",
"D")))
▾ Quoted text (3 lines)
# colnames correctly set to c("A", "B") and stripped from assays
colnames(se1)
[1] "A" "B"
[,1] [,2]
[1,] 1 6
[2,] 2 7
[3,] 3 8
[4,] 4 9
[5,] 5 10
▾ Quoted text (1 line)
# colnames correctly set to c("A", "B") set and but not stripped from
assays
[1] "A" "B"
A B
[1,] 1 6
[2,] 2 7
[3,] 3 8
[4,] 4 9
[5,] 5 10
▾ Quoted text (1 line)
# colnames set to c("C", "D") (without warning about mismatch) and
stripped
▾ Quoted text (2 lines)
# from assays
se3 at assays[[1]]
[,1] [,2]
[1,] 1 6
[2,] 2 7
[3,] 3 8
[4,] 4 9
[5,] 5 10
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
Message-ID:
<CAB6GOe6Sd-p+C2XV0d9BhjPMuegtKO4Dv=z4k+PXPv6Yeg4O8Q@mail.gmail.com>
In-Reply-To:
<CAB6GOe60-pXLV5J=2+tUqNnXuzLvtQUhoWyNQiOTkfAk8orYAg@mail.gmail.com>