scverse / mudata

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

Make sure `mdata.uns` is also printed #29

Closed rcannood closed 1 year ago

rcannood commented 1 year ago

Right now, the .uns slot in a MuData object is not being printed, despite one being there:

>>> result
MuData object with n_obs × n_vars = 134629 × 5605
  var:  'gene_symbol', 'feature_types', 'genome'
  1 modality
    rna:        134629 x 5594
      var:      'gene_symbol', 'feature_types', 'genome'

>>> result.uns
{'metrics_cellranger':    Category      Library Type           Grouped By Group Name                        Metric Name         Metric Value
0     Cells  Antibody Capture                  NaN        NaN     Antibody reads usable per cell                  0.9
1     Cells  Antibody Capture                  NaN        NaN                              Cells                3,694
2     Cells  Antibody Capture                  NaN        NaN         Median UMI counts per cell                 0.56
3     Cells   Gene Expression                  NaN        NaN                              Cells                3,694
4     Cells   Gene Expression                  NaN        NaN  Confidently mapped reads in cells               0.8217
...
[68 rows x 6 columns]}

This PR allows the .uns to be printed as well.

Credits to @DriesSchaumont for spotting this issue!

Zethson commented 1 year ago

@gtca any objections?

gtca commented 1 year ago

Thanks @rcannood and @DriesSchaumont!