Closed mj-jimenez closed 1 year ago
Actually, it is due to all cells in a cluster having NaN
values for a signature. To solve this there are several approaches:
bcScore
. Right now, it has to be done as part of regression. We should separate these two functions.NaN
s to 0 within bcRanks
(to compute the residuals).NaN
to 0s (related to #113).Any news on this front @mj-jimenez ?
This error appears in bcRanks
but it is caused by the NaN
values introduced when creating the beyondcell object. As said in #113, the best practice right now is this work-around until we update the bcScore
function:
# Beyondcell object with a lot of NaN values
bcobj <- bcScore(sc, SSc, expr.thres = 0.1)
# Filter out spots with a high percentage of NAs
bcobj.filtered <- bcSubset(bcobj, nan.cells = 0.95)
# Replace NAs by 0s
bcobj.filtered@normalized[is.na(bcobj.filtered@normalized)] <- 0
bcobj.recomputed <- bcRecompute(bcobj.filtered, slot = "normalized")
Also, this problem is signature related (i.e. most of the genes in the signatures are not found in the expression matrix). This happened in beyondcell v2.0, which contained a high proportion of non-coding genes. Since beyondcell v2.1, the signatures only contain coding genes, thus this error is unlikely to happen with a standard single-cell experiment.
bcRanks
returns the following error:I think it is due to bad cell subsetting.