satijalab / seurat

R toolkit for single cell genomics
http://www.satijalab.org/seurat
Other
2.31k stars 919 forks source link

"The following N features requested have not been scaled" warning after running SCTransform #8909

Open wudustan opened 6 months ago

wudustan commented 6 months ago

I have the following Seurat v5 object:

An object of class Seurat 
15130 features across 215733 samples within 1 assay 
Active assay: RNA (15130 features, 0 variable features)
 130 layers present: counts.1.1, counts.10.1, counts.11.2, counts.12.2, counts.13.2, counts.14.2, counts.15.2, counts.16.2, counts.17.2, ... , counts.9.2, 

I then run:

sub.seurat <- SCTransform(sub.seurat,
                          assay = "RNA", 
                          new.assay.name = "SCT",
                          variable.features.n = 1500,
                          vars.to.regress = c("pMitochondrial_RNA", "Cycle.Score"))

And when I want to run RunPCA():

Warning message:
In PrepDR(object = object, features = features, verbose = verbose) :
  The following 577 features requested have not been scaled (running reduction without them): CCL4, CHI3L1, SERPINE1, CCL5, CCL3, FN1, CNTNAP2, SKAP1, CLDN5,  [... truncated]

The object that comes out of SCTransform():

An object of class Seurat 
30260 features across 215733 samples within 2 assays 
Active assay: SCT (15130 features, 1500 variable features)
 3 layers present: counts, data, scale.data
 1 other assay present: RNA

I can run:

>table(sub.seurat[["SCT"]]@var.features %in% rownames(sub.seurat[["SCT"]]@scale.data))
FALSE  TRUE 
  577   923 
> nrow(sub.seurat@assays$SCT@scale.data)
[1] 6711

Is this a bugor intented behaviour?

Why is the scale.data object 6711 genes in size and not 1500 like the requested variable.feature.n? Why are the Layers joined instead of separate? Why are the 1500 variable genes not all included in the scale.data?

Labyadh commented 4 months ago

Hello, I have the same issue as you

Did someone remply to you Thank's for advance

wudustan commented 4 months ago

@Labyadh No sorry I don't have any insight but also I haven't checked recently. I ended up just going back to Seurat v3 format analysis using options(Seurat.object.assay.version = "v3") because I had established scripts for that and some of the newer functionality of v5 seems to still be in development.

yecotoo commented 4 months ago

meet the error too, how to fix it?