Instructions on Vignettes, "merged_obj[["RNA"]] <- JoinLayers(merged_obj)" is wrong
zonghongz opened this issue · comments
Issue Description
merged_obj[["RNA"]] <- JoinLayers(merged_obj)" is wrong, see below, although I don't know the differences between command 4 and command 5, they worked. Command 3 from Vignettes of seurat did not work. BTW, I would appreciate if someone can explain what difference between command 4 and 5
- merged_seuratObj = merge(x = list_seurat_keep[[1]], y = list_seurat_keep[-1]) 2. merged_seuratObj_test = merged_seuratObj
- merged_seuratObj_test[["RNA"]] = JoinLayers(merged_seuratObj_test)
Error in [<-.data.frame(tmp, , i, value = new("Seurat", assays = list( :
replacement has 38606 rows, data has 36424 - merged_seuratObj_test = JoinLayers(merged_seuratObj_test)
- merged_seuratObj_test[["RNA"]] = JoinLayers(merged_seuratObj_test[["RNA"]])
Hi,
I am assuming your command "3" above is actually command "4" you referred to. Basically, JoinLayers()
is a function that can be applied to the entire Seurat object or just an assay (e.g., your RNA
assay) inside an object. Both command 4 and 5 are correct, but just used in 2 different cases. Command 4 will try to join all the layers in every assay of your object, while command 5 will only join the layers in your RNA
assay. Which one to use depends on your need. If your object only contains the RNA
assay, command 4 and 5 are the same.