-
|
Hi, I am very new to Seurat and I am trying to use it to calculate variance of gene expression from scRNA 10x data, in particular, residual variance or what used to be standartised vst.variance in the previous version. However, I am struggling to get the meta.data assay in seurat_object. This is that I am trying to do: Load scRNA-seq data framescRNA = read.table('file.csv', header = T, stringsAsFactors = F, sep = ',') rownames(scRNA) = scRNA$REV scRNA = select(scRNA, -REV) scRNA = as.matrix(scRNA) Perform variance stabilization using seurat -----------------------seurat_object <- CreateSeuratObject(counts = scRNA, min.cells = 10, min.features = 200) seurat_object <- SCTransform(seurat_object, verbose = T) And I get seurat_object that looks like this:
RNA@meta.data and SC@meta.features are empty. I also tried running the old method: seurat_obj_vst <- NormalizeData(seurat_object, seurat_obj_vst <- FindVariableFeatures( I really can't figure out if I am doing something wrong or where to extract the residual variance info from in the new Seurat version. I am using Seurat 5.2.1. I would really appreciate your help with issue! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
I figured out how to do it with v3 Seurat object: options(Seurat.object.assay.version = "v3") seurat_object <- CreateSeuratObject(counts = scRNA, min.cells = 10, min.features = 200) seurat_object <- NormalizeData(seurat_object) seurat_object <- FindVariableFeatures(seurat_object) seurat_object <- ScaleData(seurat_object) variance_data <- seurat_object@assays[["RNA"]]@meta.data |
Beta Was this translation helpful? Give feedback.

I figured out how to do it with v3 Seurat object:
options(Seurat.object.assay.version = "v3")
seurat_object <- CreateSeuratObject(counts = scRNA, min.cells = 10, min.features = 200)
seurat_object <- NormalizeData(seurat_object)
seurat_object <- FindVariableFeatures(seurat_object)
seurat_object <- ScaleData(seurat_object)
variance_data <- seurat_object@assays[["RNA"]]@meta.data