Create a local anndata zarr folder
giottoToAnndataZarr(
gobject,
spat_unit = NULL,
feat_type = NULL,
expression = "raw",
pca_name = NULL,
umap_name = NULL,
tsne_name = NULL,
output_path
)giotto object
spatial unit (e.g. "cell")
feature type (e.g. "rna", "dna", "protein")
expression values to extract (e.g. "raw", "normalized", "scaled")
optional. Default = NULL. Provide the pca name in your Giotto object. If a pca exists and a name is not provided, the function will use "pca" or the first available pca name.
optional. Default = NULL. Provide the umap name in your Giotto object. If a umap exists and a name is not provided, the function will use "umap" or the first available umap name.
optional. Default = NULL. Provide the tsne name in your Giotto object. If a tsne exists and a name is not provided, the function will use "tsne" or the first available tsne name.
path to create and save the anndata zarr folder
local anndata zarr folder
# using the mini visium object
giotto_object <- GiottoData::loadGiottoMini("visium")
#> 1. read Giotto object
#> 2. read Giotto feature information
#> 3. read Giotto spatial information
#> 4. read Giotto image information
#> python already initialized in this session
#> active environment : '/usr/bin/python3'
#> python version : 3.12
giottoToAnndataZarr(giotto_object,
expression = "raw",
output_path = tempdir()
)
#> Installing pyenv ...
#> Done! pyenv has been installed to '/home/runner/.local/share/r-reticulate/pyenv/bin/pyenv'.
#> Using Python: /home/runner/.pyenv/versions/3.11.15/bin/python3.11
#> Creating virtual environment '/home/runner/.cache/R/basilisk/1.24.0/Giotto/4.2.3/giotto_env' ...
#> + /home/runner/.pyenv/versions/3.11.15/bin/python3.11 -m venv /home/runner/.cache/R/basilisk/1.24.0/Giotto/4.2.3/giotto_env
#> Done!
#> Installing packages: pip, wheel, setuptools
#> + /home/runner/.cache/R/basilisk/1.24.0/Giotto/4.2.3/giotto_env/bin/python -m pip install --upgrade pip wheel setuptools
#> Installing packages: 'zarr==3.1.5', 'anndata==0.12.6'
#> + /home/runner/.cache/R/basilisk/1.24.0/Giotto/4.2.3/giotto_env/bin/python -m pip install --upgrade --no-user 'zarr==3.1.5' 'anndata==0.12.6'
#> Virtual environment '/home/runner/.cache/R/basilisk/1.24.0/Giotto/4.2.3/giotto_env' successfully created.
#> Error in checkForRemoteErrors(lapply(cl, recvResult)): one node produced an error: RuntimeError: `anndata.settings.allow_write_nullable_strings` is False, because writing of `pd.arrays.StringArray` is new and not supported in anndata < 0.11, still use by many people. Opt-in to writing these arrays by toggling the setting to True.
#> Error raised while writing key '_index' of <class 'zarr.core.group.Group'> to /obs
#> Run `reticulate::py_last_error()` for details.
# using the mini vizgen object
giotto_object <- GiottoData::loadGiottoMini("vizgen")
#> 1. read Giotto object
#> 2. read Giotto feature information
#> 3. read Giotto spatial information
#> 4. read Giotto image information
#> python already initialized in this session
#> active environment : '/usr/bin/python3'
#> python version : 3.12
giottoToAnndataZarr(giotto_object,
spat_unit = "aggregate",
expression = "scaled",
output_path = tempdir()
)
#> Error in checkForRemoteErrors(lapply(cl, recvResult)): one node produced an error: RuntimeError: `anndata.settings.allow_write_nullable_strings` is False, because writing of `pd.arrays.StringArray` is new and not supported in anndata < 0.11, still use by many people. Opt-in to writing these arrays by toggling the setting to True.
#> Error raised while writing key '_index' of <class 'zarr.core.group.Group'> to /obs
#> Run `reticulate::py_last_error()` for details.