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_keyto replace.- copy
bool(default:False) if set to True, returns the updated anndata
- adata_original
- Return type:
- Returns:
If
copyis set toTrue, returns the original AnnData with the updated labels, otherwise returnsNone. The original_labels in original_key will be updated with the labels in subset_key.