-
Notifications
You must be signed in to change notification settings - Fork 900
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
ReadH5AD error: object of type 'environment' is not subsettable #2485
Comments
I'm having the same error:
Matrix products: default locale: attached base packages: other attached packages: loaded via a namespace (and not attached): |
Not sure if this is the fix, but i faced the same error but the error was because the h5ad was constructed in scanpy 1.4.5 . when i downgraded to scanpy 1.4.4.post1 ( which worked fine before) and recreated the h5ad, there is no error |
Also getting this error, on both scanpy 1.4.5 and scanpy 1.4.4.post1 on Seurat 3.0.2 |
Hoping to up the priority for this fix. I'm also receiving the error for scanpy 1.4.5 and Seurat 3.0.2. |
I was having this problem until few minutes ago. So I downgraded anndata-0.7.1 to 0.6.22.post1, recomputed the data and overwrote the files. Now seurat reads it properly. I'm using Seurat-3.1.2 btw. |
I'm also getting this error for scanpy 1.4.5 and Seurat 3.1.0:
I tried changing my install of anndata by running: I then get this new output:
Installed X11, upgraded to Seurat 3.1.2 using
|
@kmuench adata = load_sparse_data |
Ahh, I didn't explicitly copy anything into raw, but I'm wondering if my issue is that I'm importing one of the test datasets? (Development of Myeloid Progenitors) I'm trying to save the output of the DCA pipeline (https://github.com/theislab/dca) which may not be affecting the same data slots as pp.scale:
|
Hi, has anyone come up with a solution to this? I'm having the same issue. |
same issue. |
I found if you set ReadH5AD's argument |
Unfortunately not for me. I still get
|
Apologies for the delay in responding. Please can you post the h5ad file (you can post a link for us to download, we would suggest making the object as small as possible to facilitate debugging), and we will take a look |
This toy dataset recreates the error --> (https://www.dropbox.com/s/c6kz82kcy6w0wbw/test.h5ad?dl=0) Thanks in advance! Errror ->
|
Regarding #2373, Line 2657 in 94343c4
There is a mismatch of dimension shapes between
This solves the issue (removing the
Although,I currently don't have a clue why the dimension shapes do not match N.B.: Loading the same H5AD file in |
Hi @dweemx I tried that fix but it didn't work out either. Could you check my approach to see if it match yours? Thanks in advance! I created a custom "as.sparse.H5Group"
Set the function up and running
Check is correct
But I get again while loading -->
|
Hey @franciscogrisanti, |
Thanks for the prompt response @dweemx Could you provide me your scanpy/seurat version? Thanks again! Mine are -> For scanpy
|
Mine are these: Scanpy
Seurat
Seems that you are using the latest version of |
Thank you so much @dweemx I was able to load the H5AD object into seurat 😁 |
So what was the issue ? Did you fix it by downgrading |
I think the issue is in h5py==2.10.0. Any .h5ad object exported with this version breaks while loading into Seurat 3.4.1. I then exported my objects as .loom Downgraded to h5py==2.9.0, loaded the .loom, exported as .h5ad again. And finally, I was able to read them in Seurat. I had to did the .loom trick, because apparently there is no backward compatibility between h5py==2.10.0 and h5py==2.9.0 for the h5ad files either. |
My issue was resolved with downgrading h5py to 2.9.0 too and remaking the .h5ad files. Thanks for the solution. |
Downgrading h5py to 2.9.0 and remaking the .5had file did not fix the issue for me. |
Neither did it work for me. Did you downgrade scanpy or anndata? |
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. |
I installed all my software using Conda. Scanpy==1.4.4.post1, anndata==0.6.22.post1. |
I decided to export to |
Currently it seems that the latest version of Scanpy doesn't produce a h5ad file that Seurat can read. The |
This issue is a major blocker |
Using the library SeuratDisk worked for me with the latest versions of Seurat and Scanpy. |
I'm having the same issue. Setting
|
using SeuratDisk worked for me :) |
SeuratDisk unfortunately didn't work out for me. does anyone face a similar issue? |
SeuratDisk did not work for me either. The .hda5 file that I am using is here. It was generated in this blog post where the blog writer has video links to how they converted multiple .tar.gz and .csv files into this one file. |
Hi,
Import scanpy and object
Format count and normalized data for their respective slots
Create the Seurat object
Import dim. reductions
An object of class Seurat
|
Hi @kvshams, thanks for the detailed example. I am trying to follow your code and getting an error at the "Import scanpy and object" step.
Any thoughts on how to get past this error ? Thanks. |
I would like to share my similar experience while converting seurat to anndata Code: Error message: I have two datasets. Dataset_A runs completely fine and dataset_B gives the above error. Both have the same length. The only difference is that dataset_B@meta.data contains an additional column "pseudotime". This column contains floats ranging from 0 to 1, with no negative values. Removing this single column solves the problem and the codes run without errors. This "pseudotime" column was not generated from Seurat function but rather I added it manually to the Seurat object. I suspect that the problem may be one of your columns @meta.data contain prohibited format. Hope that helps. Thanks, |
When I used ReadH5AD to read a .h5ad file generated from scanpy, there was an error:
Pulling expression matrices and metadata
Data is unscaled
Error in file[["obs"]][]: object of type 'environment' is not subsettable
Traceback:
and my code is adata = ReadH5AD(file ="../adata_raw.h5ad",verbose = TRUE)
adata_raw.h5ad information:
AnnData object with n_obs × n_vars = 52049 × 19760
obs: 'donor', 'disease', 'tissue', 'celltype', 'name', 'protocol', 'gse_id', 'n_genes'
var: 'n_cells'
When I used ReadH5AD to read a smaller adata.h5ad(15704 x 14895) file, it did not report an error.
AnnData object with n_obs × n_vars = 15704 × 14895
obs: 'batch', 'celltype', 'disease', 'donor', 'library', 'name', 'protocol', 'gse_id', 'n_genes'
var: 'n_cells'
Does anyone give me some advice? Thanks!
The text was updated successfully, but these errors were encountered: