This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Seurat orig.ident

HI,

I would like to set-up the orig.ident in the seurat object using the barcodes ID.

I was trying something like that:

matobj<-CreateSeuratObject(mat, min.cells = 100, min.features = 200, names.field = 1, names.delim = '_', assay = "RNA")

but the output for some reason instead to be 001C is seuratproject,

                                                orig.ident nCount_RNA nFeature_RNA
001C_AAACCTGCATCGGGTC SeuratProject       5477         2150
001C_AAACCTGTCAACACCA SeuratProject      20309         4724
001C_AAACCTGTCACAGTAC SeuratProject       1390          881
001C_AAACCTGTCTGTCTAT SeuratProject       3965         1940

thanks Carlos

seurat barcodes orig.ident

1 answer

Hello Carlos, please try the following:

matobj$orig.ident <- NULL
matobj$orig.ident <- gsub("_*","",rownames(matobj[[]]))

let me know if it works.

An alternative is when you create the Seurat object, make sure you use the project parameter.

matobj<-CreateSeuratObject(mat, 
                           min.cells = 100, 
                           min.features = 200, 
                           names.field = 1, 
                           names.delim = '_', 
                           assay = "RNA", 
                           project = "001C")

Also as a small suggestion just heads up with having rownames starting with numeric values - it can be problematic down the road if you are extensileyt using the meta data.

Log in to answer this question.