loki.preprocess.get_library_id

loki.preprocess.get_library_id(adata)

Retrieves the library ID from the AnnData object, assuming it contains spatial data. The function will return the first library ID found in adata.uns[‘spatial’].

Parameters:

adata – AnnData object containing spatial information in adata.uns[‘spatial’].

Returns:

The first library ID found in adata.uns[‘spatial’].

Raises:

AssertionError: If ‘spatial’ is not present in adata.uns. Logs an error if no library ID is found.