How can I add new column into Metadata of Seurat.obj in Xenium analysis
0
0
Entering edit mode
7 months ago
geno89 ▴ 20

I want to add a column containing cell type (ct) information into my Seurat object whether in Metadata or in ident type so i can colour plot them in my DIMplots. Following is the data frame (meta) i have. I am working with Xenium data. I tried doing

AddMetaData(object = xenium.obj, metadata = meta, col.name = 'cell.type')
Error in `[[<-`:
! None of the meta data requested was found in the data frame
Run `rlang::last_trace()` to see where the error occurred.

enter image description here

seurat xenium spatial transcriptomics • 689 views
ADD COMMENT
1
Entering edit mode

If your dataframe is named meta, this should work :

xenium.obj[rownames(meta), "cell.type"] <- meta[,"ct"]
ADD REPLY

Login before adding your answer.

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