constantAmateur / SoupX

R package to quantify and remove cell free mRNAs from droplet based scRNA-seq data
253 stars 34 forks source link

Counts 0 and soupest NaN during autoEstCont #50

Closed jamrute closed 3 years ago

jamrute commented 4 years ago

Hi,

Thanks a lot for making this lovely package!

I am trying to run SoupX on a scRNAseq dataset and am getting the following error: Error in quantile.default(soupProf$est, soupQuantile) : missing values and NaN's not allowed if 'na.rm' is FALSE. Here is the approach I am using:

  1. Running the Seurat workflow with cell cycle regression and SCTransform to get a processed Seurat object. Then performing dim reduction to annotate the clusters using UMAP/PCA. I am then saving this meta-data with the list of cells and their cluster annotations.
  2. Load in the filtered and raw matrices (CellRanger output) and keep the cells I annotated from (1) for the filtered and raw matrices
  3. Then running: sc = SoupChannel(tod, toc) sc = setClusters(sc, setNames(HDCM_meta$seurat_clusters, HDCM_meta_cells)) sc = autoEstCont(sc, soupQuantile=0.2)

When I run autoEstCont I get the error Error in quantile.default(soupProf$est, soupQuantile) : missing values and NaN's not allowed if 'na.rm' is FALSE. After checking the sc object, the counts are all 0 and the est are all NaN. Would appreciate any help! It seems like in the vignette, you guys do not do subset the cells from the raw and filtered matrices?

Thanks!

IraShch commented 3 years ago

Hey, I was having the same issue. It seems that empty droplets are used during estimation so unfiltered (all droplets) tod is required. Once I stopped filtering tod it worked.

jamrute commented 3 years ago

Thanks @IraShch - it worked now. For some reason I assumed that toc and tod need to be the same size.