Skip to content

merge SFE objects #69

@cathalgking

Description

@cathalgking

I would like to merge 2 SFE objects however I am getting an error related to column(s) 'Feature.Type'. Is there a way to get past this?

I try with:

# load data
vis1 <- SpatialFeatureExperiment::read10xVisiumSFE(dirs = "../data/PTCVIS1/PTCVIS1/",
                                                   row.names = "symbol",
                                                   zero.policy = T)

vis1

#colnames(vis1) <- paste0("vis1_", colnames(vis1))

# load data
vis2 <- SpatialFeatureExperiment::read10xVisiumSFE(dirs = "../data/PTCVIS2/PTCVIS2/",
                                                   row.names = "symbol",
                                                   zero.policy = T)

vis2

vis_merged <- SpatialFeatureExperiment::cbind(vis1, vis2, deparse.level = 1)

'sample_id's are duplicated across 'SpatialFeatureExperiment' objects to cbind; appending sample indices.
Error in FUN(X[[i]], ...) : 
  column(s) 'Feature.Type' in ‘mcols’ are duplicated and the data do not match
> sessionInfo()
R version 4.4.0 (2024-04-24)
Platform: aarch64-apple-darwin20
Running under: macOS 15.5

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Australia/Adelaide
tzcode source: internal

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

other attached packages:
 [1] png_0.1-8                      SEtools_1.20.0                 sechm_1.14.0                   ComplexHeatmap_2.22.0          Seurat_5.1.0                  
 [6] SeuratObject_5.0.2             sp_2.1-4                       ggspavis_1.12.0                reticulate_1.42.0              BiocNeighbors_2.0.1           
[11] BiocParallel_1.40.2            dplyr_1.1.4                    sf_1.0-21                      rlang_1.1.6                    terra_1.8-50                  
[16] EBImage_4.48.0                 rjson_0.2.23                   bluster_1.16.0                 patchwork_1.3.0                stringr_1.5.1                 
[21] scran_1.34.0                   scater_1.34.1                  scuttle_1.16.0                 ggplot2_3.5.2                  SingleCellExperiment_1.28.1   
[26] SummarizedExperiment_1.36.0    Biobase_2.66.0                 GenomicRanges_1.58.0           GenomeInfoDb_1.42.3            IRanges_2.40.1                
[31] S4Vectors_0.44.0               BiocGenerics_0.52.0            MatrixGenerics_1.18.1          matrixStats_1.4.1              Voyager_1.8.1                 
[36] SpatialFeatureExperiment_1.8.6

loaded via a namespace (and not attached):
  [1] randomcoloR_1.1.0.1       SpatialExperiment_1.16.0  R.methodsS3_1.8.2         dichromat_2.0-0.1         tiff_0.1-12               goftest_1.2-3            
  [7] Biostrings_2.74.1         HDF5Array_1.34.0          TH.data_1.1-3             vctrs_0.6.5               spatstat.random_3.4-1     digest_0.6.37            
 [13] shape_1.4.6.1             proxy_0.4-27              registry_0.5-1            ggrepel_0.9.6             deldir_2.0-4              parallelly_1.44.0        
 [19] magick_2.8.6              MASS_7.3-65               reshape2_1.4.4            httpuv_1.6.15             foreach_1.5.2             scico_1.5.0              
 [25] withr_3.0.2               xfun_0.52                 survival_3.8-3            memoise_2.0.1             s2_1.1.9                  ggbeeswarm_0.7.2         
 [31] zoo_1.8-12                GlobalOptions_0.1.2       V8_6.0.3                  pbapply_1.7-2             R.oo_1.27.1               spData_2.3.4             
 [37] KEGGREST_1.46.0           promises_1.3.2            httr_1.4.7                globals_0.18.0            fitdistrplus_1.2-2        rhdf5filters_1.18.1      
 [43] rhdf5_2.50.2              rstudioapi_0.17.1         spatialreg_1.3-6          UCSC.utils_1.2.0          units_0.8-7               miniUI_0.1.1.1           
 [49] generics_0.1.4            curl_6.2.3                zlibbioc_1.52.0           ScaledMatrix_1.14.0       polyclip_1.10-7           ca_0.71.1                
 [55] GenomeInfoDbData_1.2.13   SparseArray_1.6.2         fftwtools_0.9-11          xtable_1.8-4              doParallel_1.0.17         evaluate_1.0.3           
 [61] S4Arrays_1.6.0            irlba_2.3.5.1             colorspace_2.1-1          hdf5r_1.3.12              ROCR_1.0-11               spatstat.data_3.1-6      
 [67] magrittr_2.0.3            lmtest_0.9-40             spdep_1.3-11              later_1.3.2               viridis_0.6.5             lattice_0.22-6           
 [73] spatstat.geom_3.4-1       future.apply_1.11.3       genefilter_1.88.0         scattermore_1.2           XML_3.99-0.17             cowplot_1.1.3            
 [79] RcppAnnoy_0.0.22          class_7.3-22              pillar_1.10.2             nlme_3.1-168              iterators_1.0.14          compiler_4.4.0           
 [85] beachmat_2.22.0           RSpectra_0.16-2           stringi_1.8.4             TSP_1.2-4                 tensor_1.5                plyr_1.8.9               
 [91] crayon_1.5.3              abind_1.4-8               locfit_1.5-9.12           bit_4.6.0                 sandwich_3.1-1            codetools_0.2-20         
 [97] multcomp_1.4-28           BiocSingular_1.22.0       e1071_1.7-16              GetoptLong_1.0.5          plotly_4.10.4             mime_0.13                
[103] splines_4.4.0             circlize_0.4.16           Rcpp_1.0.14               fastDummies_1.7.5         sparseMatrixStats_1.18.0  blob_1.2.4               
[109] knitr_1.50                clue_0.3-66               listenv_0.9.1             DelayedMatrixStats_1.28.1 openxlsx_4.2.8            tibble_3.2.1             
[115] Matrix_1.7-3              statmod_1.5.0             pkgconfig_2.0.3           pheatmap_1.0.12           tools_4.4.0               cachem_1.1.0             
[121] RSQLite_2.3.7             viridisLite_0.4.2         DBI_1.2.3                 fastmap_1.2.0             rmarkdown_2.29            scales_1.4.0             
[127] ica_1.0-3                 coda_0.19-4.1             BiocManager_1.30.25       dotCall64_1.2             LearnBayes_2.15.1         RANN_2.6.2               
[133] farver_2.1.2              mgcv_1.9-1                wk_0.9.4                  yaml_2.3.10               cli_3.6.5                 purrr_1.0.4              
[139] leiden_0.4.3.1            lifecycle_1.0.4           dbscan_1.2.2              rsconnect_1.4.1           uwot_0.2.2                mvtnorm_1.3-3            
[145] DropletUtils_1.26.0       annotate_1.84.0           gtable_0.3.6              ggridges_0.5.6            progressr_0.15.1          parallel_4.4.0           
[151] limma_3.62.2              jsonlite_2.0.0            edgeR_4.4.2               RcppHNSW_0.6.0            seriation_1.5.6           bitops_1.0-9             
[157] bit64_4.6.0-1             Rtsne_0.17                spatstat.utils_3.1-4      zip_2.3.1                 ggside_0.3.1              metapod_1.14.0           
[163] dqrng_0.4.1               zeallot_0.1.0             spatstat.univar_3.1-3     R.utils_2.13.0            lazyeval_0.2.2            shiny_1.10.0             
[169] htmltools_0.5.8.1         sctransform_0.4.1         glue_1.8.0                spam_2.11-1               XVector_0.46.0            RCurl_1.98-1.17          
[175] classInt_0.4-11           jpeg_0.1-11               gridExtra_2.3             boot_1.3-31               igraph_2.1.4              R6_2.6.1                 
[181] sva_3.54.0                tidyr_1.3.1               DESeq2_1.46.0             labeling_0.4.3            cluster_2.1.6             pkgload_1.4.0            
[187] Rhdf5lib_1.28.0           memuse_4.2-3              DelayedArray_0.32.0       tidyselect_1.2.1          vipor_0.4.7               AnnotationDbi_1.68.0     
[193] future_1.49.0             sfheaders_0.4.4           rsvd_1.0.5                KernSmooth_2.23-24        data.table_1.17.4         htmlwidgets_1.6.4        
[199] RColorBrewer_1.1-3        spatstat.sparse_3.1-0     spatstat.explore_3.4-3    ggnewscale_0.5.1          beeswarm_0.4.0     

@lambdamoses

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions