-
Notifications
You must be signed in to change notification settings - Fork 31
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
Can't save MuData object to h5mu file #57
Comments
Hey @josenachorr, thanks for reporting, which Please note this is expected to be fixed by an upgrade to the |
@josenachorr, and in case you wanted to try that scverse/mudata#8 PR out and let us know if it works for you, that would also be great of course! |
Besides not being able to write to h5mu files, are there any blatant issues with working with AnnData v0.8? I have several v0.8 files written from Scanpy that I intend to load into Muon and assign to the RNA aspect of the MuData object so I don't think I can install a previous version. |
Only the I/O should be affected due to the changes in AnnData.
|
@gtca Thank you for your fast reply! |
I'm sorry, I'm unfamiliar with this process. How can I do this in Windows with my python installation via Anaconda? |
@josenachorr and @matthew-levy, you should be able to give it a go with the
|
Thanks @gtca I could install it with no problem. Unfortunately, an error still occurs when trying to write the object (a different one this time):
|
Hey @josenachorr, I think this is an AnnData v0.8 thing. The following code causes the same error: import numpy as np
from anndata import AnnData
x = np.random.normal(size=(10,20))
ad = AnnData(x, dtype=np.float32)
ad.obs["_index"] = "test"
ad.write("issue57.h5ad")
# => ValueError: '_index' is a reserved name for dataframe columns.
# => Above error raised while writing key 'obs' of <class 'h5py._hl.group.Group'> to / I'll also tag @ivirshup for this. |
I believe the issues related to |
Can we reopen this an pin the current version of mudata to an older version of anndata? This isn't resolved: Files to reproduce 👇 import anndata as ad
import mudata as mu
print("anndata version: " + str(ad.__version__))
print("mudata version: " + str(mu.__version__))
rna = ad.read_h5ad("./rna.small.h5ad")
atac = ad.read_h5ad("./atac.small.h5ad")
mdata = mu.MuData({'rna':rna, 'atac':atac})
mdata.write('mdata_minrep.h5mu') outputs
|
Hey @dburkhardt, Thanks for making it very easy to run your use case for me!
There's still a possibility I misunderstand your message but AnnData v0.8 brought forward incompatibility, which means that with |
Thanks @gtca! Can you please help me understand the reason why |
@dburkhardt, unless I'm missing something, it is though: |
Hmm okay, some folks on our team are still hitting this issue, I need to go check what versions they're using |
I created a MuData object that contains the AnnData for 2 modalities, did some basic filtering of the datasets and then tried to save it with:
joint.write("joint_data.h5mu")
but this throws the following error:I also tried to save only a MuData object with just the raw matrices (no more metadata), but it throws the same error, also when trying to save each of the modalities alone (in a MuData object with only 1 modality).
I am using python '3.8.12', scanpy '1.9.1' and muon '0.1.2'
Thank you for your help, this is a very useful tool.
The text was updated successfully, but these errors were encountered: