scverse / mudata

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

Better text representation #44

Closed gtca closed 4 months ago

gtca commented 1 year ago

As mentioned in https://github.com/scverse/mudata/issues/13#issuecomment-1359332152, text representation could be updated to better reflect the hierarchy in the object as well as to indicate axes.

gtca commented 4 months ago

51 brings enhancements that should improve user experience namely displaying the hierarchy of modalities

print(mdata.mod)
# MuData
# ├─ rna AnnData (10100 x 1234)
# └─ prot AnnData (10100 x 42)

and spelling out the shared axes for non-default axes

print(rna_mdata)
# MuData object with n_obs × n_vars = 100 × 10 (shared obs and var)
#   2 modalities
#     raw:  10100 x 1234
#     preproc:  9999 x 1111

which works together for nested MuData objects:

print(nested_mdata.mod)
# MuData
# ├─ rna MuData [shared obs and var] (10100 × 1234)
# │  ├─ raw AnnData (10100 x 1234)
# │  └─ preproc AnnData (9999 x 1111)
# └─ prot AnnData (10100 x 42)