Understanding behaviour of SCTransform in Seurat
Entering edit mode
26 days ago

I have the following object:


An object of class Seurat 
17133 features across 215733 samples within 1 assay 
Active assay: RNA (17133 features, 0 variable features)
 65 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.18.2, counts.19.2, counts.1.3, counts.12.3, counts.13.3, counts.14.3, counts.15.3, counts.16.3, counts.17.3, counts.19.3, counts.2.1, counts.20.2, counts.21.2, counts.22.2, counts.23.2, counts.24.2, counts.27.2, counts.29.2, counts.2.3, counts.21.3, counts.22.3, counts.23.3, counts.25.3, counts.26.3, counts.27.3, counts.3.1, counts.3.2, counts.30.2, counts.31.2, counts.32.2, counts.33.2, counts.34.2, counts.36.2, counts.37.2, counts.30.3, counts.32.3, counts.33.3, counts.34.3, counts.35.3, counts.37.3, counts.38.3, counts.4.1, counts.4.2, counts.5.1, counts.5.2, counts.6.1, counts.6.2, counts.6.3, counts.7.1, counts.7.2, counts.7.3, counts.8.1, counts.8.2, counts.8.3, counts.9.1, counts.9.2

I then run SCTransform in the following command:

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

> sub.seurat

An object of class Seurat 
34266 features across 215733 samples within 2 assays 
Active assay: SCT (17133 features, 1500 variable features)
 3 layers present: counts, data, scale.data
 1 other assay present: RNA
 1 dimensional reduction calculated: pca

scale.data appears to be 6703 genes not the requested 1500 genes. On top of that, it is missing approximately 1/3 of the VariableFeatures() from the assay.

> table(VariableFeatures(sub.seurat, assay = "SCT") %in% rownames(sub.seurat[["SCT"]]@scale.data))

  580   920 

And finally it's flattened the layers of the object.

Is this expected behaviour or is this a bug?

I'm definitely leaning towards bug because I am also getting this message when running RunPCA()

Warning message:
In PrepDR(object = object, features = features, verbose = verbose) :
  The following 580 features requested have not been scaled (running reduction without them): CCL4, CHI3L1, SERPINE1, CCL5, CCL3, CNTNAP2, FN1, CLDN5, SKAP1, VWF, SGCZ, CD74, RGS6, NRG1, ANO2, CNTNAP5, HLA-DRA, TOP2A, BCAS1, GPC5, ST18, KCNQ3, NKAIN2, C1QB, APOC1, AC007682.1, IGFBP7, RGS1, C1QC,  [... truncated]
Seurat scRNASeq normalization • 196 views

Login before adding your answer.

Traffic: 1529 users visited in the last hour
Help About
Access RSS

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

Powered by the version 2.3.6