multigedi.io.save_model¶
- multigedi.io.save_model(adata, filename, *, key='gedi', compression='gzip')[source]¶
Save one GEDI result tree from
.unsto a safe NPZ archive.The archive contains a versioned JSON manifest and separate NumPy array members. It does not contain pickle data. Supported result values are nested dictionaries with string keys, lists, tuples, Python scalars, NumPy scalars, and non-object NumPy arrays.
- Parameters:
adata (
AnnData|MuData) – AnnData or MuData container with GEDI results.filename (
str|Path) – Output path..npzis added when no suffix is supplied; other suffixes are rejected.key (
str, default:'gedi') – Key inadata.unsormdata.unscontaining the result tree.compression (
str|None, default:'gzip') –"gzip"writes a compressed NPZ archive.Nonewrites an uncompressed NPZ archive.
- Return type:
Notes
This function saves only
adata.uns[key](ormdata.uns[key]). It does not save the data matrix, annotations, layers, embeddings, or loadings. Use H5AD/H5MU persistence when the full annotated object is required.Examples
>>> import multigedi as gd >>> gd.tl.gedi(adata, batch_key="sample") >>> gd.io.save_model(adata, "gedi_model.npz")