scvelo.utils.cleanup

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

Delete not needed attributes.

Parameters:
  • adata (AnnData) – Annotated data matrix.

  • clean (Union[Literal['layers', 'obs', 'var', 'uns', 'all'], List[Literal['layers', 'obs', 'var', 'uns']]]) – Which attributes to consider for freeing memory.

  • keep (Union[str, List[str], None]) – Which attributes to keep.

  • inplace (bool) – Whether to update adata inplace or not.

Returns:

Returns or updates adata with selection of attributes kept.

Return type:

Optional[AnnData]