Closed FelixZ95 closed 1 week ago
Hi, this is due to the fact that SPATA2 deals with images in "cartesian coordinate" space. You can use the flip functions to revert that effect. I will update the initiateSpataObjectVisium()
function to include this with a simple argument in the next version release. Till then:
object <- flipCoordinates(object, axis = "h")
for(img_name in getImageNames(object){ object <- flipImage(object, axis = "h", img_name = img_name) }
The for loop is not necessary if you have only one image registered.
Does that help ?
You said "problems" as in "multiple problems". Anything else that you noticed?
Thank you for your reply and code. I think it may be because I ignored some transformations of the coordinate axis, which caused the error. Now there is no error after the correct transformation of the coordinate axis. Looking forward to the new version.
Happy to help.
A great job! I met some problems when I used SPATA3.1.0. The image will not be the same as the original; could you please help me solve this problem? thanks Code: object <- initiateSpataObjectVisium(sample_name = N, directory_visium = xxx) plotImage(object)
Origian picture:
SessionInfo: R version 4.4.0 (2024-04-24) Platform: x86_64-pc-linux-gnu Running under: Ubuntu 22.04.4 LTS
Matrix products: default BLAS/LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0
locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
time zone: Asia/Shanghai tzcode source: system (glibc)
attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages: [1] SPATA2_3.1.0 lubridate_1.9.3 forcats_1.0.0 stringr_1.5.1 readr_2.1.5 tidyr_1.3.0
[7] tibble_3.2.1 ggplot2_3.5.1 tidyverse_2.0.0 purrr_1.0.2 dplyr_1.1.4 shiny_1.9.1
[13] SeuratObject_4.1.4 Seurat_4.4.0
loaded via a namespace (and not attached): [1] reactable_0.4.4 fs_1.6.4 matrixStats_1.4.0 spatstat.sparse_3.1-0
[5] bitops_1.0-8 sf_1.0-17 shinybusy_0.3.3 fontawesome_0.5.2
[9] devtools_2.4.5 EBImage_4.46.0 httr_1.4.7 RColorBrewer_1.1-3
[13] doParallel_1.0.17 profvis_0.3.8 tools_4.4.0 sctransform_0.4.1
[17] backports_1.5.0 utf8_1.2.4 R6_2.5.1 mgcv_1.9-1
[21] lazyeval_0.2.2 uwot_0.2.2 anndata_0.7.5.6 GetoptLong_1.0.5
[25] urlchecker_1.0.1 withr_3.0.1 sp_2.1-4 prettyunits_1.2.0
[29] gridExtra_2.3 SeuratWrappers_0.3.1 progressr_0.14.0 textshaping_0.4.0
[33] cli_3.6.3 Biobase_2.64.0 pacman_0.5.1 spatstat.explore_3.3-2
[37] isoband_0.2.7 sass_0.4.9 labeling_0.4.3 spatstat.data_3.1-2
[41] proxy_0.4-27 ggridges_0.5.6 pbapply_1.7-2 systemfonts_1.1.0
[45] SPATAData_0.0.0.9000 dbscan_1.2-0 svglite_2.1.2 R.utils_2.12.2
[49] stringdist_0.9.12 shinyhelper_0.3.2.9000 parallelly_1.38.0 sessioninfo_1.2.2
[53] rstudioapi_0.16.0 FNN_1.1.4 visNetwork_2.1.2 generics_0.1.3
[57] shape_1.4.6.1 ica_1.0-3 spatstat.random_3.3-1 vroom_1.6.5
[61] zip_2.3.0 car_3.1-2 Matrix_1.6-1.1 fansi_1.0.6
[65] S4Vectors_0.42.1 abind_1.4-5 R.methodsS3_1.8.2 lifecycle_1.0.4
[69] carData_3.0-5 SummarizedExperiment_1.30.2 SparseArray_1.4.8 Rtsne_0.17
[73] grid_4.4.0 promises_1.3.0 crayon_1.5.3 shinydashboard_0.7.2
[77] miniUI_0.1.1.1 lattice_0.22-6 msigdbr_7.5.1 cowplot_1.1.3
[81] knitr_1.48 pillar_1.9.0 ComplexHeatmap_2.20.0 GenomicRanges_1.56.1
[85] rjson_0.2.22 future.apply_1.11.2 codetools_0.2-19 leiden_0.4.3.1
[89] glue_1.7.0 V8_5.0.0 spatstat.univar_3.0-1 data.table_1.16.0
[93] remotes_2.5.0 vctrs_0.6.5 png_0.1-8 gtable_0.3.5
[97] assertthat_0.2.1 cachem_1.1.0 openxlsx_4.2.5.2 xfun_0.47
[101] S4Arrays_1.4.1 mime_0.12 rsconnect_1.3.1 survival_3.7-0
[105] SingleCellExperiment_1.26.0 iterators_1.0.14 units_0.8-5 ellipsis_0.3.2
[109] fitdistrplus_1.2-1 ROCR_1.0-11 nlme_3.1-166 usethis_3.0.0
[113] bit64_4.0.5 progress_1.2.3 RcppAnnoy_0.0.22 GenomeInfoDb_1.40.1
[117] bslib_0.8.0 irlba_2.3.5.1 KernSmooth_2.23-24 DBI_1.2.3
[121] colorspace_2.1-1 BiocGenerics_0.50.0 tidyselect_1.2.1 processx_3.8.4
[125] bit_4.0.5 compiler_4.4.0 curl_5.2.2 hdf5r_1.3.11
[129] xml2_1.3.6 desc_1.4.3 DelayedArray_0.30.1 plotly_4.10.2
[133] scales_1.3.0 classInt_0.4-10 lmtest_0.9-40 callr_3.7.6
[137] tiff_0.1-12 digest_0.6.37 goftest_1.2-3 fftwtools_0.9-11
[141] spatstat.utils_3.1-0 rmarkdown_2.28 XVector_0.44.0 htmltools_0.5.8.1
[145] pkgconfig_2.0.3 jpeg_0.1-10 MatrixGenerics_1.17.0 fastmap_1.2.0
[149] rlang_1.1.4 GlobalOptions_0.1.2 htmlwidgets_1.6.4 UCSC.utils_1.0.0
[153] jquerylib_0.1.4 ggh4x_0.2.8 farver_2.1.2 zoo_1.8-12
[157] jsonlite_1.8.8 R.oo_1.25.0 RCurl_1.98-1.16 magrittr_2.0.3
[161] kableExtra_1.4.0 GenomeInfoDbData_1.2.12 patchwork_1.2.0 munsell_0.5.1
[165] Rcpp_1.0.13 babelgene_22.9 reticulate_1.39.0 stringi_1.8.4
[169] zlibbioc_1.50.0 MASS_7.3-61 plyr_1.8.9 pkgbuild_1.4.4
[173] parallel_4.4.0 listenv_0.9.1 ggrepel_0.9.6 deldir_2.0-4
[177] splines_4.4.0 tensor_1.5 hms_1.1.3 circlize_0.4.16
[181] locfit_1.5-9.10 ps_1.7.7 igraph_2.0.3 ggpubr_0.6.0
[185] spatstat.geom_3.3-2 ggsignif_0.6.4 reshape2_1.4.4 stats4_4.4.0
[189] pkgload_1.4.0 evaluate_0.24.0 BiocManager_1.30.25 tweenr_2.0.3
[193] tzdb_0.4.0 foreach_1.5.2 httpuv_1.6.15 RANN_2.6.2
[197] polyclip_1.10-7 future_1.34.0 clue_0.3-65 scattermore_1.2
[201] ggforce_0.4.2 rsvd_1.0.5 broom_1.0.6 xtable_1.8-4
[205] e1071_1.7-14 rstatix_0.7.2 later_1.3.2 class_7.3-22
[209] ragg_1.3.2 viridisLite_0.4.2 confuns_1.0.3 hypeR_2.2.0
[213] memoise_2.0.1 IRanges_2.38.1 cluster_2.1.4 shinyWidgets_0.8.0
[217] keys_0.1.1 timechange_0.3.0 globals_0.16.3 concaveman_1.1.0