theislab/neural_organoid_atlas

AttributeError occuring when reading in

Opened this issue · 0 comments

Hi,

Thank you for putting together the HNOCA and I'm interested in comparing my brain organoid data to it. However, I encountered AttributeError: 'dict' object has no attribute 'dtype' when reading in and converting hnoca_pre-release_public_subset.h5ad to .rds. Below are my script, error messages and the session info. Thank you in advance for your help and please let me if there's any info needed.

ad <- import("anndata", convert = FALSE)
data_ad <- ad$read_h5ad("hnoca_pre-release_public_subset.h5ad")

# Error in py_call_impl(callable, call_args$unnamed, call_args$named) : 
  AttributeError: 'dict' object has no attribute 'dtype'
Run `reticulate::py_last_error()` for details.

── Python Exception Message ────────────────────────────────────────────────────
Traceback (most recent call last):
  File "~/miniconda3/envs/r-reticulate/lib/python3.9/site-packages/anndata/readwrite/read.py", line 447, in read_h5ad
    constructor_args = _read_args_from_h5ad(filename=filename, chunk_size=chunk_size)
  File "~/miniconda3/envs/r-reticulate/lib/python3.9/site-packages/anndata/readwrite/read.py", line 502, in _read_args_from_h5ad
    return AnnData._args_from_dict(d)
  File "~/miniconda3/envs/r-reticulate/lib/python3.9/site-packages/anndata/core/anndata.py", line 2157, in _args_from_dict
    if key in d_true_keys[true_key].dtype.names:
AttributeError: 'dict' object has no attribute 'dtype'

── R Traceback ─────────────────────────────────────────────────────────────────
    ▆
 1. └─ad$read_h5ad("hnoca_pre-release_public_subset.h5ad")
 2.   └─reticulate:::py_call_impl(callable, call_args$unnamed, call_args$named)

sessionInfo()
R version 4.3.2 (2023-10-31)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux

Matrix products: default
BLAS/LAPACK:~/miniconda3/lib/libopenblasp-r0.3.25.so;  LAPACK version 3.11.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] 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
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

time zone: America/Los_Angeles
tzcode source: system (glibc)

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

other attached packages:
[1] unix_1.5.6        future_1.33.1     sceasy_0.0.7      reticulate_1.34.0

loaded via a namespace (and not attached):
  [1] deldir_2.0-2           pbapply_1.7-2          gridExtra_2.3
  [4] rlang_1.1.3            magrittr_2.0.3         RcppAnnoy_0.0.21
  [7] matrixStats_1.2.0      ggridges_0.5.5         compiler_4.3.2
 [10] spatstat.geom_3.2-7    png_0.1-8              vctrs_0.6.5
 [13] reshape2_1.4.4         stringr_1.5.1          pkgconfig_2.0.3
 [16] fastmap_1.1.1          ellipsis_0.3.2         utf8_1.2.4
 [19] promises_1.2.1         purrr_1.0.2            jsonlite_1.8.8
 [22] goftest_1.2-3          later_1.3.2            spatstat.utils_3.0-4
 [25] irlba_2.3.5.1          parallel_4.3.2         cluster_2.1.6
 [28] R6_2.5.1               ica_1.0-3              stringi_1.8.3
 [31] RColorBrewer_1.1-3     spatstat.data_3.0-4    parallelly_1.36.0
 [34] lmtest_0.9-40          scattermore_1.2        Rcpp_1.0.12
 [37] tensor_1.5             future.apply_1.11.1    zoo_1.8-12
 [40] sctransform_0.4.1      httpuv_1.6.13          Matrix_1.6-5
 [43] splines_4.3.2          igraph_1.6.0           tidyselect_1.2.0
 [46] abind_1.4-5            spatstat.random_3.2-2  codetools_0.2-19
 [49] miniUI_0.1.1.1         spatstat.explore_3.2-5 listenv_0.9.0
 [52] lattice_0.22-5         tibble_3.2.1           plyr_1.8.9
 [55] shiny_1.8.0            withr_3.0.0            ROCR_1.0-11
 [58] Rtsne_0.17             fastDummies_1.7.3      survival_3.5-7
 [61] polyclip_1.10-6        fitdistrplus_1.1-11    pillar_1.9.0
 [64] Seurat_5.0.1           KernSmooth_2.23-22     plotly_4.10.4
 [67] generics_0.1.3         RcppHNSW_0.5.0         sp_2.1-2
 [70] ggplot2_3.4.4          munsell_0.5.0          scales_1.3.0
 [73] globals_0.16.2         xtable_1.8-4           glue_1.7.0
 [76] lazyeval_0.2.2         tools_4.3.2            data.table_1.14.10
 [79] RSpectra_0.16-1        RANN_2.6.1             leiden_0.4.3.1
 [82] dotCall64_1.1-1        cowplot_1.1.2          grid_4.3.2
 [85] tidyr_1.3.0            colorspace_2.1-0       nlme_3.1-164
 [88] patchwork_1.2.0        cli_3.6.2              spatstat.sparse_3.0-3
 [91] rappdirs_0.3.3         spam_2.10-0            fansi_1.0.6
 [94] viridisLite_0.4.2      dplyr_1.1.4            uwot_0.1.16
 [97] gtable_0.3.4           digest_0.6.34          progressr_0.14.0
[100] ggrepel_0.9.5          htmlwidgets_1.6.4      SeuratObject_5.0.1
[103] htmltools_0.5.7        lifecycle_1.0.4        httr_1.4.7
[106] mime_0.12              MASS_7.3-60