LTLA / scuttle

Clone of the Bioconductor repository for the scuttle package.
https://bioconductor.org/packages/devel/bioc/html/scuttle.html
9 stars 7 forks source link

summarizeAssayByGroup output has NULL colnames when ids is a DataFrame #25

Closed alanocallaghan closed 11 months ago

alanocallaghan commented 11 months ago

From example(summarizeAssayByGroup). Is this intended behaviour?

example_sce <- mockSCE()
ids <- sample(LETTERS[1:5], ncol(example_sce), replace=TRUE)
out <- summarizeAssayByGroup(example_sce, ids)

# this is fine
colnames(out)
# [1] "A" "B" "C" "D" "E"

batches <- sample(1:3, ncol(example_sce), replace=TRUE)
out2 <- summarizeAssayByGroup(example_sce, 
      DataFrame(label=ids, batch=batches))

# no colnames because .create_coldata output has no rownames
colnames(out2)
# NULL
LTLA commented 11 months ago

I think so; I didn't try to construct a column name from unique combinations. I suppose we could just paste0 the columns together, if people are relying on some column names (but that might not be guaranteed to be unique, e.g., if there is one combination of A_B + C and another combination of A + B_C and you did the paste0 with a _ separator).

alanocallaghan commented 11 months ago

Interesting, pretty much what I was thinking. Came across it in https://github.com/alanocallaghan/scater/issues/200, and I'm now left wondering how long this has been broken/if it ever worked as intended. Cheers