You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For purposes of anonymization I need to rename the cell-names which include the study number in our dataset.
I have a Seurat-object with test@assays$RNA$counts@Dimnames[2]) and test@assays$SCT$counts@Dimnames[2]) having for instance: "aab1.P2.299" "aab1.P2.311" "aab1.P2.315" "aab1.P2.318" "aab1.P2.319" "aab1.P2.321" "aab1.P2.322" "aab1.P2.338" "aab1.P2.349".
Here's what I did.
First, I got the list of original cell names in a new column:
test <- RenameCells(test, new.names = test@meta.data$new.cellname)
Here I assume the dimnames will be replaced throughout the SeuratObject, so at test@assays$RNA$counts, test@assays$RNA$data, test@assays$SCT$counts, and test@assays$SCT$data, but also at test@graphs$SCT_nn, and test@graphs$SCT_snn.
I get this error:
Error in new.cell.names.global[match(x = working.cells, table = old.names)] <- new.cell.names :
NAs are not allowed in subscripted assignments
I don't get this as far as I can see there aren't any 'NAs' in my new column.
I am not sure how to move forward from here. Any advice or suggestions would be great.
The text was updated successfully, but these errors were encountered:
For purposes of anonymization I need to rename the cell-names which include the study number in our dataset.
I have a Seurat-object with
test@assays$RNA$counts@Dimnames[2])
andtest@assays$SCT$counts@Dimnames[2])
having for instance:"aab1.P2.299" "aab1.P2.311" "aab1.P2.315" "aab1.P2.318" "aab1.P2.319" "aab1.P2.321" "aab1.P2.322" "aab1.P2.338" "aab1.P2.349"
.Here's what I did.
First, I got the list of original cell names in a new column:
Next, I split this column:
Then I created a new cellname:
Where
SampleID
is a new anonymized sample ID.Finally, I apply
RenameCell
.Here I assume the
dimnames
will be replaced throughout theSeuratObject
, so attest@assays$RNA$counts
,test@assays$RNA$data
,test@assays$SCT$counts
, andtest@assays$SCT$data
, but also attest@graphs$SCT_nn
, andtest@graphs$SCT_snn
.I get this error:
I don't get this as far as I can see there aren't any 'NAs' in my new column.
I am not sure how to move forward from here. Any advice or suggestions would be great.
The text was updated successfully, but these errors were encountered: