satijalab / seurat

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

Error: object 'FastMNNIntegration' not found #9356

Closed sarakn97 closed 3 weeks ago

sarakn97 commented 3 weeks ago

Hello,

I have run RPCA & Harmony Integration and now want to run FastMNN. I am running the code below and the IntegrateLayers() Step fails with the following error:

Error: object 'FastMNNIntegration' not found

merged_seurat[["RNA"]] <- split(merged_seurat[["RNA"]], f = merged_seurat$orig.ident)

merged_seurat <- SCTransform(merged_seurat, vst.flavor = "v2")

merged_seurat <- RunPCA(merged_seurat, npcs = 30, verbose = FALSE)

merged_seurat <- IntegrateLayers(object = merged_seurat, method = FastMNNIntegration,
  new.reduction = "integrated.mnn",
  verbose = FALSE, assay = "SCT")

merged_seurat <- FindNeighbors(merged_seurat, reduction = "integrated.mnn", dims = 1:30)

merged_seurat <- FindClusters(merged_seurat, resolution = c(0.05, 0.1, 0.3,0.5))

I have installed the batchelor package and am wondering what else could be the issue?

sessionInfo()

R version 4.4.1 (2024-06-14 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 22631)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

time zone: America/Denver
tzcode source: internal

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

other attached packages:
 [1] batchelor_1.20.0            ensembldb_2.28.0            AnnotationFilter_1.28.0     GenomicFeatures_1.56.0     
 [5] AnnotationDbi_1.66.0        AnnotationHub_3.12.0        BiocFileCache_2.12.0        dbplyr_2.5.0               
 [9] RCurl_1.98-1.16             knitr_1.48                  DoubletFinder_2.0.4         cowplot_1.1.3              
[13] glmGamPoi_1.16.0            scater_1.32.1               scuttle_1.14.0              SingleCellExperiment_1.26.0
[17] SummarizedExperiment_1.34.0 Biobase_2.64.0              GenomicRanges_1.56.1        GenomeInfoDb_1.40.1        
[21] IRanges_2.38.1              S4Vectors_0.42.1            BiocGenerics_0.50.0         MatrixGenerics_1.16.0      
[25] matrixStats_1.3.0           ggplot2_3.5.1               patchwork_1.2.0             Seurat_5.1.0               
[29] SeuratObject_5.0.2          sp_2.1-4                    dplyr_1.1.4                

loaded via a namespace (and not attached):
  [1] RcppAnnoy_0.0.22          splines_4.4.1             later_1.3.2               BiocIO_1.14.0            
  [5] filelock_1.0.3            bitops_1.0-8              tibble_3.2.1              polyclip_1.10-6          
  [9] XML_3.99-0.17             fastDummies_1.7.3         lifecycle_1.0.4           globals_0.16.3           
 [13] lattice_0.22-6            MASS_7.3-60.2             magrittr_2.0.3            openxlsx_4.2.5.2         
 [17] plotly_4.10.4             yaml_2.3.8                httpuv_1.6.15             sctransform_0.4.1        
 [21] spam_2.10-0               zip_2.3.1                 spatstat.sparse_3.1-0     reticulate_1.38.0        
 [25] pbapply_1.7-2             DBI_1.2.3                 RColorBrewer_1.1-3        ResidualMatrix_1.14.1    
 [29] abind_1.4-5               zlibbioc_1.50.0           Rtsne_0.17                purrr_1.0.2              
 [33] rappdirs_0.3.3            GenomeInfoDbData_1.2.12   ggrepel_0.9.5             irlba_2.3.5.1            
 [37] listenv_0.9.1             spatstat.utils_3.0-5      goftest_1.2-3             RSpectra_0.16-1          
 [41] spatstat.random_3.2-3     fitdistrplus_1.2-1        parallelly_1.38.0         DelayedMatrixStats_1.26.0
 [45] leiden_0.4.3.1            codetools_0.2-20          DelayedArray_0.30.1       tidyselect_1.2.1         
 [49] UCSC.utils_1.0.0          ScaledMatrix_1.12.0       viridis_0.6.5             spatstat.explore_3.2-7   
 [53] GenomicAlignments_1.40.0  jsonlite_1.8.8            BiocNeighbors_1.22.0      progressr_0.14.0         
 [57] ggridges_0.5.6            survival_3.6-4            tools_4.4.1               ica_1.0-3                
 [61] Rcpp_1.0.12               glue_1.7.0                gridExtra_2.3             SparseArray_1.4.8        
 [65] xfun_0.45                 withr_3.0.1               BiocManager_1.30.23       fastmap_1.2.0            
 [69] fansi_1.0.6               digest_0.6.36             rsvd_1.0.5                R6_2.5.1                 
 [73] mime_0.12                 colorspace_2.1-0          scattermore_1.2           tensor_1.5               
 [77] spatstat.data_3.1-2       RSQLite_2.3.7             utf8_1.2.4                tidyr_1.3.1              
 [81] generics_0.1.3            data.table_1.15.4         rtracklayer_1.64.0        httr_1.4.7               
 [85] htmlwidgets_1.6.4         S4Arrays_1.4.1            uwot_0.2.2                pkgconfig_2.0.3          
 [89] gtable_0.3.5              blob_1.2.4                lmtest_0.9-40             XVector_0.44.0           
 [93] htmltools_0.5.8.1         dotCall64_1.1-1           ProtGenerics_1.36.0       scales_1.3.0             
 [97] png_0.1-8                 rstudioapi_0.16.0         rjson_0.2.21              reshape2_1.4.4           
[101] curl_5.2.1                nlme_3.1-164              cachem_1.1.0              zoo_1.8-12               
[105] stringr_1.5.1             BiocVersion_3.19.1        KernSmooth_2.23-24        parallel_4.4.1           
[109] miniUI_0.1.1.1            vipor_0.4.7               restfulr_0.0.15           pillar_1.9.0             
[113] grid_4.4.1                vctrs_0.6.5               RANN_2.6.1                promises_1.3.0           
[117] BiocSingular_1.20.0       beachmat_2.20.0           xtable_1.8-4              cluster_2.1.6            
[121] beeswarm_0.4.0            Rsamtools_2.20.0          cli_3.6.3                 compiler_4.4.1           
[125] rlang_1.1.4               crayon_1.5.3              future.apply_1.11.2       plyr_1.8.9               
[129] ggbeeswarm_0.7.2          stringi_1.8.4             viridisLite_0.4.2         deldir_2.0-4             
[133] BiocParallel_1.38.0       Biostrings_2.72.1         munsell_0.5.1             lazyeval_0.2.2           
[137] spatstat.geom_3.2-9       Matrix_1.7-0              RcppHNSW_0.6.0            sparseMatrixStats_1.16.0 
[141] bit64_4.0.5               future_1.34.0             KEGGREST_1.44.1           shiny_1.9.1              
[145] ROCR_1.0-11               memoise_2.0.1             igraph_2.0.3              bit_4.0.5   
samuel-marsh commented 3 weeks ago

Hi @sarakn97,

Not member of dev team but hopefully can be helpful. In order to run FastMNNIntegration you need to load the SeuratWrappers package prior to running IntegrateLayers. Doing so should solve your issue. If it doesn't please let me know and I'll reopen the issue.

Best, Sam