Replies: 1 comment 2 replies
-
This went through quite a bit of discussion back in the day, because there are opposing perspectives on what rownames and colnames should return and it's still not clear to me that there's a right answer. As a guide we turned to SummarizedExperiment as much as possible, and SummarizedExperiment does require Like you point out, for a SE, suppressPackageStartupMessages(library(SummarizedExperiment))
mat <- matrix(rpois(10000, 5), nrow=10)
rownames(mat) <- paste0("CD", seq_len(nrow(mat))) # made-up markers
colnames(mat) <- paste0("BARCODE_", seq_len(ncol(mat))) # made-up barcodes
# First building the SE. Assuming that barcodes come from a range of donors.
donor <- rep(LETTERS[1:10], each=100)
se <- SummarizedExperiment(list(counts=mat))
se$Donor <- donor rownames(se)
#> [1] "CD1" "CD2" "CD3" "CD4" "CD5" "CD6" "CD7" "CD8" "CD9" "CD10"
rownames(colData(se))
#> [1] "BARCODE_1" "BARCODE_2" "BARCODE_3" "BARCODE_4"
#> [5] "BARCODE_5" "BARCODE_6" "BARCODE_7" "BARCODE_8"
## (cut) |
Beta Was this translation helpful? Give feedback.
-
This is not expected:
What I really want requires an unintuitive extra step:
I don't understand why these two calls are different. If the
colData
of an object has row names, those should be thecolnames
of the object by definition. If I wanted the column names of the individual SEs, I'd look them up individually.Beta Was this translation helpful? Give feedback.
All reactions