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

Not compatible with new AnnData file format/shape #2

Closed
kleurless opened this issue May 19, 2020 · 2 comments
Closed

Not compatible with new AnnData file format/shape #2

kleurless opened this issue May 19, 2020 · 2 comments
Labels
more-information-needed We need more information before this can be addressed

Comments

@kleurless
Copy link

kleurless commented May 19, 2020

Hi!

I tested out the package the other way around, I found a work-around to load an AnnData object in Seurat and did some analyses. Now I want to return with my new and improved Seurat-object to Scanpy.

So I followed the following steps:

SaveH5Seurat(object, filename = "ConvertTest.h5Seurat")
Convert("ConvertTest.h5Seurat", dest = "h5ad")

And it throws the following error when reading in with scanpy==1.4.6:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-2-977de11dd812> in <module>
----> 1 adata = sc.read_h5ad("../../data/output/embryo_Hb/embryo.test2.h5ad")

~\Anaconda3\envs\UMCU\lib\site-packages\anndata\_io\h5ad.py in read_h5ad(filename, backed, as_sparse, as_sparse_fmt, chunk_size)
    427     _clean_uns(d)  # backwards compat
    428 
--> 429     return AnnData(**d)
    430 
    431 

~\Anaconda3\envs\UMCU\lib\site-packages\anndata\_core\anndata.py in __init__(self, X, obs, var, uns, obsm, varm, layers, raw, dtype, shape, filename, filemode, asview, obsp, varp, oidx, vidx)
    296                 varp=varp,
    297                 filename=filename,
--> 298                 filemode=filemode,
    299             )
    300 

~\Anaconda3\envs\UMCU\lib\site-packages\anndata\_core\anndata.py in _init_as_actual(self, X, obs, var, uns, obsm, varm, varp, obsp, raw, layers, dtype, shape, filename, filemode)
    495             self._raw = None
    496         elif isinstance(raw, cabc.Mapping):
--> 497             self._raw = Raw(self, **raw)
    498         else:  # is a Raw from another AnnData
    499             self._raw = Raw(self, raw._X, raw.var, raw.varm)

~\Anaconda3\envs\UMCU\lib\site-packages\anndata\_core\raw.py in __init__(self, adata, X, var, varm)
     29         if adata.isbacked == (X is None):
     30             self._X = X
---> 31             self._var = _gen_dataframe(var, self.X.shape[1], ["var_names"])
     32             self._varm = AxisArrays(self, 1, varm)
     33         elif X is None:  # construct from adata

AttributeError: 'dict' object has no attribute 'shape'

And I think it has to do with the fact that they changed the file format in AnnData =>0.7

@mojaveazure
Copy link
Owner

There was a bug in early versions of SeuratDisk where an H5AD file generated by SeuratDisk could only be loaded with anndata.read(backed=True); however, more recent versions of SeuratDisk should have fixed this. Could you try again, using the latest version?

@mojaveazure mojaveazure added the more-information-needed We need more information before this can be addressed label Jun 15, 2020
@no-response
Copy link

no-response bot commented Jun 30, 2020

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more-information-needed We need more information before this can be addressed
Projects
None yet
Development

No branches or pull requests

2 participants