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

Some troubles with Loading data #332

Closed
XUEbaogai0101 opened this issue Apr 10, 2022 · 3 comments
Closed

Some troubles with Loading data #332

XUEbaogai0101 opened this issue Apr 10, 2022 · 3 comments

Comments

@XUEbaogai0101
Copy link

XUEbaogai0101 commented Apr 10, 2022

Hi Dr.Qiu,
I met problem when I use dyn.read() to read my loom data, which was processing by velocyto and run sucessfully in scvelo.
But it seems that something wrong with my data, but I don' know how to fix it.
Error shows as following:

`
adata = dyn.read('WT.loom')
TypeError Traceback (most recent call last)
/tmp/ipykernel_1760149/501344354.py in
----> 1 adata = dyn.read('WT.loom')

~/miniconda3/envs/dynamo/lib/python3.7/site-packages/anndata/_io/h5ad.py in read_h5ad(filename, backed, as_sparse, as_sparse_fmt, chunk_size)
440 _clean_uns(d) # backwards compat
441
--> 442 return AnnData(**d)
443
444

TypeError: init() got an unexpected keyword argument 'attrs'
`

And I find some problems when I read a concatenated anndata as well which also was processing by velocyto and I didn't process it.

`adata = scv.read('WT.loom', cache=True)
ldata = scv.read('WC.loom', cache=True)
aaa=adata.concatenate(ldata,join='outer')
aaa.write('WT_WC_.h5ad',compression="gzip")
adata = dyn.read('WT_WC_.h5ad')

KeyError Traceback (most recent call last)
~/miniconda3/envs/dynamo/lib/python3.7/site-packages/anndata/_io/utils.py in func_wrapper(elem, *args, **kwargs)
155 try:
--> 156 return func(elem, *args, **kwargs)
157 except Exception as e:

~/miniconda3/envs/dynamo/lib/python3.7/site-packages/anndata/_io/h5ad.py in read_group(group)
531 if encoding_type:
--> 532 EncodingVersions[encoding_type].check(
533 group.name, group.attrs["encoding-version"]

~/miniconda3/envs/dynamo/lib/python3.7/enum.py in getitem(cls, name)
356 def getitem(cls, name):
--> 357 return cls.member_map[name]
358

KeyError: 'dict'

During handling of the above exception, another exception occurred:

AnnDataReadError Traceback (most recent call last)
/tmp/ipykernel_1760149/353394512.py in
----> 1 adata = dyn.read('WT_WC_.h5ad')

~/miniconda3/envs/dynamo/lib/python3.7/site-packages/anndata/_io/h5ad.py in read_h5ad(filename, backed, as_sparse, as_sparse_fmt, chunk_size)
424 d[k] = read_dataframe(f[k])
425 else: # Base case
--> 426 d[k] = read_attribute(f[k])
427
428 d["raw"] = _read_raw(f, as_sparse, rdasp)

~/miniconda3/envs/dynamo/lib/python3.7/functools.py in wrapper(*args, **kw)
838 '1 positional argument')
839
--> 840 return dispatch(args[0].class)(*args, **kw)
841
842 funcname = getattr(func, 'name', 'singledispatch function')

~/miniconda3/envs/dynamo/lib/python3.7/site-packages/anndata/_io/utils.py in func_wrapper(elem, *args, **kwargs)
161 parent = _get_parent(elem)
162 raise AnnDataReadError(
--> 163 f"Above error raised while reading key {elem.name!r} of "
164 f"type {type(elem)} from {parent}."
165 )

AnnDataReadError: Above error raised while reading key '/layers' of type <class 'h5py._hl.group.Group'> from /.
`

Thank you very much!
XUE

@XUEbaogai0101
Copy link
Author

I find some answers about the concatenated anndata, it seems that the format of an AnnData objects stored on disk is updated in the latest version.
scverse/anndata#698 (comment)

@Xiaojieqiu
Copy link
Collaborator

Hi @XUEbaogai0101 thanks for using dynamo. You are right, this is an anndata version issue. what is your anndata version?

also have you tried to use adata = dyn.read_loom('WT.loom')?

@XUEbaogai0101
Copy link
Author

Hi Dr.Qiu!@Xiaojieqiu
Thank you for answering my question. My anndata version is 0.8.0.
I tried the use of read_loom, it worked. What a simple question, I am sorry for my sloppiness.
Thanks for your generous answer again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants