Closed samgregoire closed 4 days ago
This is indeed unexpected... Did you try to use the latest code from the pending PR (#63)? I found a few bugs while unit testing, so it may be solved there. If you still get an error with the latest code, could you send me your modelled sce
object? That would facilitate debugging.
PR #63 has now been merged. Use
BiocManager::install("UCLouvain-CBIO/scp")
to install it.
It has also been pushed to Bioc (devel) and should become available in a day or two.
I still get a similar (altought slightly different) error with the updated version of the code:
Error in contrastMat %*% vcov[sel, sel] : non-conformable arguments
> traceback()
8: FUN(X[[i]], ...)
7: lapply(X = X, FUN = FUN, ...)
6: sapply(fits, function(fit) {
coef <- scpModelFitCoefficients(fit)
vcov <- scpModelFitVcov(fit)
levs <- scpModelFitLevels(fit)[[contrast[[1]]]]
if (length(levs) <= 1)
return(c(logFc = NA, se = NA))
contrastMat <- .levelsToContrastMatrix(contrast, levs)
sel <- grepl(contrast[[1]], names(coef))
logFc <- contrastMat %*% coef[sel]
se <- sqrt(contrastMat %*% vcov[sel, sel] %*% t(contrastMat))
c(logFc = logFc, se = se)
})
5: .contrastToEstimates(object, contrast, name)
4: FUN(X[[i]], ...)
3: lapply(contrasts, function(contrast) {
est <- .contrastToEstimates(object, contrast, name)
daTable <- .computeTTest(est$logFc, est$se, df, weights)
metadata(daTable)$contrast <- contrast
daTable[!is.na(daTable$Estimate), ]
})
2: .scpDifferentialAnalysisOnContrast(object, contrasts, name)
1: scpDifferentialAnalysis(sce, contrast = list(c("CellType", "CD38_neg",
"CD38_pos"), c("CellType", "CD38_neg", "LSC"), c("CellType",
"CD38_neg", "prog"), c("CellType", "CD38_pos", "LSC"), c("CellType",
"CD38_pos", "prog"), c("CellType", "LSC", "prog")))
You can download my modelled sce
object here.
Hello Sam!
Sorry, I finally took the time to look into the issue, and this was indeed due to a nasty little bug :sweat_smile:. The solution is provided through this PR.
You can install it with
BiocManager::install("UCLouvain-CBIO/scp", ref = "issue65")
Could you confirm it works for you as well?
It does! Thank you
I ran into this issue when using the
scpDifferentialAnalysis()
function.This is what I get when I run the traceback.
I couldn't find a solution myself. Do you have any idea what's going on here? If it helps, the dataset I'm using is from
scpdata::petrosius2023_AstralAML()
.