How to get raw mRNA count from Seurat converted anndata
1
0
Entering edit mode
9 months ago

I converted Seurat data into Ann data using-

SaveH5Seurat(object, filename = "object.h5Seurat")
Convert("object.h5Seurat", dest = "h5ad")

Now I want to access the raw mRNA count (data should be non-negative values WITHOUT log transformation and scaling) in the anndata

I know in Seurat object this data is stored at object@assays$RNA@counts This data looks like this-

MIR1302-2HG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
FAM138A     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...... 
OR4F5       . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...... 
AL627309.1  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
AL627309.3  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...... 
AL627309.2  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...... 
AL627309.5  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......

How do I access the raw mRNA count data in anndata?

Thank you for your help

anndata Seurat • 1.0k views
ADD COMMENT
0
Entering edit mode
9 months ago
jv ★ 1.8k

I haven't worked with annData before nor do I use Python much, but it looks like the X attribute of annData stores the gene counts in sparse matrix form:

And it looks like the default assay of your seurat object is the assay that gets selected when converting an H5Seurat object:

# S3 method for h5Seurat
Convert(
  source,
  dest = "h5ad",
  assay = DefaultAssay(object = source),
  overwrite = FALSE,
  verbose = TRUE,
  ...
)

https://mojaveazure.github.io/seurat-disk/reference/Convert.html

ADD COMMENT

Login before adding your answer.

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