drieslab / Giotto

Spatial omics analysis toolbox
https://drieslab.github.io/Giotto_website/
Other
240 stars 94 forks source link

Stereo-seq tutorial: Error in Giotto::anndataToGiotto(anndata_file) : object 'sc' not found #965

Open MatteoRiva95 opened 3 weeks ago

MatteoRiva95 commented 3 weeks ago

Describe the Error

I would like to run the Giotto tutorial for Stereo-seq spatial analysis (https://giottosuite.readthedocs.io/en/latest/subsections/datasets/SSeq-E12-5_E1S3-Tutorial.html). Maybe I am just missing something. I tried with another Stereo-seq .h5ad file, but the same error is still present.

Error Message

I am just running the first lines of the tutorial:

if(!"Giotto" %in% installed.packages()) { devtools::install_github("drieslab/Giotto@suite") }

library(Giotto) genv_exists = checkGiottoEnvironment() if(!genv_exists){ installGiottoEnvironment() }

anndata_download = "https://zenodo.org/record/7323947/files/E12.5_E1S3_bin200.h5ad?download=1" anndata_file = "E12.5_E1S3_bin_200.h5ad" download.file(anndata_download, anndata_file)

stereo_go <- Giotto::anndataToGiotto(anndata_file)

But I get this error:

Error in Giotto::anndataToGiotto(anndata_file) : object 'sc' not found

System Information

Platform: x86_64-pc-linux-gnu Rversion: 4.4.0 Giotto version: 1.1.2

josschavezf commented 3 weeks ago

Hi @MatteoRiva95 I see you are using an old version of Giotto, could you please update to the most recent version (4.0.8) and let us know if you still have this error?

MatteoRiva95 commented 3 weeks ago

Update, after updating to Giotto 4.0.8 and forcing the use of python under the giotto conda env with: Sys.setenv(RETICULATE_PYTHON="~/.local/share/r-miniconda/envs/giotto_env/bin/python") now I get this error instead: Error in py_call_impl(callable, call_args$unnamed, call_args$named) : UnboundLocalError: local variable 'adata' referenced before assignment Of note, after reinstalling the giotto env from scratch I received the following error: Warning in .py_install_prompt(package = package, env = env) : Python packagescanpyis required and not installed. fixed by activating the env and manually installing scanpy.

MatteoRiva95 commented 2 weeks ago

Hi @josschavezf do you have any news or solution about this error? Thank you in advance

josschavezf commented 2 weeks ago

hi @MatteoRiva95, It seems like the issue is solved in the development version (4.0.9), you can install it using remotes::install_github("drieslab/Giotto@suite_dev") if it asks for the development version of the other modules, you can install them with remotes:: install_github("drieslab/GiottoUtils@dev") install_github("drieslab/GiottoClass@dev") install_github("drieslab/GiottoVisuals@dev") We will release the new version in the main branch of the repositories in a few days.

MatteoRiva95 commented 2 weeks ago

@josschavezf Thank you for your reply. I tried to run your command as you suggested. Unfortunately, it returns: Error: C stack usage 7975364 is too close to the limit Execution halted I tried to change with ulimit -f unlimited and I tried to change the /etc/security/limits.conf with:

but it keeps returning the same error. Do you know how to solve it, please? Otherwise, I will wait for the 4.0.9 version. Thank you again

josschavezf commented 2 weeks ago

@MatteoRiva95 It seems to be related to a recursive calling of functions. Try installing first the individual modules and the main Giotto at the end. GiottoUtils -> GiottoClass -> GiottoVisuals -> Giotto.

MatteoRiva95 commented 2 weeks ago

@josschavezf I tried to run remotes:: install_github("drieslab/GiottoUtils@dev") --> remotes::install_github("drieslab/GiottoClass@dev") --> remotes::install_github("drieslab/GiottoVisuals@dev") --> remotes::install_github("drieslab/Giotto@suite_dev"), but unfortunately every one of these commands still returns the same error:

Error: C stack usage 7971252 is too close to the limit Execution halted

josschavezf commented 2 weeks ago

@MatteoRiva95 try using the pak package instead of remotes

install.packages("pak")

pak::pkg_install("drieslab/GiottoUtils@dev") pak::pkg_install("drieslab/GiottoClass@dev") pak::pkg_install("drieslab/GiottoVisuals@dev") pak::pkg_install("drieslab/Giotto@suite_dev")

If this option doesn't work, an alternative is downloading the repositories and installing them from the local directory.

MatteoRiva95 commented 2 weeks ago

@josschavezf I tried what you suggested, but unfortunately it returns this error:

pak::pkg_install("drieslab/GiottoUtils@dev") Error in pak::pkg_install("drieslab/GiottoUtils@dev") : lazy-load database '/mnt/HDD1/R/x86_64-pc-linux-gnu-library/4.1/pak/R/pak.rdb' is corrupt In addition: Warning messages: 1: In pak::pkg_install("drieslab/GiottoUtils@dev") : restarting interrupted promise evaluation 2: In pak::pkg_install("drieslab/GiottoUtils@dev") : internal error 1 in R_decompress1 with libdeflate

Anyway, I followed your previous suggestions for Giotto installation with my boss and on his ws it works! We do not understand why it doesn't with me. So probably is a my setting problem. Thank you so much for your support @josschavezf , really appreciated!!