squidpy.pl.extract
- squidpy.pl.extract(adata, obsm_key='img_features', prefix=None)[source]
Create a temporary
anndata.AnnData
object for plotting.Move columns from
anndata.AnnData.obsm
['{obsm_key}']
toanndata.AnnData.obs
to enable the use ofscanpy.plotting
functions.- Parameters:
adata (
AnnData
) – Annotated data object.obsm_key (
Union
[List
[str
],str
]) – Entries inanndata.AnnData.obsm
that should be moved toanndata.AnnData.obs
.prefix (
Union
[List
[str
],str
,None
]) – Prefix to prepend to each column name. Should be a :class;`list` ifobsm_key
is alist
. If None, use the original column names.
- Return type:
- Returns:
: Temporary
anndata.AnnData
object with desired entries inanndata.AnnData.obs
.- Raises:
ValueError – If number of
prefixes
does not fit to number ofobsm_keys
.
Notes
If
anndata.AnnData.obs
['{column}']
already exists, it will be overwritten and a warning will be issued.