I've seen the relative thread of renaming cells, if for example merging Seurats from different 10x experiments which will mean some barcodes will be overlapping. The issue I'm having is that I want to save as Matrix the counts of 6 clusters. I am trying this with the code below :
rawdata <- as.matrix(GetAssayData(Stromal, slot = "counts")[, WhichCells(Stromal, idents = c("1", "2", "3", "4", "5", "6"), slot = "counts")])
this gives me the following error :
Error in intI(j, n = x@Dim, dn[], give.dn = FALSE) : no 'dimnames[[.]]': cannot use character indexing
which I assume means I have duplicate cell names. So I would need to somehow rename the cells based on their cluster? is there a way to do is?
Or alternatively if I've got it wrong, is there a way around the above error? Thanks