Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrongly use cnames instead of cnamesDBlabel for annotation after reclustering #301

Closed
matchy233 opened this issue Jul 4, 2023 · 0 comments · Fixed by #306
Closed

Wrongly use cnames instead of cnamesDBlabel for annotation after reclustering #301

matchy233 opened this issue Jul 4, 2023 · 0 comments · Fixed by #306

Comments

@matchy233
Copy link
Contributor

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"
    )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant