Question: Seurat - weird behavior in the counts object.
0
gravatar for tleilaxu
9 months ago by
tleilaxu0
tleilaxu0 wrote:

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?

ADD COMMENTlink modified 9 months ago by igor12k • written 9 months ago by tleilaxu0
1
gravatar for igor
9 months ago by
igor12k
United States
igor12k wrote:

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 COMMENTlink modified 9 months ago • written 9 months ago by igor12k

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 REPLYlink modified 9 months ago • written 9 months ago by tleilaxu0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2233 users visited in the last hour
_