Closed silkezimm closed 2 years ago
Hi,
Not member of the dev team but hopefully can be helpful. The reason for the error is because cd.combined is not a meta data variable but a prefix that was added to cell names. You need to create meta.data column that can be used to split the object.
I'm not 100% sure I understand exactly the way you are trying to split the object but the method I show below can be easily changed to whatever you need.
One way this can be accomplished is by running the following just before running the SplitObject
call that threw the error. COLUMN_NAME can be replaced by whatever you would like to name the meta.data column.
# Get cell names
cd.combined_cell_names <- grep(pattern = "^cd.combined", x = colnames(ckd), value = T)
ab.combined_cell_names <- grep(pattern = "^ab.combined", x = colnames(ckd), value = T)
# Create new meta.data column
ckd@meta.data$COLUMN_NAME[colnames(ckd) %in% cd.combined_cell_names] <- "cd.combined"
ckd@meta.data$COLUMN_NAME[colnames(ckd) %in% ab.combined_cell_names] <- "ab.combined"
# Split the object
ckd.list <- SplitObject(ckd, split.by = "COLUMN_NAME")
Best, Sam
Hello, i am hoping someone can help me soon..
i am struggling with my snRNAseq data analysis using Seurat.
i have in total four objects: two are wildtype condition, two are treated group. i want to merge the wildtypes as one group and the treated as another group. i struggle with the IDs, since i want later to merge all four and then split by "conditions, treated and wildtype"... i always get error, will show my script in the following. can someone help me or even provide an example... basically i want to compare after split.by the wildtypes (2) with the treatment (2) group and create then clusters etc.. in the end you will see the occuring error... can someone help me>?
thank you so much.,,
a.data <- Read10X(data.dir = "D:/210619CKD-3vs1/c/")
silke 6889
silke2 7890
silke silke2 6889 7890