PaulingLiu / ROGUE

Assessing the purity of single cell population
BSD 3-Clause "New" or "Revised" License
108 stars 14 forks source link

Issue caused by No significant gene #14

Open Rong-ao opened 3 months ago

Rong-ao commented 3 months ago

I got an error Error in expr[i, ] : subscript out of bounds when I was trying to apply function rogue() to my cell clusters. I tried to traced what happened in this function and found an issue in function ent.toli(). This function was used in rogue() code: tmp.res <- ent.toli(tmp.res, tmp.matr, span = span, r = r, n = remove.outlier.n)

In ent.toli(), the issue was caused by code below: sig.gene <- ent %>% dplyr::filter(p.adj < 0.05) %>% dplyr::pull(Gene) ng <- length(sig.gene) expr <- expr[sig.gene,] When I check tmp.res of my cell cluster, I found there is no gene with p.adj < 0.05, causing sig.gene is an empty list and make expr[sig.gene,] an error.

So I have some questions here:

  1. How should I understand no gene with p.adj < 0.05 in a cluster? (I think they are not informative genes...right? I am a little bit confused about 'informative gene' actually.)
  2. The function ent.toli() is to remove outlier cells before calculating ROGUE as you mentioned in code. Is that necessary?
  3. Should I skip ent.toli() step manually when I have this issue?

Thanks for your help! :)

Felix-Xie commented 1 month ago

getting the same error and confused as to what no gene with p.adj < 0.05 indicates

Rong-ao commented 1 month ago

@Felix-Xie I tried to manually skip those 3 lines of codes in ent.toli() to avoid this bug, which means that using all genes rather than filtered genes to calculate ROGUE index. It also works. Actually this issue only occured in one cluster with high heterogeneity in my scRNA data, so I guess p.adj < 0.05 indicate the gene expression pattern in one cluster is too noisy than expectation.