Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After integrate two object, and then split then, there are something wrong with Cells() function #9572

Open
tangmindan opened this issue Dec 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@tangmindan
Copy link

Hi, when I try to split an object from an integrate object and then rename its cell names, I've got an error which hints the length difference between Cells(split_object) and rownames([email protected])

# insert reproducible example here
opt$input <- "object1.rData,object2.rData"
data <- unlist(strsplit(opt$input,","))
object_merge <- list()
for (i in 1:length(data)){
	load(data[i])
	object_merge[[i]] <- get("object") 
}
object_merged <- Reduce(function(x, y) merge(x, y), object_merge)
object <- object_merged
integrate_obj <- IntegrateLayers(object = object, method = "RPCAIntegration", orig.reduction = "pca", new.reduction = integrate_name,
    verbose = FALSE)
integrate_obj <- FindNeighbors(integrate_obj, reduction = integrate_name, dims = 1:20,nn.method = "rann")
integrate_obj <- FindClusters(integrate_obj, verbose = FALSE,resolution=res,algorithm = 1)
integrate_obj <- RunUMAP(integrate_obj, reduction = "integrated.RPCA", dims = 1:pca_dim,n.neighbors=15,min.dist=0.1)
object <- integrate_obj 
ifnb_list <- SplitObject(object, split.by = "orig.ident")
length(rownames(ifnb_list[[1]]@meta.data))
length(Cells(ifnb_list[[1]]))
cell_name <- substr(rownames(ifnb_list[[1]]@meta.data), 1, 21)
object <- RenameCells(ifnb_list[[1]], new.names=cell_name)
cell_name <- substr(Cells(ifnb_list[[1]]), 1, 21)
object <- RenameCells(ifnb_list[[1]], new.names=cell_name)
sessionInfo()
R version 4.4.0 (2024-04-24)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 22.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0 
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

locale:
 [1] LC_CTYPE=zh_CN.utf8       LC_NUMERIC=C             
 [3] LC_TIME=zh_CN.utf8        LC_COLLATE=zh_CN.utf8    
 [5] LC_MONETARY=zh_CN.utf8    LC_MESSAGES=zh_CN.utf8   
 [7] LC_PAPER=zh_CN.utf8       LC_NAME=C                
 [9] LC_ADDRESS=C              LC_TELEPHONE=C           
[11] LC_MEASUREMENT=zh_CN.utf8 LC_IDENTIFICATION=C      

time zone: Asia/Aden
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] RColorBrewer_1.1-3 tidyr_1.3.1        dplyr_1.1.4        glue_1.7.0        
 [5] patchwork_1.2.0    qs_0.26.3          ggplot2_3.5.1      Seurat_5.1.0      
 [9] SeuratObject_5.0.2 sp_2.1-4          

loaded via a namespace (and not attached):
  [1] deldir_2.0-4           pbapply_1.7-2          gridExtra_2.3         
  [4] rlang_1.1.4            magrittr_2.0.3         RcppAnnoy_0.0.22      
  [7] matrixStats_1.3.0      ggridges_0.5.6         compiler_4.4.0        
 [10] spatstat.geom_3.3-2    systemfonts_1.1.0      png_0.1-8             
 [13] vctrs_0.6.5            reshape2_1.4.4         stringr_1.5.1         
 [16] crayon_1.5.3           pkgconfig_2.0.3        fastmap_1.2.0         
 [19] labeling_0.4.3         utf8_1.2.4             promises_1.3.0        
 [22] ragg_1.3.2             purrr_1.0.2            jsonlite_1.8.8        
 [25] goftest_1.2-3          later_1.3.2            spatstat.utils_3.0-5  
 [28] irlba_2.3.5.1          parallel_4.4.0         cluster_2.1.6         
 [31] R6_2.5.1               ica_1.0-3              stringi_1.8.4         
 [34] spatstat.data_3.1-2    reticulate_1.38.0      parallelly_1.38.0     
 [37] spatstat.univar_3.0-0  lmtest_0.9-40          scattermore_1.2       
 [40] Rcpp_1.0.13            tensor_1.5             future.apply_1.11.2   
 [43] zoo_1.8-12             sctransform_0.4.1      httpuv_1.6.15         
 [46] Matrix_1.7-0           splines_4.4.0          igraph_2.0.3          
 [49] tidyselect_1.2.1       abind_1.4-5            stringfish_0.16.0     
 [52] spatstat.random_3.3-1  codetools_0.2-20       miniUI_0.1.1.1        
 [55] spatstat.explore_3.3-1 listenv_0.9.1          lattice_0.22-6        
 [58] tibble_3.2.1           plyr_1.8.9             withr_3.0.1           
 [61] shiny_1.9.1            ROCR_1.0-11            Rtsne_0.17            
 [64] future_1.34.0          fastDummies_1.7.3      survival_3.7-0        
 [67] RcppParallel_5.1.8     polyclip_1.10-7        fitdistrplus_1.2-1    
 [70] pillar_1.9.0           KernSmooth_2.23-24     plotly_4.10.4         
 [73] generics_0.1.3         RcppHNSW_0.6.0         munsell_0.5.1         
 [76] scales_1.3.0           RApiSerialize_0.1.3    globals_0.16.3        
 [79] xtable_1.8-4           lazyeval_0.2.2         tools_4.4.0           
 [82] data.table_1.15.4      RSpectra_0.16-2        RANN_2.6.1            
 [85] leiden_0.4.3.1         dotCall64_1.1-1        cowplot_1.1.3         
 [88] grid_4.4.0             colorspace_2.1-1       nlme_3.1-165          
 [91] cli_3.6.3              spatstat.sparse_3.1-0  textshaping_0.4.0     
 [94] spam_2.10-0            fansi_1.0.6            viridisLite_0.4.2     
 [97] uwot_0.2.2             gtable_0.3.5           digest_0.6.36         
[100] progressr_0.14.0       ggrepel_0.9.5          farver_2.1.2          
[103] htmlwidgets_1.6.4      htmltools_0.5.8.1      lifecycle_1.0.4       
[106] httr_1.4.7             mime_0.12              MASS_7.3-61

image
image

@tangmindan tangmindan added the bug Something isn't working label Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant