-
Notifications
You must be signed in to change notification settings - Fork 18
Cirro prepare_data failing on both a Seurat object and an h5Seurat object #220
Description
Using the most recent Seurat (v5) and its dependencies, I'm getting errors when I try to run cirro prepare_data on either an exported Seurat object or that same object when converted to h5Seurat.
The run against the Seurat object looks like it's failing with this problem despite anndata having been installed with pip install cirrocumulus:
Error in py_module_import(module, convert = convert) :
ModuleNotFoundError: No module named 'anndata'
Run reticulate::py_last_error() for details.
I also tried adding anndata to the environment with conda install, but to no avail.
I then tried converting the object to h5Seurat, but here prepare_data fails with:
return AnnData(
TypeError: init() got an unexpected keyword argument 'active.ident'
Error raised while reading key '' of <class 'h5py._hl.files.File'> from /
Full logs below.... Please let me know if you need access to the problematic object.
Seurat Object:
(ccirEnv) jtobias@nuc:~/tmp$ cirro prepare_data sObj.rds --out "RWJL_v04.zarr"
/home/jtobias/.local/miniconda3/envs/ccirEnv/lib/python3.9/site-packages/cirrocumulus/anndata_dataset.py:87: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
import pkg_resources
Converting Seurat object
Attaching package: ‘SeuratObject’
The following objects are masked from ‘package:base’:
intersect, t
Validating object structure
Updating object slots
Ensuring keys are in the proper structure
Updating matrix keys for DimReduc ‘pca’
Updating matrix keys for DimReduc ‘integrated.rpca’
Updating matrix keys for DimReduc ‘umap’
Updating matrix keys for DimReduc ‘umap3D’
Ensuring keys are in the proper structure
Ensuring feature names don't have underscores or pipes
Updating slots in RNA
Updating slots in SCT
Updating slots in SCT_nn
Setting default assay of SCT_nn to SCT
Updating slots in SCT_snn
Setting default assay of SCT_snn to SCT
Updating slots in pca
Updating slots in integrated.rpca
Updating slots in umap
Setting umap DimReduc to global
Updating slots in umap3D
Setting umap3D DimReduc to global
Setting assay used for SCTransform.RNA to RNA
Setting assay used for RunPCA.SCT to SCT
Setting assay used for RunUMAP.SCT.pca to SCT
No assay information could be found for RunUMAP.SCT.integrated.rpca
No assay information could be found for FindNeighbors.SCT.integrated.rpca
No assay information could be found for FindClusters
Validating object structure for Assay5 ‘RNA’
Validating object structure for SCTAssay ‘SCT’
Validating object structure for Graph ‘SCT_nn’
Validating object structure for Graph ‘SCT_snn’
Validating object structure for DimReduc ‘pca’
Validating object structure for DimReduc ‘integrated.rpca’
Validating object structure for DimReduc ‘umap’
Validating object structure for DimReduc ‘umap3D’
Object representation is consistent with the most current Seurat version
Warning messages:
1: Adding a command log without an assay associated with it
2: Adding a command log without an assay associated with it
3: Adding a command log without an assay associated with it
Error in py_module_import(module, convert = convert) :
ModuleNotFoundError: No module named 'anndata'
Run reticulate::py_last_error() for details.
Calls: import -> py_module_import
Execution halted
Traceback (most recent call last):
File "/home/jtobias/.local/miniconda3/envs/ccirEnv/bin/cirro", line 8, in
sys.exit(main())
File "/home/jtobias/.local/miniconda3/envs/ccirEnv/lib/python3.9/site-packages/cirrocumulus/main.py", line 20, in main
cmd.main(command_args)
File "/home/jtobias/.local/miniconda3/envs/ccirEnv/lib/python3.9/site-packages/cirrocumulus/prepare_data.py", line 373, in main
adata = read_adata(
File "/home/jtobias/.local/miniconda3/envs/ccirEnv/lib/python3.9/site-packages/cirrocumulus/anndata_dataset.py", line 92, in read_adata
subprocess.check_call(
File "/home/jtobias/.local/miniconda3/envs/ccirEnv/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['Rscript', '/home/jtobias/.local/miniconda3/envs/ccirEnv/lib/python3.9/site-packages/cirrocumulus/seurat2h5ad.R', 'sObj.rds', 'sObj.rds.h5ad']' returned non-zero exit status 1.
h5Seurat object:
Create h5Seurat file in R
SaveH5Seurat(sObj, filename = "sObj.h5Seurat")
Convert("sObj.h5Seurat", dest = "h5ad")
(ccirEnv) jtobias@nuc:~/tmp$ cirro prepare_data sObj.h5Seurat --out "RWJL_v04.zarr"
Traceback (most recent call last):
File "/home/jtobias/.local/miniconda3/envs/ccirEnv/bin/cirro", line 8, in
sys.exit(main())
File "/home/jtobias/.local/miniconda3/envs/ccirEnv/lib/python3.9/site-packages/cirrocumulus/main.py", line 20, in main
cmd.main(command_args)
File "/home/jtobias/.local/miniconda3/envs/ccirEnv/lib/python3.9/site-packages/cirrocumulus/prepare_data.py", line 373, in main
adata = read_adata(
File "/home/jtobias/.local/miniconda3/envs/ccirEnv/lib/python3.9/site-packages/cirrocumulus/anndata_dataset.py", line 111, in read_adata
adata = anndata.read_h5ad(filesystem.open(path))
File "/home/jtobias/.local/miniconda3/envs/ccirEnv/lib/python3.9/site-packages/anndata/_io/h5ad.py", line 258, in read_h5ad
adata = read_dispatched(f, callback=callback)
File "/home/jtobias/.local/miniconda3/envs/ccirEnv/lib/python3.9/site-packages/anndata/experimental/_dispatch_io.py", line 42, in read_dispatched
return reader.read_elem(elem)
File "/home/jtobias/.local/miniconda3/envs/ccirEnv/lib/python3.9/site-packages/anndata/_io/utils.py", line 211, in func_wrapper
return func(*args, **kwargs)
File "/home/jtobias/.local/miniconda3/envs/ccirEnv/lib/python3.9/site-packages/anndata/_io/specs/registry.py", line 275, in read_elem
return self.callback(read_func, elem.name, elem, iospec=iospec)
File "/home/jtobias/.local/miniconda3/envs/ccirEnv/lib/python3.9/site-packages/anndata/_io/h5ad.py", line 238, in callback
return AnnData(
TypeError: init() got an unexpected keyword argument 'active.ident'
Error raised while reading key '' of <class 'h5py._hl.files.File'> from /