Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msqrob() breaks when analysing a set that contains a subset of cells #59

Open
cvanderaa opened this issue Apr 26, 2024 · 0 comments
Open

Comments

@cvanderaa
Copy link
Contributor

cvanderaa commented Apr 26, 2024

Reproducible example:

se1 <- SummarizedExperiment(assays = matrix(100, 10, 10, dimnames = list(letters[1:10], LETTERS[1:10])))
se2 <- SummarizedExperiment(assays = matrix(50, 10, 5, dimnames = list(letters[1:10], LETTERS[6:10])))
cd <- DataFrame(foo = paste0("bar", rep(1:2, 5)), row.names = LETTERS[1:10])
qf <- QFeatures(experiments = List(set1 = se1, set2 = se2), colData = cd)

msqrob(qf, i = "set1",  formula = ~ foo)
## Works ok

msqrob(qf, i = "set2",  formula = ~ foo)
## Breaks

msqrob(qf[, , "set2"], i = "set2",  formula = ~ foo)
## Works ok

set2 contains a subset of samples in set1. The function breaks because de colData is not correctly retrieved here:

data = droplevels(colData(object)),
and
data = droplevels(colData(object)),

I would suggest to first extract (within the msqrob()method) the set of interest with getWithColData(), which will automatically manage the colData.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant