Skip to content

Commit 092cf56

Browse files
Matrix sum error for dgeMatrix, replace with dense
1 parent 4cafa5d commit 092cf56

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

R/sc.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ calculate_qc_metrics <- function(se, assay=NULL, log1p=TRUE, qc_vars=c()) {
118118
### check if logical
119119
vals = SummarizedExperiment::rowData(se)[[qcv]]
120120
if (is.logical(vals)) {
121-
tc_qc = setNames(Matrix::colSums(X[vals,]), NULL)
121+
tc_qc = setNames(Matrix::colSums(as.matrix(X[vals,,drop=FALSE])), NULL)
122122
SummarizedExperiment::colData(se)[[paste0("total_counts_", qcv)]] = tc_qc
123123
SummarizedExperiment::colData(se)[[paste0("pct_counts_", qcv)]] = 100 * tc_qc / cs
124124
if (log1p) {

0 commit comments

Comments
 (0)