dotools_py.utility.transfer_labels

dotools_py.utility.transfer_labels#

dotools_py.utility.transfer_labels(adata_original, adata_subset, original_key, subset_key, original_labels, copy=False)[source]#

Transfer annotation from a subset AnnData to an AnnData.

Parameters:
adata_original AnnData

original AnnData.

adata_subset AnnData

subsetted AnnData.

original_key str

obs column name in the original AnnData where new labels are added.

subset_key str

obs column name in the subsetted AnnData with the new labels.

original_labels list

list of labels in original_key to replace.

copy bool (default: False)

if set to True, returns the updated anndata

Return type:

AnnData | None

Returns:

If copy is set to True, returns the original AnnData with the updated labels, otherwise returns None. The original_labels in original_key will be updated with the labels in subset_key.