1

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.

Konrad Rudolph
  • 4,845
  • 14
  • 45
Nikita Vlasenko
  • 2,558
  • 3
  • 26
  • 38
  • 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? – llrs Dec 19 '17 at 07:45
  • Do you have a sample with all 0s? – Devon Ryan Dec 19 '17 at 07:46
  • 1
    Your code is different from another question you posted (here). Is this the same data/problem as in the linked question? – llrs Dec 19 '17 at 08:16
  • It is the same. Where is the difference? Can't see it. These are related but different questions, so I asked them separately. – Nikita Vlasenko Dec 19 '17 at 15:17

0 Answers0