Error in colSums(assay(sce)) : 'x' must be an array of at least two dimensions I am having a SingleCellExperiment (sce) object:


  sce &lt;- SingleCellExperiment(list(counts=UMI_count)) 


which has two dimensions:

dim(sce)
[1] 46761 68027


When I am trying to get column sums for all rows the following does not work:

colSums(assay(sce), na.rm = FALSE, dims = 1)


Giving me an error: 


  Error in colSums(assay(sce)) : 'x' must be an array of at least two dimensions


Apparently the issue was already described:

https://support.bioconductor.org/p/100954/

However, I can not find the solution. Is there another way of getting sums of columns of either SingleCellExperiment object or just dgcMatrix?
Ultimately I just implemented it manually with the precursor to SingleCellExperiment matrix (UMI_count which is dgcMatrix type) object in the following way:

# Removing genes with 0 - counts in all of the columns
num_removed = 0
for(i in 1:nrow(UMI_count)) {
  idx = i - num_removed
  if(sum(UMI_count[idx,]) &lt; 1) {
    UMI_count &lt;- UMI_count[-idx,]
    num_removed = num_removed + 1
    print(i)
  }
}

sce &lt;- SingleCellExperiment(list(counts=UMI_count))


I am getting sums of the columns for each row and then filtering out rows with the sum &lt; 1. So, sum function for the slices - rows (numeric type) is working.