zhanghao-njmu / SCP

An end-to-end Single-Cell Pipeline designed to facilitate comprehensive analysis and exploration of single-cell data.
https://zhanghao-njmu.github.io/SCP/
GNU General Public License v3.0
351 stars 79 forks source link

Error in RunCellQC(srt = seu_obj) #171

Open WANGROUOYI opened 11 months ago

WANGROUOYI commented 11 months ago

May I ask how to solve this problem? Error in RunCellQC(srt = seu_obj) : The db_rate is equal to or greater than 1!

zhanghao-njmu commented 10 months ago

The default doublet rate is determined based on the number of input cells, using the formula db_rate = ncol(srt) / 1000 * 0.01. If the cell count surpasses 100,000, this would typically not be a standard single experiment. It appears that you might be using a merged Seurat object. I recommend installing the latest version of SCP and running RunCellQC with the batch parameter along with db_rate or db_coefficient manually (for instance, db_coefficient is 0.01 for 10X Genomics and 0.005 for Singleron GEXSCOPE).

chenhy-lab commented 9 months ago

I ran the RunCellQC function for my data, the percent.mito is the same value for all cells. The code: RunCellQC( srt = sce, UMI_threshold = 500, gene_threshold = 400, mito_threshold = 10, return_filtered = F )

chenhy-lab commented 9 months ago

percent.mito <- srt[[paste0(c("percent.mito", sp), collapse = ".")]] <- PercentageFeatureSet(object = srt, assay = assay, pattern = paste0("(", paste0("^", prefix, "-", mito_pattern), ")", collapse = "|"), features = mito_gene)[[1]] percent.ribo <- srt[[paste0(c("percent.ribo", sp), collapse = ".")]] <- PercentageFeatureSet(object = srt, assay = assay, pattern = paste0("(", paste0("^", prefix, "-", ribo_pattern), ")", collapse = "|"), features = ribo_gene)[[1]] percent.genome <- srt[[paste0(c("percent.genome", sp), collapse = ".")]] <- PercentageFeatureSet(object = srt, assay = assay, pattern = paste0("^", prefix))[[1]]

Here [[1]] seems to be the cause of the above error.