constantAmateur / SoupX

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

autoEstCont error : Error in quantile.default(soupProf$est, soupQuantile) : missing values and NaN's not allowed if 'na.rm' is FALSE #140

Open JS0715 opened 10 months ago

JS0715 commented 10 months ago

Hi Team,

Thanks for developing this tool. I am testing soupX on one of my dataset and getting the error Error in quantile.default(soupProf$est, soupQuantile) : missing values and NaN's not allowed if 'na.rm' is FALSE. Not sure what I am doing wrong. Can you please guide?

raw <- raw_seurat_objects

common_genes <- intersect(rownames(raw[[1]]), rownames(data_list[[1]])) raw[[1]]<- raw[[1]][rownames(raw[[1]]) %in% common_genes, ] data_list[[1]] <- data_list[[1]][rownames(data_list[[1]]) %in% common_genes, ]

sc <- SoupChannel(raw[[1]]@assays$RNA@counts, data_list[[1]]@assays$RNA@counts) sc <- setClusters(sc,data_list[[1]]$soup_group) sc <- autoEstCont(sc, doPlot = FALSE) out <- adjustCounts(sc, roundToInt = TRUE) This is my code

gianfilippo commented 10 months ago

Hi,

I had the same problem. Then I realized that the raw and filtered matrices from CellRanger are the same, probably because CellRanger removes empty droplets.

EDIT: CellRanger does not remove empty droplets in raw data.

The vignette paragraph "Profiling the soup" does seem to address this case and solves the error. Not sure, though, how well this works, though. Work in progress for me

Best

JS0715 commented 9 months ago

Hi,

I had the same problem. Then I realized that the raw and filtered matrices from CellRanger are the same, probably because CellRanger removes empty droplets.

EDIT: CellRanger does not remove empty droplets in raw data.

The vignette paragraph "Profiling the soup" does seem to address this case and solves the error. Not sure, though, how well this works, though. Work in progress for me

Best

@gianfilippo Did you have any success? I tried to debug the code and my understanding is there is cut-off for UMI (0,100) and if the data fails to have UMIS in the range then you get this error.

chiasinL commented 4 months ago

I am kind of late to the party - I ran into the same issue and solved it after reading issue #50. The solution is using the raw and filtered matrices from CellRanger instead of any custom filtered version.