Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

from AnnData to Seurat, AttributeError: 'dict' object has no attribute 'dtype' #47

Closed
ekernf01 opened this issue Jan 6, 2022 · 2 comments

Comments

@ekernf01
Copy link

ekernf01 commented Jan 6, 2022

I'm converting an h5ad file to seurat and I get the error in the title. The h5ad file is from the kallisto|bustools pipeline, but I can't share it because it contains unpublished data. I also can't find publicly available example output from kb, but if you think it would help, I can try to generate some. For context, I provide:

  • Versions of OS, R, miniconda, anndata, bustools
  • output of conda list
  • renv lockfile

I'm not familiar with the h5ad specification. Do you think this is a problem with the file, or maybe some version incompatibility? Thanks!

Versions

Ubuntu 20.04.3 focal fossa
R 4.1.2 bird hippie
conda 4.11.0
anndata                   0.6.19                     py_0    bioconda
Kallisto version: "0.46.2"
bustools version: "0.40.0"

Python packages from conda list

python_packages.txt

R packages from renv lockfile

renv.lock.txt

Traceback

Error in py_call_impl(callable, dots$args, dots$keywords) : 
AttributeError: 'dict' object has no attribute 'dtype'
7.
stop(structure(list(message = "AttributeError: 'dict' object has no attribute 'dtype'", 
call = py_call_impl(callable, dots$args, dots$keywords), 
cppstack = structure(list(file = "", line = -1L, stack = c("/home/ekernf01/.cache/R/renv/cache/v5/R-4.1/x86_64-pc-linux-gnu/reticulate/1.22/b34a8bb69005168078d1d546a53912b2/reticulate/libs/reticulate.so(Rcpp::exception::exception(char const*, bool)+0x74) [0x7fb00c5268d4]", 
"/home/ekernf01/.cache/R/renv/cache/v5/R-4.1/x86_64-pc-linux-gnu/reticulate/1.22/b34a8bb69005168078d1d546a53912b2/reticulate/libs/reticulate.so(Rcpp::stop(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)+0x29) [0x7fb00c5165e9]", ...
6.
_args_from_dict at base.py#2146
5.
_read_args_from_h5ad at read.py#496
4.
read_h5ad at read.py#446
3.
anndata$read_h5ad(inFile)
2.
func(obj, outFile = outFile, main_layer = main_layer, ...)
1.
sceasy::convertFormat("../quantification/kallisto_bustools/counts_unfiltered/adata.h5ad", 
from = "anndata", to = "seurat", outFile = "../quantification/kallisto_bustools/counts_unfiltered/seurat.rds")
@ekernf01
Copy link
Author

ekernf01 commented Jan 6, 2022

I wonder if this is scverse/anndata#287 . I will see if there is a fix there.

@ekernf01
Copy link
Author

ekernf01 commented Jan 6, 2022

Yes, it is. Fixed by using a newer version of anndata, available from conda-forge but not bioconda.

conda install "anndata>=0.7" -c conda-forge

@ekernf01 ekernf01 closed this as completed Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant