Hello,
While working on Seurat objects, I noticed a problem with some genes.
When I try to run a violin plot on them, I get the following error :
Error in if (all(data[, feature] == data[, feature][1])) { :
missing value where TRUE/FALSE needed
Warning : 1: Removing 70790 cells missing data for features requested 2: Removing 70790 cells missing data for vars requested
When I try a FeaturePlot on the same gene, instead of appearing grey it appears in dark grey for some reason, as if the value was missing.
I only get this thing on a handful of genes out of the thousands available, but this is problematic.
From what I understood in my research this would be linked to NA values, but isn't it weird that this happens on the exact same genes in two different datasets from two different projects?
Is there any way to fix this or is it a technical issue from the sequencing itself?
Thank you very much in advance
I'd say this is either and implementation error or bug in the Seurat function you are using or you need to find out why you have NA in your data, or both. For explanation, the situation is similar to this simple case causing the same exception.
If the function ever needed to expect NA in the data matrix, the NA case would have to be treated differently. The other question is then: why would you have NA's in your counts? Features with no counts should have 0 not NA.
I extracted the raw counts and indeed there are some NAs in there ... Any idea why ? Or more specifically, some counts return "TRUE" and some others "FALSE"
I didn't filter anything outside of Seurat
How did you import that? Please post the commands to load the data.
Which gives TRUE for some counts, FALSE for others
Any other gene gives "TRUE" for every count as far as I can see
That would print a big mess on screen, but I don't get why there would be logical values instead of numeric values at all.
Therefore, I was asking how you created your Seurat object. You must have done something like:
Oh, sorry.
I created individual Seurat objects with Read10x (reading filtered matrixes) and CreateSeuratObject(min.cells = 3, min.features = 200), then merged these objects and run a standard pipeline including SketchData downsampling to allow the computer to cope with the number of cells. I think I had also tried on an individual unmerged object without the downsampling and the same problem was there.
A similar case has been discussed in the following GitHub issue.
https://github.com/satijalab/seurat/issues/6285