Seurat - weird behavior in the counts object.
1
0
Entering edit mode
4.1 years ago
tleilaxu • 0

So I've been trying to learn some Seurat recently and while working on some data I noticed that there's a discrepancy between the library size for a given cell in my raw count matrix (i.e. unnormalized and including only those genes not filtered out by Seurat when creating the Seurat object) and the library size for the same cell in the seurat_object[['RNA']@counts object, i.e. the cell in the counts object always seems to have a bigger library size for some reason. I couldn't find anything in the documentation that describes this and I don't know how to view the source-code since printing out the function in the R console just gives me UseMethod(generic = "NormalizeData", object = object) Any of you guys know what might be happening?

RNA-Seq Seurat single-cell RNA-seq • 989 views
ADD COMMENT
1
Entering edit mode
4.1 years ago
igor 13k

The library size differences are probably due to filtering. Genes and cells with few values are removed by default in CreateSeuratObject().

I find it easiest to trace the function code in their GitHub. For example: https://github.com/satijalab/seurat/search?q=NormalizeData&unscoped_q=NormalizeData In this case, there are multiple versions of NormalizeData() based on your object type.

ADD COMMENT
0
Entering edit mode

Yeah you're right. I checked the library size ratios for all cells in my raw matrix (with all genes) and the seurat counts and it's mostly one or a bit below one. So I guess that it store the original library size for normalizing the values, which makes sense, although I have no idea why it sometimes stores a library size slightly lower. I briefly looked at some of the code in their github that you kindly linked, but I think I will just trust that Seurat does something clever here...

ADD REPLY

Login before adding your answer.

Traffic: 2033 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