muon icon indicating copy to clipboard operation
muon copied to clipboard

Introduce explicit syntax to detach backed modalities

Open gtca opened this issue 5 years ago • 0 comments

If a modality has been backed inside .h5mu, on copy/write operations we might want to have a clearly defined behaviour. In particular the proposal is to differentiate between modalities linked to the MuData object and modalities detached from it:

mdata = mu.read('rna_atac.h5mu', backed=True)

rna = mdata['rna']
#          ^__ linked
rna.copy('rna.h5ad')
# => Error referring the user to the MuData object

rna = mdata.mod['rna']
#          ^__ detached
rna.copy('rna.h5ad')
# => Success

This proposal has been brought forward by @ilia-kats and has been originally discussed in the issue #17.

gtca avatar Dec 14 '20 14:12 gtca