scvelo.utils.cleanup(adata, clean='layers', keep=None, inplace=True)

Delete not needed attributes.

adata : AnnData

Annotated data matrix.

clean : _Genericalias[layers, obs, var, uns, all], List[_Genericalias[layers, obs, var, uns]]

Which attributes to consider for freeing memory.

keep : str, List[str], None

Which attributes to keep.

inplace : bool

Whether to update adata inplace or not.

Return type:

AnnData, None


Optional[AnnData] – Returns or updates adata with selection of attributes kept.