Add a new layer to a seurat object. #9469
Unanswered
abraham-abin13
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I want to add a new "layer" to a seurat object. Please note i am working with spatial visium data.
Specifically, it is the gene expression data that is corrected in a specific way. While this can be done like so:
this_seu_obj[["Spatial"]]$test <- this_seu_obj[["Spatial"]]$counts
This create a new layer of class "matrix". Moreover, this matrix, does not store row or column names. Therefore, how does seurat now which spot (Visium data) or which gene the values in this matrix refers to?
When you create a new layer using the following command, it is of class "dgCMatrix" which seems to hold more information that just the counts:
this_seu_obj[["Spatial"]]$test <- NormalizeData(this_seu_obj[["Spatial"]]$counts)
Essentially, out of the 20,000 genes in my original seurat object, I have filtered out a subset of 2,000 and normalized their expression using a different R package. I would like to put these bespoke normalized values in to the seurat object and use those values for plotting.
Thank you - Abin
Beta Was this translation helpful? Give feedback.
All reactions