Wrongly use `cnames` instead of `cnamesDBlabel` for annotation after reclustering
matchy233 opened this issue · 0 comments
matchy233 commented
In the reclustering part of the celltype annotation workbook, it seems to wrongly use cnames
instead of cnamesDBlabel
to re-label the subclusters after we finished the reclustering.
I've highlighted the lines that require notice below
- cnames = bc.tl.sig.make_anno(df, sigscores, sigconfig, levsk, toexclude=toexclude)
- cnamesDBlabel = bc.tl.sig.obtain_dblabel(
- bescapath + "/besca/datasets/nomenclature/CellTypes_v1.tsv", cnames
- )
adata_rc.obs["celltype0"] = bc.tl.sig.add_anno(
adata_rc, cnamesDBlabel, "celltype0", "leiden"
)
adata_rc.obs["celltype2"] = bc.tl.sig.add_anno(
adata_rc, cnamesDBlabel, "celltype2", "leiden"
)
adata_rc.obs["celltype3"] = bc.tl.sig.add_anno(
adata_rc, cnamesDBlabel, "celltype3", "leiden"
)
# Lex order needed.
names_2 = []
names_3 = []
for i in range(cnames.shape[0]):
- names_2 += [cnames["celltype2"][str(i)]]
- names_3 += [cnames["celltype3"][str(i)]]
bc.tl.rc.annotate_new_cellnames(
- adata, adata_rc, names=names_2, new_label="celltype2", method="leiden"
)
bc.tl.rc.annotate_new_cellnames(
- adata, adata_rc, names=names_3, new_label="celltype3", method="leiden"
)