scvelo.utils.cleanup

scvelo.utils.cleanup(data, clean='layers', keep=None, copy=False)

Delete not needed attributes.

Parameters:
data : AnnData

Annotated data matrix.

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

Which attributes to consider for freeing memory.

keep : str, List[str], None

Which attributes to keep.

copy : bool

Return a copy instead of writing to adata.

Return type:

AnnData, None

Returns:

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