Unexplainable missing values in single cell Seurat object
0
0
Entering edit mode
10 weeks ago
Gerard ▴ 10

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

seurat single-cell • 947 views
ADD COMMENT
0
Entering edit mode

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 (all(c(NA,1) == 1)) 1
Error in if (all(c(NA, 1) == 1)) 1 :
missing value where TRUE/FALSE needed

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.

  • Did you filter your data matrix outside of Seurat or did you set some values to NA?
  • Is the feature present in your count matrix even?
  • Extract the raw cell data for that gene.
  • Check the cell-ranger count matrix and look for the values for that feature.
ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

How did you import that? Please post the commands to load the data.

ADD REPLY
0
Entering edit mode
raw_counts <- seurat_object@assays$RNA@features["geneofinterest", , drop = FALSE]
raw_counts_df <- as.data.frame(raw_counts)
print(raw_counts_df)

Which gives TRUE for some counts, FALSE for others

Any other gene gives "TRUE" for every count as far as I can see

ADD REPLY
0
Entering edit mode

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:

  dat <- Read10X_h5('outs/filtered_feature_bc_matrix.h5')
  so <-  CreateSeuratObject(counts=dat,
                            min.cells=10,
                            min.features=300)
ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

A similar case has been discussed in the following GitHub issue.

https://github.com/satijalab/seurat/issues/6285

ADD REPLY

Login before adding your answer.

Traffic: 2142 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6