welch-lab / liger

R package for integrating and analyzing multiple single-cell datasets
GNU General Public License v3.0
392 stars 78 forks source link

NaNs during `SelectGenes()` #294

Closed shaniAmare closed 8 months ago

shaniAmare commented 1 year ago

Hi team,

I have been using rliger for all my integrations. But the recent attempt I made with the latest github version is giving me this warning during the selectGenes() function.

a.NucSeq <- selectGenes(a.NucSeq, do.plot=FALSE)
Warning messages:
1: In sqrt(gene_expr_mean * nolan_constant/ncol(object@raw.data[[i]])) :
  NaNs produced
2: In selectGenes(a.NucSeq, do.plot = FALSE) : NaNs produced
3: In sqrt(gene_expr_mean * nolan_constant/ncol(object@raw.data[[i]])) :
  NaNs produced
4: In selectGenes(a.NucSeq, do.plot = FALSE) : NaNs produced

I don't know whether this can cause downstream issues. Only wanted to let you know that this behaviour was not present in the previous versions.

Many thanks, Shani.

mvfki commented 1 year ago

Hi Shani,

Thanks for reporting this. From what I know so far, a negative value given to functions like sqrt() or log() causes an NaN. So back to the specific step as shown in your warning message. I would need some exploration in order to debug it.

If these are not the case, I'll need some more investigation then.

Best, Yichen