1
$\begingroup$

While trying to run the following code in R:

list_of_sce <- list()
# Looping though the UMI_count 'split_factor' columns at a time
split_factor = 500
for(i in seq(1,ncols, split_factor)) {
  num_loop = floor(i / split_factor) + 1
  idx = ncols
  if (i + split_factor < ncols) {
    idx = i + split_factor
  } 
sce <- SingleCellExperiment(list(counts=UMI_count[, i : idx]))
# Normalization of the dataset containing 
# heterogenous cell data (different cell types)
clusters <- quickCluster(sce)
sce <- computeSumFactors(sce, cluster=clusters)
list_of_sce[[num_loop]] <- sce
}

I am getting the error:

Error in .computeSumFactors(assay(x, i = assay.type), subset.row = 
subset.row,  : 
cells should have non-zero library sizes

There are warnings, so when I run warnings() command I see the following:

> warnings()
Warning messages:
1: In .computeSumFactors(assay(x, i = assay.type), subset.row = 
subset.row,  ... :
encountered negative size factor estimates
2: In .computeSumFactors(assay(x, i = assay.type), subset.row = 
subset.row,  ... :
encountered negative size factor estimates
3:...
...
39:....

I do not understand why is this happening, and how to debug it. Any suggestions would be greatly appreciated.

$\endgroup$
4
  • $\begingroup$ What is the library size of the samples? computeSumFactors is failing because it can't compute the library size. I am not sure if your code is working as intended, shouldn't the sce be inside your loop? $\endgroup$
    – llrs
    Dec 19 '17 at 7:45
  • $\begingroup$ Do you have a sample with all 0s? $\endgroup$
    – Devon Ryan
    Dec 19 '17 at 7:46
  • 1
    $\begingroup$ Your code is different from another question you posted (here). Is this the same data/problem as in the linked question? $\endgroup$
    – llrs
    Dec 19 '17 at 8:16
  • $\begingroup$ It is the same. Where is the difference? Can't see it. These are related but different questions, so I asked them separately. $\endgroup$ Dec 19 '17 at 15:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.