You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of anndata.
(optional) I have confirmed this bug exists on the master branch of anndata.
Report
When concatenating any anndata files that contain a mapping for alternative axis (e.g. concatenating along obs and having varm), the command fails. Moreover, the uns_merge argument is completely ignored.
Traceback (most recent call last):
File "/mnt/shared/scratch/mmicik/rna-scripts/merge_adatas.py", line 68, in <module>
ad.experimental.concat_on_disk(
File "/mnt/apps/users/mmicik/conda/envs/rna-python/lib/python3.12/site-packages/anndata/experimental/merge.py", line 630, in concat_on_disk
_write_alt_mapping(groups, output_group, alt_axis_name, alt_index, merge)
File "/mnt/apps/users/mmicik/conda/envs/rna-python/lib/python3.12/site-packages/anndata/experimental/merge.py", line 381, in _write_alt_mapping
write_elem(output_group, alt_axis_name, alt_mapping)
File "/mnt/apps/users/mmicik/conda/envs/rna-python/lib/python3.12/site-packages/anndata/_io/specs/registry.py", line 487, in write_elem
Writer(_REGISTRY).write_elem(store, k, elem, dataset_kwargs=dataset_kwargs)
File "/mnt/apps/users/mmicik/conda/envs/rna-python/lib/python3.12/site-packages/anndata/_io/utils.py", line 249, in func_wrapperreturn func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/mnt/apps/users/mmicik/conda/envs/rna-python/lib/python3.12/site-packages/anndata/_io/specs/registry.py", line 354, in write_elemreturn write_func(store, k, elem, dataset_kwargs=dataset_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/apps/users/mmicik/conda/envs/rna-python/lib/python3.12/site-packages/anndata/_io/specs/registry.py", line 71, in wrapper
result = func(g, k, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/apps/users/mmicik/conda/envs/rna-python/lib/python3.12/site-packages/anndata/_io/specs/methods.py", line 353, in write_mapping
_writer.write_elem(g, sub_k, sub_v, dataset_kwargs=dataset_kwargs)
File "/mnt/apps/users/mmicik/conda/envs/rna-python/lib/python3.12/site-packages/anndata/_io/utils.py", line 249, in func_wrapperreturn func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/mnt/apps/users/mmicik/conda/envs/rna-python/lib/python3.12/site-packages/anndata/_io/specs/registry.py", line 351, in write_elem
write_func =self.find_write_func(dest_type, elem, modifiers)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/apps/users/mmicik/conda/envs/rna-python/lib/python3.12/site-packages/anndata/_io/specs/registry.py", line 318, in find_write_funcreturnself.registry.get_write(dest_type, type(elem), modifiers, writer=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/apps/users/mmicik/conda/envs/rna-python/lib/python3.12/site-packages/anndata/_io/specs/registry.py", line 134, in get_writeraise IORegistryError._from_write_parts(dest_type, src_type, modifiers)
anndata._io.specs.registry.IORegistryError: No method registered for writing <class 'pandas.core.series.Series'> into <class 'h5py._hl.group.Group'>
Error raised while writing key 'gene_id' of <class 'h5py._hl.group.Group'> to /var
Upon examining the source code, I have noticed that in the _write_alt_mapping function, the mapping data (corresponding to varm group) is attempting to be written into var. After changing this part, concatenation completes, but uns is still missing in the result. Well, turns out the reason for this is that the code meant to merge uns is also missing.
I've had my go at fixing these issues, see my commit. For my data, it works with no problems. I was hesitant to create a PR with this fix, as I have not written appropriate tests for my change, but here it is #1855.
Please make sure these conditions are met
Report
When concatenating any anndata files that contain a mapping for alternative axis (e.g. concatenating along
obs
and havingvarm
), the command fails. Moreover, theuns_merge
argument is completely ignored.Code:
Traceback:
Upon examining the source code, I have noticed that in the
_write_alt_mapping
function, the mapping data (corresponding tovarm
group) is attempting to be written intovar
. After changing this part, concatenation completes, butuns
is still missing in the result. Well, turns out the reason for this is that the code meant to mergeuns
is also missing.I've had my go at fixing these issues, see my commit. For my data, it works with no problems. I was hesitant to create a PR with this fix, as I have not written appropriate tests for my change, but here it is #1855.
Versions
The text was updated successfully, but these errors were encountered: