satijalab / seurat

R toolkit for single cell genomics
http://www.satijalab.org/seurat
Other
2.24k stars 902 forks source link

subscript out of bounds when merging #9198

Open ChrisSteel-bio opened 1 month ago

ChrisSteel-bio commented 1 month ago

I'm hoping someone might point me in the right direction. When I try and merge the two Seurat objects below, I get a subscript out of bounds error. I'm not sure if the incompatibility is a bug, or an error on my part in the processing.

. + > sce.combined An object of class Seurat 39093 features across 9913 samples within 3 assays Active assay: SCT (16070 features, 0 variable features) 3 layers present: counts, data, scale.data 2 other assays present: RNA, integrated 2 dimensional reductions calculated: pca, umap combo An object of class Seurat 35649 features across 9394 samples within 2 assays Active assay: SCT (15626 features, 3000 variable features) 3 layers present: counts, data, scale.data 1 other assay present: RNA 2 dimensional reductions calculated: pca, umap

merged_obj <- merge(x = sce.combined, y = combo)

Error in .subscript.2ary(x, , j, drop = drop) : subscript out of bounds

zskylarli commented 1 month ago

Hi - since sce.combined does not have any variable features set, I assume that you combined multiple SCTransformed objects. This could be related to a known bug that happens when SCTransform is run on an assay with multiple layers, aka for SCTAssay instances with more than one model. We are actively working on this error but in the meantime, one potential solution is creating subsets of only the shared features across all assays that you are trying to merge (in sce.combined and combo), and try to merge those subsetted objects. Thank you for your patience on this issue!