Skip to content
This repository has been archived by the owner on Jan 6, 2024. It is now read-only.

Function to update existing cell type annotations #194

Open
Zethson opened this issue Mar 9, 2022 · 0 comments
Open

Function to update existing cell type annotations #194

Zethson opened this issue Mar 9, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@Zethson
Copy link
Member

Zethson commented Mar 9, 2022

new_cell_types = {
    "37": "Lyg6+ Neutrophils",
    "13": "Retnlg+ Neutrophils",
    "29": "Ccl3+ Neutrophils",
    "34": "Basophils"
}
new_obs = adata.obs.copy()
new_obs = new_obs.astype({"cell_type": "str"})
for cluster_number, new_celltype in new_cell_types.items():
    new_obs.loc[new_obs['leiden_1_5'] == cluster_number, "cell_type"] = new_celltype
adata.obs = new_obs

Could parameterize something like this

@Zethson Zethson added the enhancement New feature or request label Mar 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant