Last active
July 25, 2018 20:46
-
-
Save mikelove/8fb94c610b588d4a6a64848d3fcbdf76 to your computer and use it in GitHub Desktop.
SummarizedExperiment apparently missing validity check on re-assignment of rownames of rowData
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this is using SummarizedExperiment v1.11.5 | |
suppressPackageStartupMessages(library(SummarizedExperiment)) | |
m <- matrix(1:20, nrow=5, ncol=4, dimnames=list(letters[1:5], LETTERS[1:4])) | |
# this gives an error, good. | |
rowdata <- data.frame(x=1:5, row.names=letters[5:1]) | |
se <- SummarizedExperiment(m, rowData=rowdata) | |
# build the right way | |
rowdata <- data.frame(x=1:5, row.names=letters[1:5]) | |
se <- SummarizedExperiment(m, rowData=rowdata) | |
z <- rowData(se)[5:1,,drop=FALSE] | |
# so there's an problem: | |
all(rownames(se) == rownames(z)) | |
# yet this is allowed, bad. | |
rowData(se) <- z |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment