pachterlab / SpatialFeatureExperiment

Extension of SpatialExperiment with sf
https://pachterlab.github.io/SpatialFeatureExperiment
Artistic License 2.0
43 stars 7 forks source link

toSpatialFeatureExperiment() stopped working after updating to release version 1.6.1 #45

Closed rcastelo closed 5 months ago

rcastelo commented 6 months ago

Hi,

After updating the release version of the package to 1.6.1, the function toSpatialFeatureExperiment() stopped working. Here is a minimal reproducing example:

library(SpatialExperiment)
library(SpatialFeatureExperiment)
library(TENxVisiumData)

spe <- HumanHeart()     

sfe <- toSpatialFeatureExperiment(spe)
 Error in methods::slot(value, what) :
   no slot of name "cpp" for this object of class "SpatRaster"
traceback()
12: methods::slot(value, what)      
11: asMethod(object, Class, value)  
10: `as<-`(`*tmp*`, Classi, value = obj)
9: initialize(value, ...)           
8: initialize(value, ...)           
7: new("SpatRasterImage", im)       
6: FUN(X[[i]], ...)
5: lapply(new_imgs, function(im) {
       new("SpatRasterImage", im)
   }) 
4: .spe_to_sfe(x, colGeometries, rowGeometries, annotGeometries,
                      spatialCoordsNames, annotGeometryType, spatialGraphs, spotDiameter,
                             unit)
3: .local(x, ...)
2: toSpatialFeatureExperiment(spe)
1: toSpatialFeatureExperiment(spe)
sessionInfo()
R version 4.4.0 (2024-04-24)               
Platform: x86_64-apple-darwin20           
Running under: macOS Sonoma 14.4.1           

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-x86_64/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: Europe/Madrid        
tzcode source: internal         

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

other attached packages:
 [1] TENxVisiumData_1.12.0          ExperimentHub_2.12.0
 [3] AnnotationHub_3.12.0           BiocFileCache_2.12.0
 [5] dbplyr_2.5.0                   SpatialFeatureExperiment_1.6.1
 [7] SpatialExperiment_1.14.0       SingleCellExperiment_1.26.0
 [9] SummarizedExperiment_1.34.0    Biobase_2.64.0
[11] GenomicRanges_1.56.0           GenomeInfoDb_1.40.0
[13] IRanges_2.38.0                 S4Vectors_0.42.0
[15] BiocGenerics_0.50.0            MatrixGenerics_1.16.0
[17] matrixStats_1.3.0              nvimcom_0.9-28
[19] colorout_1.3-0.2
loaded via a namespace (and not attached):
  [1] DBI_1.2.2                 bitops_1.0-7
  [3] deldir_2.0-4              s2_1.1.6
  [5] rlang_1.1.3               magrittr_2.0.3
  [7] e1071_1.7-14              compiler_4.4.0
  [9] RSQLite_2.3.6             DelayedMatrixStats_1.26.0
[... more packages ...]
 [93] dqrng_0.4.0               rjson_0.2.21
 [95] htmlwidgets_1.6.4         memoise_2.0.1
 [97] htmltools_0.5.8.1         R.oo_1.26.0
 [99] lifecycle_1.0.4           httr_1.4.7
[101] mime_0.12                 statmod_1.5.0
[103] bit64_4.0.5

If I roll back to the following previous commit:

$ git checkout 911ba1c4e5032ba0173754184bcbb93148738156
Previous HEAD position was 080e467 Added Img<-, closing #34
HEAD is now at 911ba1c Don't force users to install the entire tidyverse

build and install, then toSpatialFeatureExperiment() seems to work again, this is the session information:

sessionInfo()
R version 4.4.0 (2024-04-24)                                                                                                    
Platform: x86_64-apple-darwin20                                                                                                 
Running under: macOS Sonoma 14.4.1                                                                                              

[...]

other attached packages:
 [1] TENxVisiumData_1.12.0          ExperimentHub_2.12.0          
 [3] AnnotationHub_3.12.0           BiocFileCache_2.12.0          
 [5] dbplyr_2.5.0                   SpatialFeatureExperiment_1.7.0
 [7] SpatialExperiment_1.14.0       SingleCellExperiment_1.26.0   
 [9] SummarizedExperiment_1.34.0    Biobase_2.64.0                
[11] GenomicRanges_1.56.0           GenomeInfoDb_1.40.0           
[13] IRanges_2.38.0                 S4Vectors_0.42.0              
[15] BiocGenerics_0.50.0            MatrixGenerics_1.16.0         
[17] matrixStats_1.3.0              nvimcom_0.9-28                
[19] colorout_1.3-0.2              
[... rest of the session information ...]
lambdamoses commented 6 months ago

This has been fixed here: https://github.com/pachterlab/SpatialFeatureExperiment/issues/44 I didn't get any error when when converting the human heart SPE object to SFE. The binary from Biconductor might not be up to date. The should be merged into the main branch and the Bioc 3.19 branch. Try installing from GitHub and see if it works.

alikhuseynov commented 5 months ago

@rcastelo did it work for you? If yes, we will close this issue. Thanks.

rcastelo commented 5 months ago

Hi, sorry, somehow I didn't see the notification for your comments, thanks for the feedback, the issue has been resolved, probably the binary packages for macOS were not up to date when I tried.