Closed mckellardw closed 1 year ago
@mckellardw Could you provide the h5ad file for us to investigate?
Here is a downsampled dataset containing 1000 DNBs. sub1000.zip
Thanks!
@mckellardw Hi! Thanks for your bug report.
I browsed the source code of AnnData both 0.7.5 (which is specified by Stereopy and SAW) and 0.8.0 (I guess you are using this one).
There are differences between the two versions.
v0.8.0 is using dict to reformat the anndata.obsm
v0.7.5 is not, that's why the SAW h5ad's obsm key encoding-type
appears to be None
Maybe you could try using anndata==0.7.5
to create your h5ad?
Hope this can help you solve the problem!
I discuss this bug with my colleagues and make an conclusion that we will fix this in the function read_ann_h5ad
to adapt to both 0.7.5 and 0.8.0.
Later you can try our v0.13.0.
Thanks for your bug report again! @mckellardw
Thanks very much! I was actually using anndata==0.9.0
, but reverting to anndata==0.7.5
worked.
I am trying to load in an h5ad file, where I have saved the spatial coordinates with the following code:
When I read in the h5ad file with stereopy, I get an error saying
ValueError: Unfamiliar 'encoding-type': dict.
Full error:
This appears to be caused by an issue in
stereopy.io.h5ad
whereread_group
does not expect the encoding type ofadata.obsm
to be a dict (https://github.com/BGIResearch/stereopy/blob/main/stereo/io/h5ad.py#L342). Looking at other h5ad files output from theSAW
pipeline, it appears that theobsm
key is expected to have an encoding type ofNone
.How can I add the spatial coordinates to the anndata object, without changing the encoding type of
adata.obsm
?