How to get raw mRNA count from Seurat converted anndata
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
• 2,513 views
•
link
1 answer
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:
- https://anndata.readthedocs.io/en/latest/generated/anndata.AnnData.X.html
- https://anndata.readthedocs.io/en/latest/generated/anndata.AnnData.html
- https://anndata.dynverse.org/
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
• 0 views
•
link
Log in to answer this question.