This is perhaps a question that is too simple, but I have been stuck on this for the past two hours.
I currently have a Seurat object and converted this into a data frame for further processing with another file. I need a certain pattern removed from the row names such that I am only left with the Cell IDs. Right now I have:
flox_1_TCAGAT-1
ko_1_TAGCAA-1
flox_2_TCAGAT-1
ko_2_TAGCAA-1
flox_3_TCAGAT-1
ko_3_TAGCAA-1
flox_4_TCAGAT-1
ko_4_TAGCAA-1
My approach has been:
rownames(df)<- sub("flox_1", " ", as.character(rownames(df)))
However when I reapply this again for flox_2, ko_1, ko_2, ko_3, etc. I receive the error:
Error in .rowNamesDF<-(x, value = value) :
duplicate 'row.names' are not allowed
Any other suggestions on how to mitigate this issue?
rstudio
seurat
scrna-seq