-
Notifications
You must be signed in to change notification settings - Fork 5
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
I keep getting error when running spatialdm_local AttributeError: 'NoneType' object has no attribute 'to_adata' #28
Comments
After my testing, you might need to store the original expression matrix in .raw. |
Thank you that fixed it but now I am getting a new error when I am trying to save anndata object using Here is the error.
Can you please comment on why is that and how to circumvent it? |
It may be an issue with the current version of Anndata, and I have encountered a similar problem before. I tried to individually save some items stored in the .uns attribute to bypass this bug. adata.uns['local_z_p'].to_csv(savedir+'sdm_test_local_z_p.csv')
adata.uns['selected_spots'].to_csv(savedir+'sdm_test_selected_spots.csv')
del adata.uns['local_z_p']
del adata.uns['selected_spots']
# Use sdm for storage
sdm.write_spatialdm_h5ad(adata, filename=savedir+'save_sdm__test_.h5ad') Additionally, it is also possible that some values stored in the .obs attribute are null, leading to this issue. |
Do I have to remove all the adata.uns objects. I have not looked at your code in detail but a cursory glance indicates that following uns data might have to be removed before saving the adata object.
Let me know if I am missing something. For many of them Also, which version of anndata/scanpy did you test/publish your code (where you did not get any errors while saving anndata object)? Because I am getting a lot of errors with mine while trying to save the anndata. My anndata version is : 0.10.3 |
Have you checked for 'null' values in your 'obs', 'obsm', and 'uns'? It seems that there are some null values in the DataFrame. Personally, I have encountered an issue where 'adata.uns['local_z_p']' and 'adata.uns['selected_spots']' cannot be saved using 'adata.write_h5ad', so I saved them using 'to_csv'. My anndata version is : 0.8.0 |
I understand why some of unstructured data may not work when writing anndata file. What I don't understand is why I would run into errors when doing pickle dump of that unstructured data. e.g. When i try to do the following :
I still get error saving picke file. |
Hi,
I followed the spatial dm example but I keep getting errors when running spatialdm_local.
Below is the code I am running.
And here is the error I am getting.
The text was updated successfully, but these errors were encountered: