scverse / mudata

Multimodal Data (.h5mu) implementation for Python
https://mudata.rtfd.io
BSD 3-Clause "New" or "Revised" License
75 stars 17 forks source link

mdata2.write Issue #81

Closed ouyaqing closed 2 weeks ago

ouyaqing commented 2 weeks ago

Hi,

I used Muon to analyse my CITE-seq data. During analysis, I changed the index name to add the sample information.

When I tried to save it to h5mu file, it shows ValueError: DataFrame.index.name ('barcode') is also used by a column whose values are different. This is not supported. Please make sure the values are the same, or use a different name.

The code I run is mdata2.write('2024-09_Run3_mudata.h5ad')

The mdata2 information is Screenshot 2024-09-30 at 10 48 59

The mdata2.index is Screenshot 2024-09-30 at 10 48 14

Could you please help me with it?

Many thanks for your time.

ouyaqing commented 2 weeks ago

Hi, I think I have solved the issue by changing one of the column name via mdata.obs.rename(columns={"barcode": "original barcode"}, inplace=True) . This could be successfully save and read.